[whatwg] ArrayBuffer and the structured clone algorithm

Kenneth Russell kbr at google.com
Mon Jan 31 22:47:26 PST 2011

On Mon, Jan 31, 2011 at 3:10 PM, Ian Hickson <ian at hixie.ch> wrote:
> On Fri, 7 Jan 2011, David Flanagan wrote:
>> The structured clone algorithm currently allows ImageData and Blob
>> objects to be cloned but doesn't mention ArrayBuffer.  Is this
>> intentional?  I assume there are no security issues involved, since one
>> could copy the bytes of an ArrayBuffer into either a Blob or an
>> ImageData object in order to clone them.
> It's intentional in that I'm waiting for ArrayBuffer to be more stable
> before I add it throughout the spec. (Same with CORS and the various
> places that might support cross-origin communication, e.g. Web Workers,
> Server-Sent Events, <img>+<canvas>, etc.)

There's been some preliminary discussion within the WebGL working
group (where ArrayBuffer / Typed Arrays originated) about using
ArrayBuffer with Web Workers in particular. There is a strong desire
to support handoff of an ArrayBuffer from the main thread to a worker
and vice versa; this would allow efficient producer/consumer queues to
be built without violating ECMAScript's shared-nothing semantics.

All of the parties involved are pretty busy getting WebGL 1.0 out the
door; once that happens, we aim to make one more revision to the Typed
Array spec to support (1) read-only arrays for more efficient XHRs and
(2) handoff of ArrayBuffers. Expect public discussions to start in
about six to eight weeks.


More information about the whatwg mailing list