Skip to content

Commit

Permalink
Add "environment discarding steps" hook
Browse files Browse the repository at this point in the history
These are run when navigation or worker start fails, and will be used by
w3c/ServiceWorker#1315.
  • Loading branch information
mfalken authored and domenic committed Jun 6, 2018
1 parent b3c7c89 commit 9592eb5
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -82197,7 +82197,9 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<p>If any of the following are true, then <span data-x="navigate-ua-inline">display the inline
content with an appropriate error shown to the user</span>, with the newly created
<code>Document</code> object's <span>origin</span> set to a new <span
data-x="concept-origin-opaque">opaque origin</span>, and return.</p>
data-x="concept-origin-opaque">opaque origin</span>, run the <span data-x="environment
discarding steps">environment discarding steps</span> for <var>reservedEnvironment</var>, and
return.</p>

<ul>
<li><p><var>response</var> is a network error.</p></li>
Expand Down Expand Up @@ -86352,6 +86354,13 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
unset.</p></dd>
</dl>

<p>Specifications may define <dfn data-export="">environment discarding steps</dfn> for
environments. The steps take an <span>environment</span> as input.</p>

<p class="note">The <span data-x="environment discarding steps">environment discarding
steps</span> are run for only a select few environments: the ones that will
never become execution ready because, for example, they failed to load.</p>

<p>An <dfn data-export="">environment settings object</dfn> is an <span>environment</span> that
additionally specifies algorithms for:</p>

Expand Down Expand Up @@ -97241,11 +97250,17 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
fetch</span> steps with <var>response</var>.</p></li>
</ol>

<p>If the algorithm asynchronously completes with null, <span>queue a task</span> to <span
data-x="concept-event-fire">fire an event</span> named <code data-x="event-error">error</code>
at <var>worker</var>, and return. Otherwise, continue the rest of these steps after
the algorithm's asynchronous completion, with <var>script</var> being the asynchronous
completion value.</p>
<p>If the algorithm asynchronously completes with null, then:</p>
<ol>
<li><p><span>Queue a task</span> to <span data-x="concept-event-fire">fire an event</span> named
<code data-x="event-error">error</code> at <var>worker</var>.</p></li>
<li><p>Run the <span data-x="environment discarding steps">environment discarding steps</span>
for <var>inside settings</var>.</p></li>
<li><p>Return.</p></li>
</ol>

<p>Otherwise, continue the rest of these steps after the algorithm's asynchronous completion,
with <var>script</var> being the asynchronous completion value.</p>
</li>

<li><p>Associate <var>worker</var> with <var>worker global scope</var>.</p></li>
Expand Down

0 comments on commit 9592eb5

Please sign in to comment.