W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2010

Re: [XHR2] ArrayBuffer integration

From: Chris Marrin <cmarrin@apple.com>
Date: Tue, 28 Sep 2010 07:32:48 -0700
Cc: Web Applications Working Group WG <public-webapps@w3.org>, Jian Li <jianli@chromium.org>, Anne van Kesteren <annevk@opera.com>, Julian Reschke <julian.reschke@gmx.de>, Kenneth Russell <kbr@google.com>, Vladimir Vukicevic <vladimir@mozilla.com>, Chris Rogers <crogers@google.com>
Message-id: <E1D47DF4-F1EA-48A0-B467-C41403BE48A0@apple.com>
To: Michael Nordman <michaeln@google.com>

On Sep 27, 2010, at 6:22 PM, Michael Nordman wrote:

> A couple of us have been looking at webkit's XHR impl and realized that to support performant access to the response via responseArrayBuffer and responseText would cause us to keep two copies of the data around, a raw data buffer and the second decoded text buffer. Considering the overwhelming number of responseText only use cases, it would be nice to not incur extra costs to support a new binary accessor which would be rarely used compared to the text accessor. So some way of making these mutually exclusive in the API.
> Should we have an asArrayBuffer attribute (or similar) to tell XHR up front how the caller wishes to access the response?
> Or maybe specify the accessors such that when you use responseText you can not later access responseArrayBuffer and vice versa?
> Are there any use cases where you'd need it both ways?

I'd hate the idea of another flag in XHR. Why not just keep the raw bits and then convert when responseText is called? The only disadvantage of this is when the author makes multiple calls to responseText and I would not think that is a very common use case.

Received on Tuesday, 28 September 2010 14:33:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:11 UTC