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

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

From: David Levin <levin@chromium.org>
Date: Wed, 22 Jun 2011 01:33:48 -0700
Message-ID: <BANLkTikSGgnOv5maryq=rzaSU7i1zCaNeg@mail.gmail.com>
To: Glenn Maynard <glenn@zewt.org>
Cc: Jonas Sicking <jonas@sicking.cc>, Ian Hickson <ian@hixie.ch>, Andrew Wilson <atwilson@google.com>, Kenneth Russell <kbr@google.com>, 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>, Travis Leithead <Travis.Leithead@microsoft.com>
On Wed, Jun 22, 2011 at 12:26 AM, Glenn Maynard <glenn@zewt.org> wrote:

> On Wed, Jun 22, 2011 at 3:14 AM, David Levin <levin@chromium.org> wrote:
>
>> On Tue, Jun 21, 2011 at 11:43 PM, Glenn Maynard <glenn@zewt.org> wrote:
>>
>>> On Wed, Jun 22, 2011 at 1:57 AM, David Levin <levin@chromium.org> wrote:
>>>
>>>> Let's say the call doesn't throw when given a type B that isn't
>>>> transferrable.
>>>> Let's also say some later changes the javascript code and uses B after
>>>> the postMessage call.
>>>> Everything work. No throw is done and B isn't "gutted" because it isn't
>>>> transferrable.
>>>>
>>>
>>> Throwing for unsupported objects will break common, reasonable uses,
>>> making everyone jump hoops to use transfer.  Not throwing will only break
>>> code that seriously misuses the API, by listing objects for transfer and
>>> then continuing to use the object.
>>>
>>
>> Code always seriously misuses apis. See Raymond Chen's blog for numerous
>> examples if you have any doubt (http://blogs.msdn.com/b/oldnewthing/).
>>
>
> You didn't respond to the rest of my mail, where I pointed out that the
> misuse case will end up broken anyway as everyone will likely use a wrapper
> to get the no-exception behavior.  You'd have to, to support older browsers
> which don't support transfer for as many types.
>

If you insist....

Making people use a helper function like that is just making them jump an
> unnecessary hoop.
>

It makes them jump through another hoop to potentially misuse the api.

It shouldn't be simple to misuse apis.

Also, I haven't seen mention of Transferrable else where in the final
proposed solution which you used in that code.

dave
Received on Wednesday, 22 June 2011 08:34:32 GMT

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