Re: [FileAPI] createObjectURL isReusable proposal

On Wed, Dec 14, 2011 at 3:56 PM, Glenn Maynard <glenn@zewt.org> wrote:

> Trying to use a one-time URL
>
>> twice is supposed to go wrong and I don't think it necessarily has to go
>> wrong
>> in exactly the same way in all browsers. You might have the same problem
>> based
>> on when you call revokeObjectURL in applications today.
>>
>
> Can you give a specific example?  If there are cases where the spec allows
> this to happen, it would help to see whether that's intentional or
> something that should be fixed in the spec.
>

One possible example: give the URL to XHR, call xhr.send(), then revoke the
URL when send() returns.  The XHR send() method [1] begins the fetch
algorithm asynchronously, so it may or may not succeed, depending on how
far the fetch algorithm has gone before the revoke happens.  (This might be
fixable, if the URL was synchronously resolved to a hard reference to the
underlying blob, before the algorithm goes async and returns.)

This doesn't happen--at least not nearly so easily--for HTMLImageElement
fetches, since it awaits a stable state before beginning the fetch (eg. it
won't begin until you return to the event loop).

[1] http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-send-method

-- 
Glenn Maynard

Received on Wednesday, 14 December 2011 21:31:21 UTC