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 11:12 AM, Dmitry Lomov <dslomov@google.com> wrote:
> a) Recursive transfer lists. Allow arbitrary objects, not only ArrayBuffers,
> to appear in transfer lists.  ArrayBuffers that are under objects in
> transfer lists are transferred, others are cloned.

This again causes the same forwards-compatibility problem.  If you do this:

frame = { video: canvasPixelArrayInstance, histogram: arrayBuffer } }
postMessage({ frame: frame }, { transfer: frame });

and you expect only histogram to be transferred (since that's all that
supports it when you write this code), your code breaks when
CanvasPixelArray later supports it.

> b) Transfer lists + separate transferMessage method. We still equip
> postMessage with transfer lists, these transfer lists list ArrayBuffers, and
> we provide a separate method transferMessage with recursive transfer
> semantics.
> What do people think?

Same problem.

If you want a quicker way to transfer all messages of given types, see
my previous mail: { transfer: ArrayBuffer }.

-- 
Glenn Maynard

Received on Friday, 3 June 2011 16:46:54 UTC