W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2013

Re: [whatwg] onclose events for MessagePort

From: Ehsan Akhgari <ehsan@mozilla.com>
Date: Thu, 17 Oct 2013 17:10:28 -0400
Message-ID: <CANTur_6dydyT+Fzrgc7svZ3jccj2hV-0wFMvCJJzaAVN+T1oaA@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: WHAT Working Group <whatwg@lists.whatwg.org>, Boris Zbarsky <bzbarsky@mit.edu>, Ian Hickson <ian@hixie.ch>, Gene Lian <clian@mozilla.com>
On Thu, Oct 17, 2013 at 5:08 PM, Ehsan Akhgari <ehsan@mozilla.com> wrote:

> It occurs to me that all of the proposals here does expose some amount
>> of GC behavior. Even a "channeldropped" message which is sent only
>> when the other side crashes exposes GC behavior. If GC happens to run
>> before the crash and then collect the MessageChannel ports, then no
>> channel exists at the time of crash, and thus no event is sent.
>> However if the GC runs later, or if it doesn't successfully collect
>> the MessageChannel ports, then the "channeldropped" event does fire.
>>
>
> I'm not sure if I understand this.  If the MessagePort exists on the side
> that is interested to handle the event, then it can't be GCed on the other
> side either, right?
>

Also, having a setTimeout(0) loop which polls the attribute would open us
to the exact same risks as the event would, I think.

--
Ehsan
<http://ehsanakhgari.org/>
Received on Thursday, 17 October 2013 21:11:33 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:12 UTC