[html5] r2553 - [gw] (2) Make sure to propagate add() and remove() changes when updating the cache.

whatwg at whatwg.org whatwg at whatwg.org
Tue Dec 23 18:11:44 PST 2008


Author: ianh
Date: 2008-12-23 18:11:44 -0800 (Tue, 23 Dec 2008)
New Revision: 2553

Modified:
   index
   source
Log:
[gw] (2) Make sure to propagate add() and remove() changes when updating the cache.

Modified: index
===================================================================
--- index	2008-12-24 00:27:11 UTC (rev 2552)
+++ index	2008-12-24 02:11:44 UTC (rev 2553)
@@ -36472,21 +36472,48 @@
 
    <li>
 
-    <p>Otherwise, this is an <a href=#concept-appcache-upgrade title=concept-appcache-upgrade>upgrade attempt</a>:</p>
+    <p>Otherwise, this is an <a href=#concept-appcache-upgrade title=concept-appcache-upgrade>upgrade attempt</a>. Perform
+    the following substeps atomically, so as to avoid race
+    conditions:</p>
 
-    <p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-updateready>updateready</code> at the
-    <code><a href=#applicationcache>ApplicationCache</a></code> singleton of each <a href=#browsing-context>browsing
-    context</a> whose <a href=#active-document>active document</a> is associated
-    with a cache in <var title="">cache group</var>. The default
-    action of this event should be 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>
+    <ol><li>
 
-    <p>Set the <a href=#concept-appcache-status title=concept-appcache-status>status</a> of
-    <var title="">cache group</var> to <i>idle</i>.</p>
+      <p>If any <a href=#concept-appcache-dynamic title=concept-appcache-dynamic>dynamic
+      entries</a> in any of the <a href=#application-cache title="application
+      cache">application caches</a> in the <var title="">cache
+      group</var> were added or removed (using the <code title=dom-appcache-add><a href=#dom-appcache-add>add()</a></code> and <code title=dom-appcache-remove><a href=#dom-appcache-remove>remove()</a></code> methods) while the
+      update process was in progress, then replay the sequence of adds
+      and removes on <var title="">cache</var>, using the resources
+      that were fetched by the <code title=dom-appcache-add><a href=#dom-appcache-add>add()</a></code> method if applicable.</p>
 
-   </li>
+     </li>
 
+     <li>
+
+      <p>For each <a href=#browsing-context>browsing context</a> whose <a href=#active-document>active
+      document</a> is associated with a cache 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> called <code title=event-updateready>updateready</code> at the relevant
+      <code><a href=#applicationcache>ApplicationCache</a></code> singleton. The default action of
+      these events should be 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>
+
+      <p class=note>Since this step merely queues tasks, and since
+      all these substeps are being done atomically, the next step is
+      guaranteed to happen before the events are actually
+      dispatched.</p>
+
+     </li>
+
+     <li>
+
+      <p>Set the <a href=#concept-appcache-status title=concept-appcache-status>status</a>
+      of <var title="">cache group</var> to <i>idle</i>.</p>
+
+     </li>
+
+    </ol></li>
+
   </ol><p>The <dfn id=cache-removal-steps>cache removal steps</dfn> are as follows:</p>
 
   <ol><li><p>If this is a <a href=#concept-appcache-cache title=concept-appcache-cache>cache

Modified: source
===================================================================
--- source	2008-12-24 00:27:11 UTC (rev 2552)
+++ source	2008-12-24 02:11:44 UTC (rev 2553)
@@ -41496,20 +41496,55 @@
    <li>
 
     <p>Otherwise, this is an <span
-    title="concept-appcache-upgrade">upgrade attempt</span>:</p>
+    title="concept-appcache-upgrade">upgrade attempt</span>. Perform
+    the following substeps atomically, so as to avoid race
+    conditions:</p>
 
-    <p><span>Fire a simple event</span> called <code
-    title="event-updateready">updateready</code> at the
-    <code>ApplicationCache</code> singleton of each <span>browsing
-    context</span> whose <span>active document</span> is associated
-    with a cache in <var title="">cache group</var>. The default
-    action of this event should be 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>
+    <ol>
 
-    <p>Set the <span title="concept-appcache-status">status</span> of
-    <var title="">cache group</var> to <i>idle</i>.</p>
+     <li>
 
+      <p>If any <span title="concept-appcache-dynamic">dynamic
+      entries</span> in any of the <span title="application
+      cache">application caches</span> in the <var title="">cache
+      group</var> were added or removed (using the <code
+      title="dom-appcache-add">add()</code> and <code
+      title="dom-appcache-remove">remove()</code> methods) while the
+      update process was in progress, then replay the sequence of adds
+      and removes on <var title="">cache</var>, using the resources
+      that were fetched by the <code
+      title="dom-appcache-add">add()</code> method if applicable.</p>
+
+     </li>
+
+     <li>
+
+      <p>For each <span>browsing context</span> whose <span>active
+      document</span> is associated with a cache in <var
+      title="">cache group</var>, <span>queue a task</span> to
+      <span>fire a simple event</span> called <code
+      title="event-updateready">updateready</code> at the relevant
+      <code>ApplicationCache</code> singleton. The default action of
+      these events should be 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>
+
+      <p class="note">Since this step merely queues tasks, and since
+      all these substeps are being done atomically, the next step is
+      guaranteed to happen before the events are actually
+      dispatched.</p>
+
+     </li>
+
+     <li>
+
+      <p>Set the <span title="concept-appcache-status">status</span>
+      of <var title="">cache group</var> to <i>idle</i>.</p>
+
+     </li>
+
+    </ol>
+
    </li>
 
   </ol>




More information about the Commit-Watchers mailing list