hixie: Get rid of a potential race condition in the cache update process. (whatwg r4172)

hixie: Get rid of a potential race condition in the cache update
process. (whatwg r4172)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3318&r2=1.3319&f=h
http://html5.org/tools/web-apps-tracker?from=4171&to=4172

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3318
retrieving revision 1.3319
diff -u -d -r1.3318 -r1.3319
--- Overview.html 18 Oct 2009 22:59:09 -0000 1.3318
+++ Overview.html 18 Oct 2009 23:40:06 -0000 1.3319
@@ -45431,26 +45431,31 @@
      than the processing of <code>Document</code> objects already
      associated with an <a href="#application-cache">application cache</a> in the <var title="">cache group</var>.</li>
 
+     <li><p>Let <var title="">task list</var> be an empty list of
+     <a href="#concept-task" title="concept-task">tasks</a>.</p>
+
      <li><p>For each <a href="#cache-host">cache host</a> associated with an
      <a href="#application-cache">application cache</a> in <var title="">cache
-     group</var>, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
-     event</a> named <code title="event-appcache-obsolete"><a href="#event-appcache-obsolete">obsolete</a></code> that is
+     group</var>, create a <a href="#concept-task" title="concept-task">task</a> to
+     <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-appcache-obsolete"><a href="#event-appcache-obsolete">obsolete</a></code> that is
      cancelable at the <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the
-     <a href="#cache-host">cache host</a>. The default action of these events must
-     be, if the user agent <a href="#shows-caching-progress">shows caching progress</a>, the
-     display of some sort of user interface indicating to the user
-     that the application is no longer available for offline
-     use.</li>
+     <a href="#cache-host">cache host</a>, and add it to <var title="">task
+     list</var>. The default action of these events must be, if the
+     user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of
+     some sort of user interface indicating to the user that the
+     application is no longer available for offline use.</li>
 
      <li><p>For each entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
-     entries</a>, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
-     event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> (not <code title="event-appcache-obsolete"><a href="#event-appcache-obsolete">obsolete</a></code>!) at the
+     entries</a>, create a <a href="#concept-task" title="concept-task">task</a>
+     to <a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named
+     <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> (not <code title="event-appcache-obsolete"><a href="#event-appcache-obsolete">obsolete</a></code>!) at the
      <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
      host</a> the <code>Document</code> for this entry, if there
-     still is one. The default action of this event must be, if the
-     user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of
-     some sort of user interface indicating to the user that the user
-     agent failed to save the application for offline use.</li>
+     still is one, and add it to <var title="">task list</var>. The
+     default action of this event must be, if the user agent
+     <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
+     user interface indicating to the user that the user agent failed
+     to save the application for offline use.</li>
 
      <li><p>If <var title="">cache group</var> has an
      <a href="#application-cache">application cache</a> whose <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> is
@@ -45462,6 +45467,9 @@
 
      <li><p>Let the <a href="#concept-appcache-status" title="concept-appcache-status">status</a> of <var title="">cache group</var> be <i>idle</i>.</li>
 
+     <li><p>For each <a href="#concept-task" title="concept-task">task</a> in <var title="">task list</var>, <a href="#queue-a-task" title="queue a task">queue</a>
+     that task.</li>
+
      <li><p>Abort the <a href="#application-cache-download-process">application cache download
      process</a>.</li>
 
@@ -45492,6 +45500,9 @@
     <ol><li><p>Let <var title="">cache</var> be the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a> <a href="#application-cache">application
      cache</a> in <var title="">cache group</var>.</li>
 
+     <li><p>Let <var title="">task list</var> be an empty list of
+     <a href="#concept-task" title="concept-task">tasks</a>.</p>
+
      <li>
 
       <p>For each entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
@@ -45499,14 +45510,15 @@
       either completely downloaded or failed.</p>
 
       <p>If the download failed (e.g. the connection times out, or the
-      user cancels the download), then <a href="#queue-a-task">queue a task</a> to
-      <a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
+      user cancels the download), then create a <a href="#concept-task" title="concept-task">task</a> to <a href="#fire-a-simple-event">fire a simple
+      event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
       <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
       host</a> the <code>Document</code> for this entry, if there
-      still is one. The default action of this event must be, if the
-      user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of
-      some sort of user interface indicating to the user that the user
-      agent failed to save the application for offline use.</p>
+      still is one, and add it to <var title="">task list</var>. The
+      default action of this event must be, if the user agent
+      <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
+      user interface indicating to the user that the user agent failed
+      to save the application for offline use.</p>
 
       <p>Otherwise, associate the <code>Document</code> for this entry
       with <var title="">cache</var>; store the resource for this
@@ -45524,13 +45536,14 @@
 
      <li><p>For each <a href="#cache-host">cache host</a> associated with an
      <a href="#application-cache">application cache</a> in <var title="">cache
-     group</var>, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
-     event</a> that is cancelable named <code title="event-appcache-noupdate"><a href="#event-appcache-noupdate">noupdate</a></code> at the
+     group</var>, create a <a href="#concept-task" title="concept-task">task</a> to
+     <a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named <code title="event-appcache-noupdate"><a href="#event-appcache-noupdate">noupdate</a></code> at the
      <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
-     host</a>. The default action of these events must be, if the
-     user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of
-     some sort of user interface indicating to the user that the
-     application is up to date.</li>
+     host</a>, and add it to <var title="">task list</var>. The
+     default action of these events must be, if the user agent
+     <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
+     user interface indicating to the user that the application is up
+     to date.</li>
 
      <li><p>Empty <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
      entries</a>.</li>
@@ -45540,6 +45553,9 @@
 
      <li><p>Let the <a href="#concept-appcache-status" title="concept-appcache-status">status</a> of <var title="">cache group</var> be <i>idle</i>.</li>
 
