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

[Bug 28496] New: Allow Blob constructor to take ownership of ArrayBuffer(View) / invoke DetachArrayBuffer

From: <bugzilla@jessica.w3.org>
Date: Wed, 15 Apr 2015 22:43:52 +0000
To: public-webapps@w3.org
Message-ID: <bug-28496-2927@http.www.w3.org/Bugs/Public/>

            Bug ID: 28496
           Summary: Allow Blob constructor to take ownership of
                    ArrayBuffer(View) / invoke DetachArrayBuffer
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: File API
          Assignee: arun@mozilla.com
          Reporter: bugmail@asutherland.org
        QA Contact: public-webapps-bugzilla@w3.org
                CC: public-webapps@w3.org

Motivation: For the Firefox OS email app when we download attachments we end up
with a lot of TypedArray instaces piling up that exist only to be wrapped into
a Blob and then forgotten.  Lacking any way to neuter ArrayBuffers directly, it
would be nice if the Blob could takeownership of them as we pass them in.

Arguably it could be considered a common data-flow to create some data with a
TypedArray and then stuff it in a Blob to store it somewhere

- I guess the 2-step process of "new Blob(takingOwnership).close()" could end
up as a disturbingly hacky general purpose means of disposing of the contents
of TypedArrays.

Mitigation strategies:
- In our specific case we are using the proprietary-mozTCPSocket that just
throws typed arrays at us, but I understand the Streams API provides a
mechanism to allow reads into existing buffers.  APIs that allow use of
existing buffers won't suffer from the "oh no, so many ArrayBuffers!" problem.
- GC will catch the stuff eventually.  Just crank up the GC.

You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 15 April 2015 22:43:54 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC