W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

File API "oneTimeOnly" is too poorly defined

From: Glenn Maynard <glenn@zewt.org>
Date: Tue, 27 Mar 2012 18:59:00 -0500
Message-ID: <CABirCh_LiRgp0q+LP62=w5ZekUH9nA4Wta8s=h8i9btvxtWP+A@mail.gmail.com>
To: public-webapps WG <public-webapps@w3.org>
I didn't realize this was actually added to the spec:

> The optional options dictionary argument contains a key, oneTimeOnly that
defaults to false. If set to true, then the first time the Blob URI is
dereferenced, user agents MUST automatically revoke that Blob URI without
needing a call to revokeObjectURL() on the Blob URI.

What does "dereferenced" mean?  Where is it defined?  What happens if two
XHR calls open() a blob URL one after the other (causing fetches to be
queued for it in separate task queues, whose order of execution is
undefined)?  What happens if two completely unrelated APIs queue tasks in
different task queues (causing the same problem, but in a way that can't be
worked around within any one spec)?

This feature is dangerously weakly defined.  It should be removed from the
spec until it can be defined properly (or at least marked "not ready for
implementations"), or we may end up with interop failures that could be
hard to fix later.

Again, I'm pretty sure the sanest way to approach this feature is for any
API supporting it to grab a reference to the underlying resource, and
revoke the URL, as soon as the string enters that API (eg. xhr.open() is
called, or img.src is assigned).  That ensures it's always
deterministically--and synchronously--clear who will actually successfully
receive the object, regardless of later complications like separate task
queues across APIs.  It doesn't answer all questions (eg. the issues
mentioned at
http://lists.w3.org/Archives/Public/public-webapps/2012JanMar/1265.html),
and the actual "dereferencing" action would need to be specified for every
supported API (this would need work to make it easy to do), but it's a lot
closer than what's in there now.

-- 
Glenn Maynard
Received on Tuesday, 27 March 2012 23:59:30 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:50 GMT