+     <li><p>For each <a href="#concept-task" title="concept-task">task</a> in <var title="">task list</var>, <a href="#queue-a-task" title="queue a task">queue</a>
+     that task.</li>
+
      <li><p>Abort the <a href="#application-cache-download-process">application cache download
      process</a>.</li>
 
@@ -45837,31 +45853,32 @@
    <li><p>Set the <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> of
    <var title="">new cache</var> to <i>complete</i>.</li>
 
+   <li><p>Let <var title="">task list</var> be an empty list of <a href="#concept-task" title="concept-task">tasks</a>.</p>
+
    <li>
 
     <p>If this is a <a href="#concept-appcache-cache" title="concept-appcache-cache">cache
     attempt</a>, then for each <a href="#cache-host">cache host</a> associated
     with an <a href="#application-cache">application cache</a> in <var title="">cache
-    group</var>, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
-    event</a> that is cancelable named <code title="event-appcache-cached"><a href="#event-appcache-cached">cached</a></code> at the
+    group</var>, create a <a href="#concept-task" title="concept-task">task</a> to
+    <a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named <code title="event-appcache-cached"><a href="#event-appcache-cached">cached</a></code> at the
     <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
-    host</a>. The default action of these events must be, if the
-    user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of
-    some sort of user interface indicating to the user that the
-    application has been cached and that they can now use it
-    offline.</p>
+    host</a>, and add it to <var title="">task list</var>. The
+    default action of these events must be, if the user agent
+    <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
+    user interface indicating to the user that the application has
+    been cached and that they can now use it offline.</p>
 
     <p>Otherwise, it is an <a href="#concept-appcache-upgrade" title="concept-appcache-upgrade">upgrade attempt</a>. For each
     <a href="#cache-host">cache host</a> associated with an <a href="#application-cache">application
-    cache</a> in <var title="">cache group</var>, <a href="#queue-a-task">queue a
-    task</a> to <a href="#fire-a-simple-event">fire a simple event</a> that is cancelable
-    named <code title="event-appcache-updateready"><a href="#event-appcache-updateready">updateready</a></code>
-    at the <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
-    host</a>. The default action of these events must be, if the
-    user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of
-    some sort of user interface indicating to the user that a new
-    version is available and that they can activate it by reloading
-    the page.</p>
+    cache</a> in <var title="">cache group</var>, create a <a href="#concept-task" title="concept-task">task</a> to <a href="#fire-a-simple-event">fire a simple
+    event</a> that is cancelable named <code title="event-appcache-updateready"><a href="#event-appcache-updateready">updateready</a></code> at the
+    <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
+    host</a>, and add it to <var title="">task list</var>. The
+    default action of these events must be, if the user agent
+    <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
+    user interface indicating to the user that a new version is
+    available and that they can activate it by reloading the page.</p>
 
    </li>
 
@@ -45872,9 +45889,14 @@
    status</a> of <var title="">cache group</var> to
    <i>idle</i>.</li>
 
+   <li><p>For each <a href="#concept-task" title="concept-task">task</a> in <var title="">task list</var>, <a href="#queue-a-task" title="queue a task">queue</a>
+   that task.</li>
+
   </ol><p>The <dfn id="cache-failure-steps">cache failure steps</dfn> are as follows:</p>
 
-  <ol><li>
+  <ol><li><p>Let <var title="">task list</var> be an empty list of <a href="#concept-task" title="concept-task">tasks</a>.</p>
+
+   <li>
 
     <p>For each entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
     entries</a>, run the following further substeps. These steps
@@ -45886,26 +45908,28 @@
      <li><p>Unassociate the <code>Document</code> for this entry from
      its <a href="#application-cache">application cache</a>, if it has one.</li>
 
-     <li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
-     event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
+     <li><p>Create a <a href="#concept-task" title="concept-task">task</a> to
+     <a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
      <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the
-     <code>Document</code> for this entry, if there still is one. The
-     default action of these events must be, if the user agent
-     <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
-     user interface indicating to the user that the user agent failed
-     to save the application for offline use.</p>
+     <code>Document</code> for this entry, if there still is one, and
+     add it to <var title="">task list</var>. The default action of
+     these events must be, if the user agent <a href="#shows-caching-progress">shows caching
+     progress</a>, the display of some sort of user interface
+     indicating to the user that the user agent failed to save the
+     application for offline use.</p>
 
     </ol></li>
 
    <li><p>For each <a href="#cache-host">cache host</a> still associated with an
    <a href="#application-cache">application cache</a> in <var title="">cache group</var>,
-   <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> that
-   is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
+   create a <a href="#concept-task" title="concept-task">task</a> to <a href="#fire-a-simple-event">fire a
+   simple event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
    <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
-   host</a>. The default action of these events must be, if the
-   user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of some
-   sort of user interface indicating to the user that the user agent
-   failed to save the application for offline use.</li>
+   host</a>, and add it to <var title="">task list</var>. The
+   default action of these events must be, if the user agent
+   <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
+   user interface indicating to the user that the user agent failed to
+   save the application for offline use.</li>
 
    <li><p>Empty <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
    entries</a>.</li>
@@ -45925,6 +45949,9 @@
    attempt</a>, discard <var title="">cache group</var>
    altogether.</p>
 
+   <li><p>For each <a href="#concept-task" title="concept-task">task</a> in <var title="">task list</var>, <a href="#queue-a-task" title="queue a task">queue</a>
+   that task.</li>
+
    <li><p>Abort the <a href="#application-cache-download-process">application cache download
    process</a>.</li>
 
@@ -45941,6 +45968,7 @@
 
   <p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <a href="#networking-task-source">networking task
   source</a>.</p>
+

Received on Sunday, 18 October 2009 23:41:03 UTC