W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

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

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 10 Jun 2011 20:33:36 +0000 (UTC)
To: Travis Leithead <Travis.Leithead@microsoft.com>
cc: "kbr@google.com" <kbr@google.com>, Andrew Wilson <atwilson@google.com>, Glenn Maynard <glenn@zewt.org>, Jonas Sicking <jonas@sicking.cc>, David Levin <levin@chromium.org>, Arthur Barstow <art.barstow@nokia.com>, Dmitry Lomov <dslomov@google.com>, ben turner <bent.mozilla@gmail.com>, "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <Pine.LNX.4.64.1106102025450.26539@ps20323.dreamhostps.com>
On Fri, 10 Jun 2011, Travis Leithead wrote:
> 
> This looks like a mis-reading on my part of step 2 of the postMessage 
> algorithm:
> 
> "2.If the method was called with a second argument ports and that 
> argument isn't null, then, if any of the entries in ports are null, if 
> any MessagePort object is listed in ports more than once, ***if any of 
> the MessagePort objects listed in ports have already been cloned once 
> before,**** or if any of the entries in ports are either the source port 
> or the target port (if any), then throw an INVALID_STATE_ERR exception.
> 
> Depending on how you look at it, this could be referring to the 
> underlying port object, or to the current port instance. Ian is on this 
> thread--I assume you now meant purely transfer of ownership?

It's referring to the MessagePort object itself, not the underlying port. 
Hence why it says "the MessagePort objects". :-)


With MessagePort, it never makes sense to copy them rather than transfer 
ownership. With ArrayBuffer and ImageData, both make sense in different 
scenarios (right now, ImageData is always copied, and ArrayBuffer isn't 
supported), so we presumably need something to support saying which you 
want. One way is to always copy unless the object is listed in an argument 
listing all the things to transfer instead of copy. Another way is to 
have two methods, one that copies and one that transfers (the things that 
can be transferred). The latter is slightly problematic in that you can't 
pick which things to transfer and which to copy if you need to mix them, 
and you can't later make something that today can only be copied (e.g. 
ImageData) into something that can also be transferred, which you _could_ 
do if we had the array model.

I haven't gone through this thread in detail to study all the proposals 
yet, but I am saving the e-mails on this thread to be able to do that when 
I get to this particular topic (hopefully quite soon, since I've received 
vendor feedback that Workers should get some attention soon).

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 10 June 2011 20:33:59 GMT

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