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

Re: Should send() be able to take an ArrayBufferView?

From: Kenneth Russell <kbr@google.com>
Date: Wed, 11 Apr 2012 14:54:04 -0700
Message-ID: <CAMYvS2cy-e-bwzqP2herp8uDjdyDv0JPpwTHUOtfnZr5yGxA1w@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: public-webapps <public-webapps@w3.org>
On Wed, Apr 11, 2012 at 2:48 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 4/11/12 5:41 PM, Kenneth Russell wrote:
>>
>> Sending an ArrayBufferView would still have to use "arraybuffer" as
>> the type of data. I don't think it would be a good idea to try to
>> instantiate the same subclass of ArrayBufferView on the receiving
>> side.
>
>
> I'm not sure what this means...

What I mean is that if somehow a browser were on the receiving end of
one of these messages, the type of the incoming message should still
be "arraybuffer".

> For XHR.send(), sending an ArrayBufferView should take the byte array that
> the ArrayBufferView is mapping, and send that.  It's possible to achieve the
> same thing now with some hoop jumping involving a possible buffer copy; I'm
> just saying we should remove the need for that hoop jumping.

Agree that these should be the semantics.

> I haven't looked at WebSocket in enough detail to comment intelligently on
> it.

I haven't really either, but if there were some peer-to-peer support,
then the receiving peer should still get an ArrayBuffer even if the
sender sent an ArrayBufferView.

-Ken
Received on Wednesday, 11 April 2012 21:54:33 GMT

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