Re: File API "oneTimeOnly" is too poorly defined

On Wed, Mar 28, 2012 at 2:19 AM, Jonas Sicking <jonas@sicking.cc> wrote:

> All of this will definitely be a lot of work to specify (and possibly
> implement). But I don't see any other options to get interoperability
> with Blobs and blob-URLs. It's definitely not a problem restricted to
> oneTimeOnly.
>

Those are separate problems.  Other uses of blob URLs (without oneTimeOnly)
don't have an undefined "dereference" concept to begin with; they just
access the URL directly.  They do have other problems, though.  To take the
first example:

var blob = getBlob();
var url = URL.createObjectURL(blob);
img.src = url;
URL.revokeObjectURL(url);

When you assign img.src, you cause "update the image data" to be invoked.
 That algorithm goes asynchronous in step 5; it then accesses img.src
asynchronously.  This means there's a race condition, depending on whether
the revokeObjectURL call happens before or after the asynchronous fetch.

The same changes needed to fix oneTimeOnly would probably fix most of these
sorts of problems too, though.

-- 
Glenn Maynard

Received on Wednesday, 28 March 2012 23:33:03 UTC