[whatwg] Proposal for enhancing postMessage

Mark S. Miller erights at google.com
Fri Mar 13 14:06:25 PDT 2009

On Wed, Mar 11, 2009 at 2:30 PM, Drew Wilson <atwilson at google.com> wrote:
> Mark, I won't pretend to completely understand the use cases you're
> describing as I'm not familiar with the prior work you've cited. But my
> understanding of the postMessage() API is that they are primarily useful for
> handing off ports to new owners - your idea of a pass-by-copy serialization
> of a proxy object implies that there's some way to copy the message port,
> and pass that along with the proxy to the new owner, which I don't think is
> possible in general (you can create a new port as part of a MessageChannel,
> but you can't really duplicate an existing port).
> I may be misunderstanding the use case that's driving your proposal, though.

And I may be misunderstanding the postMessage draft spec. But step 4
of 7.4.4 at

> Try to obtain a new port by cloning the messagePort argument
> with the Window object on which the method was invoked as
> the owner of the clone. If this returns an exception, then throw
> that exception and abort these steps.

Doesn't this mean that sending a MessagePort actually sends a clone?


More information about the whatwg mailing list