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
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"}}.
3236
3236
1. If |source| is {{RouterSourceEnum/"network"}}:
3237
3237
1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
3238
-
1. Return null.
3238
+
1. Return |timingInfo|.
3239
3239
1. Else if |source| is {{RouterSourceEnum/"cache"}}, or |source|["{{RouterSourceDict/cacheName}}"][=map/exists=], then:
3240
3240
1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
3241
3241
1. Set |timingInfo|’s [=service worker timing info/worker cache lookup start=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|.
3242
3242
1. [=map/For each=] |cacheName| → |cache| of the |registration|'s [=service worker registration/storage key=]'s [=name to cache map=].
3243
3243
1. If |source|["{{RouterSourceDict/cacheName}}"][=map/exists=] and |source|["{{RouterSourceDict/cacheName}}"][=string/is=] not |cacheName|, [=continue=].
3244
3244
1. Let |requestResponses| be the result of running [=Query Cache=] with |request|, a new {{CacheQueryOptions}}, and |cache|.
3245
-
1. If |requestResponses| is an empty [=list=], return null.
3245
+
1. If |requestResponses| is an empty [=list=], return |timingInfo|.
3246
3246
1. Else:
3247
3247
1. Let |requestResponse| be the first element of |requestResponses|.
3248
3248
1. Let |response| be |requestResponse|'s response.
3249
3249
1. Let |globalObject| be |activeWorker|'s [=service worker/global object=].
3250
3250
1. If |globalObject| is null:
3251
3251
1. Set |globalObject| to the result of running [=Setup ServiceWorkerGlobalScope=] with |activeWorker|.
3252
-
1. If |globalObject| is null, return null.
3252
+
1. If |globalObject| is null, return |timingInfo|.
3253
3253
3254
3254
Note: This only creates a ServiceWorkerGlobalScope because CORS checks require that. It is not expected that implementations will actually create a ServiceWorkerGlobalScope here.
3255
3255
3256
-
1. If |response|'s [=response/type=] is "`opaque`", and [=cross-origin resource policy check=] with |globalObject|'s [=environment settings object/origin=], |globalObject|, "", and |response|'s [=filtered response/internal response=] returns <b>blocked</b>, then return null.
3256
+
1. If |response|'s [=response/type=] is "`opaque`", and [=cross-origin resource policy check=] with |globalObject|'s [=environment settings object/origin=], |globalObject|, "", and |response|'s [=filtered response/internal response=] returns <b>blocked</b>, then return |timingInfo|.
3257
3257
1. Set |timingInfo|'s [=service worker timing info/worker final router source=] be set to {{RouterSourceEnum/"cache"}}.
3258
+
1. Set |result|'s [=service worker timing info=] be set to |timingInfo|.
3258
3259
1. Return |response|.
3259
-
1. Return null.
3260
+
1. Return |timingInfo|.
3260
3261
1. Else if |source| is {{RouterSourceEnum/"race-network-and-fetch-handler"}}, and |request|'s [=request/method=] is \`<code>GET</code>\` then:
3261
3262
1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
3262
3263
1. Let |queue| be an empty [=queue=] of [=race result=].
1. Let |result| be the result of [=dequeue=] |queue|.
3283
3284
1. Set |timingInfo|'s [=service worker timing info/worker final router source=] be set to |result|'s [=race result/used route=].
3285
+
1. Set |result|'s [=service worker timing info=] be set to |timingInfo|.
3284
3286
1. Return |result|'s [=/race response=].
3285
3287
1. Assert: |source| is "{{RouterSourceEnum/fetch-event}}"
3286
3288
1. If |request| is a [=navigation request=], |registration|'s [=navigation preload enabled flag=] is set, |request|'s [=request/method=] is \`<code>GET</code>\`, |registration|'s [=active worker=]'s [=set of event types to handle=][=set/contains=]<code>fetch</code>, and |registration|'s [=active worker=]'s [=all fetch listeners are empty flag=] is not set then:
1. [=fetch controller/Abort=] |preloadFetchController| with |deserializedError|.
3307
3309
1. Else, resolve |preloadResponse| with undefined.
3308
3310
1. Let |fetchResult| be the result of [=Create Fetch Event and Dispatch=] with |request|, |registration|, |useHighResPerformanceTimers|, |timingInfo|, |workerRealm|, |reservedClient|, |preloadResponse|, and null.
3309
-
1. If |fetchResult| is not null and |timingInfo|'s [=service worker timing info/worker final router source=] is set to {{RouterSourceEnum/"network"}}:
3310
-
1. Set |timingInfo|'s [=service worker timing info/worker final router source=] to {{RouterSourceEnum/"fetch-event"}}.
3311
+
1. If |fetchResult| is not null and |fetchResult|'s [=response/service worker timing info=]'s [=service worker timing info/worker final router source=] is set to {{RouterSourceEnum/"network"}}:
3312
+
1. Set |fetchResult|'s [=response/service worker timing info=]'s [=service worker timing info/worker final router source=] to {{RouterSourceEnum/"fetch-event"}}.
0 commit comments