Re: What changes to Web Messaging spec are proposed? [Was: Re: Using ArrayBuffer as payload for binary data to/from Web Workers]

On Fri, Jun 3, 2011 at 2:44 AM, Dmitry Lomov <dslomov@chromium.org> wrote:
>> Now show me the code needed to send a message which contains one big
>> buffer from you that you want to transfer, along with some data that
>> you got from some other piece of code and which you do not want to
>> modify and which may or may not contain ArrayBuffers.
>
> I think this can be reversed: what if you got some data from some other
> piece of code that you do not really control and you want to transfer (i.e.
> transfer all the ArrayBuffers that are inside that data)?
> As in, the library gives you two methods, compute() that returns data and
> present(data) that presents it, and you want to pass data from worker to
> main thread without really caring what is inside that data.

One possibility would be, in addition to instances of object, to also
allow providing the object constructor, indicating that all objects of
that type should be transferred if supported.  {transfer:
[ArrayBuffer, ImageData]}

-- 
Glenn Maynard

Received on Friday, 3 June 2011 07:21:26 UTC