You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* |request| is a [=subresource request=] and |registration| is [=stale=].
3225
3229
1. If |activeWorker|'s [=service worker/list of router rules=][=list/is not empty=]:
3226
-
1. Let |source| be the result of running the [=Get Router Source=] algorithm with |registration|'s <a>active worker</a> and |request|.
3227
3230
1. Set |timingInfo|’s [=service worker timing info/worker router evaluation start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|.
3231
+
1. Let |source| be the result of running the [=Get Router Source=] algorithm with |registration|'s <a>active worker</a> and |request|.
3228
3232
1. If |source| is non-null, then:
3229
3233
1. Set |timingInfo|'s [=service worker timing info/worker matched router source=] be set to |source|, and [=service worker timing info/worker final router source=] be set to {{RouterSourceEnum/"network"}}.
3230
3234
1. If |source| is {{RouterSourceEnum/"network"}}:
3231
3235
1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
3232
3236
1. Return null.
3233
3237
1. Else if |source| is {{RouterSourceEnum/"cache"}}, or |source|["{{RouterSourceDict/cacheName}}"][=map/exists=], then:
3234
-
1. Set |timingInfo|’s [=service worker timing info/worker cache lookup start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|.
3235
3238
1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
3239
+
1. Set |timingInfo|’s [=service worker timing info/worker cache lookup start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|.
3236
3240
1. [=map/For each=] |cacheName| → |cache| of the |registration|'s [=service worker registration/storage key=]'s [=name to cache map=].
3237
3241
1. If |source|["{{RouterSourceDict/cacheName}}"][=map/exists=] and |source|["{{RouterSourceDict/cacheName}}"][=string/is=] not |cacheName|, [=continue=].
3238
3242
1. Let |requestResponses| be the result of running [=Query Cache=] with |request|, a new {{CacheQueryOptions}}, and |cache|.
1. Else if |source| is {{RouterSourceEnum/"race-network-and-fetch-handler"}}, and |request|'s [=request/method=] is \`<code>GET</code>\` then:
3255
3259
1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
3256
-
1. Let |queue| be an empty [=queue=] of tuple of a [=/response=] and a [=RouterSourceEnum/used route=].
3260
+
1. Let |queue| be an empty [=queue=] of tuple of [=race result=].
3257
3261
1. Let |raceFetchController| be null.
3258
3262
1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "<code>pending</code>".
3259
3263
1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>":
3260
3264
1. Set |raceFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |raceNetworkRequestResponse|:
3261
3265
1. If |raceNetworkRequestResponse|'s [=response/status=] is [=ok status=], then:
3262
3266
1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|.
3263
-
1. [=queue/Enqueue=] |raceNetworkRequestResponse| as [=/response=] and {{RouterSourceEnum/"network"}} as [=RouterSourceEnum/used route=] to |queue|.
3267
+
1. [=queue/Enqueue=] |raceNetworkRequestResponse| as [=/response=] and {{RouterSourceEnum/"network"}} as [=/used route=] to |queue|.
3264
3268
1. Otherwise, set |raceResponse|'s [=race response/value=] to a [=network error=].
3265
3269
1. [=If aborted=] and |raceFetchController| is not null, then:
1. Let |fetchHandlerResponse| be the result of [=Create Fetch Event and Dispatch=] with |request|, |registration|, |useHighResPerformanceTimers|, |timingInfo|, |workerRealm|, |reservedClient|, |preloadResponse|, and |raceResponse|.
3271
3275
1. If |fetchHandlerResponse| is not null and not a [=network error=], and |raceFetchController| is not null, [=fetch controller/abort=] |raceFetchController|.
3272
-
1. [=queue/Enqueue=] |fetchHandlerResponse| as [=/response=] and {{RouterSourceEnum/"fetch-event"}} as [=RouterSourceEnum/used route=] to |queue|.
3276
+
1. [=queue/Enqueue=] |fetchHandlerResponse| as [=/response=] and {{RouterSourceEnum/"fetch-event"}} as [=/used route=] to |queue|.
3273
3277
1. Wait until |queue| is not empty.
3274
3278
1. Let |result| be the result of [=dequeue=] |queue|.
3275
3279
1. Set |timingInfo|'s [=service worker timing info/worker final router source=] be set to [=result/used route=] in |result|.
0 commit comments