W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2009

[whatwg] Changing postMessage() to allow sending unentangled ports

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 2 Sep 2009 22:34:48 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0909022233550.6775@hixie.dreamhostps.com>
On Fri, 28 Aug 2009, Drew Wilson wrote:
>
> I'm saying that we should differentiate between the "closed" state and 
> "cloned" state. Implementors effectively need to do this anyway, because 
> the spec says that closed ports are still task sources, while cloned 
> ports are not.
> 
> It makes sense to be able to post closed ports via postmessage() because 
> they are still task sources so the recipient could attach an onmessage 
> handler and pull messages off them.
> 
> It makes no sense to re-send an already-cloned port since it's not a 
> task source and can't ever be a task source again (no way to send 
> messages to it). Likewise it is no longer entangled and so you can't 
> send messages via it. Re-sending a cloned port is an error, and we 
> should treat it as such.

I've made the two postMessage() methods that post MessagePort objects 
throw INVALID_STATE_ERR if any of their ports have already been cloned.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 2 September 2009 15:34:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:52 UTC