Skip to content

Commit

Permalink
Add force bypass cache flag for Soft Update / Update algorithm; set i…
Browse files Browse the repository at this point in the history
…t for .update() method.
  • Loading branch information
jungkees committed Aug 13, 2015
1 parent 66ff7c7 commit 3d675eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/service_worker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ <h1><code>update()</code></h1>
<li>Let <var>newestWorker</var> be the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as its argument.</li>
<li>If <var>newestWorker</var> is null, return a <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a> rejected with an "<code><a href="http://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code>" exception.</li>
<li>Set <var>registration</var>'s <a href="#dfn-registration-script-url">registering script url</a> to <var>newestWorker</var>'s <a href="#dfn-script-url">script url</a>.</li>
<li>Let <var>p</var> be the result of running <a href="#update-algorithm">Update</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, passing the <a href="#dfn-service-worker-registration-interface-client">service worker client</a> <var>client</var> and <var>registration</var> as the arguments.</li>
<li>Let <var>p</var> be the result of running <a href="#update-algorithm">Update</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, passing the <a href="#dfn-service-worker-registration-interface-client">service worker client</a> <var>client</var> and <var>registration</var> as the arguments with <em>force bypass cache flag</em> set.</li>
<li>Return the result of <a href="http://www.w3.org/2001/tag/doc/promises-guide#transforming-by">transforming</a> <var>p</var> with:
<ol>
<li>A fulfillment handler that returns undefined.</li>
Expand Down Expand Up @@ -2453,6 +2453,7 @@ <h1>Update</h1>
<dt>Input</dt>
<dd><var>client</var>, a <a href="#dfn-service-worker-client">service worker client</a></dd>
<dd><var>registration</var>, a <a href="#dfn-service-worker-registration">service worker registration</a></dd>
<dd><em>force bypass cache flag</em>, an optional flag unset by default</dd>
<dt>Output</dt>
<dd><var>promise</var>, a <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">promise</a></dd>
</dl>
Expand Down Expand Up @@ -2493,7 +2494,7 @@ <h1>Update</h1>
<li>Set <var>newestWorker</var> to the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as the argument.</li>
<li>If <var>newestWorker</var> is not null and <var>registration</var>'s <a href="#dfn-last-update-time">last update time</a> is not null, then:
<ol>
<li>If the time difference in seconds calculated by the current time minus <var>registration</var>'s <a href="#dfn-last-update-time">last update time</a> is greater than <var>newestWorker</var>'s <a href="#dfn-max-age">max age</a>, set <var>r</var>'s <a href="https://fetch.spec.whatwg.org/#concept-request-cache-mode">cache mode</a> to "<code>reload</code>".</li>
<li>If the time difference in seconds calculated by the current time minus <var>registration</var>'s <a href="#dfn-last-update-time">last update time</a> is greater than <var>newestWorker</var>'s <a href="#dfn-max-age">max age</a>, or <em>force bypass cache flag</em> is set, set <var>r</var>'s <a href="https://fetch.spec.whatwg.org/#concept-request-cache-mode">cache mode</a> to "<code>reload</code>".</li>
</ol>
</li>
<li>Let <var>response</var> be the result of running <a href="https://fetch.spec.whatwg.org/#concept-fetch">fetch</a> using <var>r</var>.</li>
Expand Down Expand Up @@ -2601,6 +2602,7 @@ <h1>Soft Update</h1>
<dl>
<dt>Input</dt>
<dd><var>registration</var>, a <a href="#dfn-service-worker-registration">service worker registration</a></dd>
<dd><em>force bypass cache flag</em>, an optional flag unset by default</dd>
<dt>Output</dt>
<dd>None</dd>
</dl>
Expand All @@ -2611,7 +2613,7 @@ <h1>Soft Update</h1>
<li>Let <var>newestWorker</var> be the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as its argument.</li>
<li>If <var>newestWorker</var> is null, abort these steps.</li>
<li>Set <var>registration</var>'s <a href="#dfn-registration-script-url">registering script url</a> to <var>newestWorker</var>'s <a href="#dfn-script-url">script url</a>.</li>
<li>Invoke <a href="#update-algorithm">Update</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, with <var>client</var>, <var>registration</var> as its argument.</li>
<li>Invoke <a href="#update-algorithm">Update</a> algorithm, or its <a href="#dfn-processing-equivalence">equivalent</a>, passing <var>client</var> and <var>registration</var> as its argument with <em>force bypass cache flag</em> set only if its own <em>force bypass cache flag</em> is set.</li>
</ol>
</spec-algorithm>
</spec-section>
Expand Down

0 comments on commit 3d675eb

Please sign in to comment.