Skip to content

Commit

Permalink
Handing fetch termination
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Aug 4, 2017
1 parent 65cf285 commit 2358afd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2981,9 +2981,10 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
1. Invoke <a>Run Service Worker</a> algorithm with |activeWorker| as the argument.
1. <a>Queue a task</a> |task| to run the following substeps:
1. Let |e| be the result of <a>creating an event</a> with {{FetchEvent}}.
1. Let |requestObject| be a new {{Request}} object associated with |request| and a new associated {{Headers}} object whose [=guard=] is "`immutable`".
1. Initialize |e|’s {{Event/type}} attribute to {{fetch!!event}}.
1. Initialize |e|’s {{Event/cancelable}} attribute to true.
1. Initialize |e|’s {{FetchEvent/request}} attribute to a new {{Request}} object associated with |request| and a new associated {{Headers}} object whose [=guard=] is "`immutable`".
1. Initialize |e|’s {{FetchEvent/request}} attribute to |requestObject|
1. Initialize |e|’s {{FetchEvent/preloadResponse}} to |preloadResponse|.
1. Initialize |e|'s {{FetchEvent/clientId}} attribute to |client|'s [=environment/id=].
1. If |request| is a <a>non-subresource request</a> and |request|'s [=request/destination=] is not {{RequestDestination/"report"}}, initialize |e|'s {{FetchEvent/reservedClientId}} attribute to |reservedClient|'s [=environment/id=], and to the empty string otherwise.
Expand All @@ -2996,6 +2997,9 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
1. If |e|'s [=FetchEvent/respond-with error flag=] is set, set |handleFetchFailed| to true.
1. Else, set |response| to |e|'s [=FetchEvent/potential response=].
1. If |e|'s <a>canceled flag</a> is set, set |eventCanceled| to true.
1. Run the following steps [=in parallel=]:
1. Wait for the fetch to become [=fetch/terminated=].
1. [=Queue a task=] to [=AbortSignal/signal abort=] on |requestObject|'s [=Request/signal=].

If |task| is discarded or the script has been aborted by the <a lt="terminate service worker">termination</a> of |activeWorker|, set |handleFetchFailed| to true.

Expand Down

0 comments on commit 2358afd

Please sign in to comment.