This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17758 - Consider using microtasks for autorevoke
Summary: Consider using microtasks for autorevoke
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: File API (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Arun
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on: 16790
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-12 09:51 UTC by Olli Pettay
Modified: 2012-10-16 15:20 UTC (History)
3 users (show)

See Also:


Attachments

Description Olli Pettay 2012-07-12 09:51:29 UTC
"Stable state" is somewhat vague, since scripts can't really know when
Blob URIs are auto-revoked.
Comment 1 Simon Pieters 2012-07-12 10:18:00 UTC
It seems to me revoking after stable state would mean basically nothing could use the URL even if you try to use it in the same script, since things that fetch URLs are usually async (like e.g. <img src>).
Comment 2 Masatoshi Kimura 2012-07-12 11:15:41 UTC
Please define the term "microtask" first.
Comment 3 Olli Pettay 2012-07-12 11:19:03 UTC
It is in HTML spec.
Comment 4 Glenn Maynard 2012-07-12 13:55:56 UTC
See https://www.w3.org/Bugs/Public/show_bug.cgi?id=16790#c4 for an example of why it should use stable states, not microtasks.

(In reply to comment #0)
> "Stable state" is somewhat vague, since scripts can't really know when
> Blob URIs are auto-revoked.

What's vague?  It means URLs will always be revoked immediately and deterministically when your script returns to the event loop, at step 5 in the event loop processing model.


(In reply to comment #1)
> It seems to me revoking after stable state would mean basically nothing could
> use the URL even if you try to use it in the same script, since things that
> fetch URLs are usually async (like e.g. <img src>).

Part of the autoRevoke mechanism would be making each place that uses URLs asynchronously like this convert (conceptually) from object URLs to underlying blob data synchronously.  This has been brought up before but I'll make another mention of this in #16953.

(In reply to comment #3)
> It is in HTML spec.

HTML doesn't define "microtask".  All it defines is "perform a microtask checkpoint"; it doesn't give any mechanism to let other specs insert behavior when that happens (there's nothing like "queue a microtask").  It could be added, but #16790 settled on stable states for this.
Comment 5 Arun 2012-07-12 16:08:23 UTC
(In reply to comment #0)
> "Stable state" is somewhat vague, since scripts can't really know when
> Blob URIs are auto-revoked.

Bug 16790 was filed with this very purpose: to see if the "microtask" was more than just a magic word, and really could be bound to a concept that we could use.  That bug's been closed because stable state could be what we need.

Also note that Bug 16953 Comment 8 points out an important clarification to the autoRevoke algorithm: we're awaiting a stable state, not providing one.  Does this make the stipulation less vague?
Comment 6 Arun 2012-10-16 15:20:18 UTC
See Bug 19554