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

Re: [whatwg] onclose events for MessagePort

From: Andrew Wilson <atwilson@google.com>
Date: Thu, 10 Oct 2013 09:11:51 +0200
Message-ID: <CAArhhiszx_+dCseY6Wk285vVCtUEz35uFeSPPXkxNp0VTw18GQ@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: WHAT Working Group <whatwg@lists.whatwg.org>, Boris Zbarsky <bzbarsky@mit.edu>, Gene Lian <clian@mozilla.com>, Ian Hickson <ian@hixie.ch>, Ehsan Akhgari <ehsan@mozilla.com>
On Thu, Oct 10, 2013 at 8:58 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>
>
> I could see the GC case not being solvable.
>
> But is there a reason that we couldn't also fire the event if the
> other side is forcefully terminated through a navigation or a
> Worker.terminate() call?
>

I still have the concerns I expressed earlier about figuring out who the
owner is of the port in the case where you've passed a reference around to
multiple contexts. What does "other side is forcefully terminated" mean in
the case where you may have multiple iframes with references to the same
port?

i.e. if my iframe does this:

channel = new MessageChannel();
window.parent.port = channel.port1;
sharedWorker.port.postMessage("port", [channel.port2]);
window.location.href = "<some other url>"

What happens? Does the sharedWorker get channeldropped on it's cloned port?
I suspect this would be confusing to developers, who might otherwise expect
that merely handing a reference to port to its same-origin parent would be
sufficient to keep it alive.
Received on Thursday, 10 October 2013 07:12:19 UTC

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