[whatwg] onclose events for MessagePort

Ehsan Akhgari ehsan at mozilla.com
Thu Oct 17 14:10:28 PDT 2013

On Thu, Oct 17, 2013 at 5:08 PM, Ehsan Akhgari <ehsan at 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.


More information about the whatwg mailing list