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

[FileAPI] BlobBuilder.getBlob should clear the BlobBuilder

From: Kyle Huey <me@kylehuey.com>
Date: Tue, 12 Apr 2011 15:38:10 -0700
Message-ID: <BANLkTi=VDEfkJrfbq-D0vaSxn19nA9VmyA@mail.gmail.com>
To: Web Applications Working Group WG <public-webapps@w3.org>
Hello All,

In the current FileAPI Writer spec a BlobBuilder can be used to build a
series of blobs like so:

  var bb = BlobBuilder();
  var foo = bb.getBlob();
  var bar = bb.getBlob();
  foo.size; // == 3
  bar.size; // == 6

My concern with this pattern is that it seems that one of the primary use
cases is to keep a BlobBuilder around for a while to build up a blob over
time.  A BlobBuilder left around could potentially entrain large amounts of
memory.  I propose that BlobBuilder.getBlob() "clears" the BlobBuilder,
returning it to an empty state.  The current behavior also doesn't seem
terribly useful to me (though I'm happy to be convinced otherwise) and be
easily replicated on top of the proposed behavior (immediately reappending
the Blob that was just retrieved.)


- Kyle
Received on Wednesday, 13 April 2011 00:25:32 UTC

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