W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: postMessage is the new wtf

From: Charles Pritchard <chuck@jumis.com>
Date: Tue, 13 Dec 2011 12:30:12 -0800
Message-ID: <4EE7B5D4.6010507@jumis.com>
To: Dmitry Lomov <dslomov@chromium.org>
CC: Rick Waldron <waldron.rick@gmail.com>, Webapps WG <public-webapps@w3.org>
On 12/13/11 11:11 AM, Dmitry Lomov wrote:
>    worker.postMessage({p:port, ab:arrayBuffer}, [post, arrayBuffer])
> work. Therefore this extension to postMessage semantics is both 
> backwards-compatible and consistent. On the receiving side, the 
> 'ports' property of event object will still contain only the message 
> ports from the transfer list, so that behavior is preserved as well.

What's the behavior if an array buffer or port is not on the 
transferrables list?
For example: worker.postMessage({p:port, ab:arrayBuffer})

The clone example you posted makes sense:
worker.postMessage({p:port, ab:arrayBuffer}, [post, arrayBuffer])

If transferrables is supported, it'll ensure the vars are neutered and 
referenced appropriately, and if they aren't supported, it'll still pass 
a copy of array buffer through the message data.

Received on Tuesday, 13 December 2011 20:37:25 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:37 UTC