W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: [FileAPI] createObjectURL isReusable proposal

From: Glenn Maynard <glenn@zewt.org>
Date: Wed, 14 Dec 2011 16:30:51 -0500
Message-ID: <CABirCh-1GxSreNnZau1vhLFbnfL-zpgsZ6-9e-18JoEViRLwNg@mail.gmail.com>
To: Adrian Bateman <adrianba@microsoft.com>
Cc: Anne van Kesteren <annevk@opera.com>, "Web Applications Working Group WG (public-webapps@w3.org)" <public-webapps@w3.org>, Feras Moussa <ferasm@microsoft.com>
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

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