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

Re: postMessage is the new wtf

From: Dmitry Lomov <dslomov@chromium.org>
Date: Tue, 13 Dec 2011 13:06:34 -0800
Message-ID: <CAObu7DHoX4j8BQKeMFBjATD3wS0c5_8gSUfL7CLyLAmC84vVsA@mail.gmail.com>
To: Charles Pritchard <chuck@jumis.com>
Cc: Rick Waldron <waldron.rick@gmail.com>, Webapps WG <public-webapps@w3.org>
On Tue, Dec 13, 2011 at 12:30 PM, Charles Pritchard <chuck@jumis.com> wrote:

> 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})
>

In what we ship today in WebKit, this will be an exception, because cloning
of message ports is not supported.


>
> 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.
>
>
> -Charles
>
>
Received on Tuesday, 13 December 2011 21:07:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:49 GMT