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
Maintain timing for worker start/ready, for navigation requests. (#1575)
* Maintain timing for worker start/ready, for navigation requests.
The timing when worker is started or ready are web-accessible via
the navigation timing API (https://w3c.github.io/navigation-timing/).
`workerStart` is specified to be the time when the service worker is run.
In Chromium and Gecko, `worker ready time` (exposed as `fetchStart`)
is set to the right before the time when the Fetch event can be
dispatched for the newly created worker.
In preparation for w3c/navigation-timing#136
1. If the result of running the [=Should Skip Event=] algorithm with "fetch" and |activeWorker| is true, then:
3047
3049
1. If |shouldSoftUpdate| is true, then [=in parallel=] run the [=Soft Update=] algorithm with |registration|.
3048
3050
1. Return null.
3051
+
1. If |useHighResPerformanceTimers| is true, then set |useHighResPerformanceTimers| to |activeWorker|'s [=service worker/global object=]'s [=WorkerGlobalScope/cross-origin isolated capability=].
3052
+
1. Let |timingInfo|'s [=service worker timing info/start time=] be the [=coarsened shared current time=] given |useHighResPerformanceTimers|.
3049
3053
1. If |activeWorker|'s <a>state</a> is "`activating`", wait for |activeWorker|'s <a>state</a> to become "`activated`".
3050
3054
1. If the result of running the [=Run Service Worker=] algorithm with |activeWorker| is *failure*, then set |handleFetchFailed| to true.
1. If |request| is a <a>non-subresource request</a> and |request|'s [=request/destination=] is not {{RequestDestination/"report"}}, initialize |e|'s {{FetchEvent/resultingClientId}} attribute to |reservedClient|'s [=environment/id=], and to the empty string otherwise.
3063
3067
1. If |request| is a <a>navigation request</a>, initialize |e|'s {{FetchEvent/replacesClientId}} attribute to |request|'s [=request/replaces client id=], and to the empty string otherwise.
3064
3068
1. Initialize |e|’s {{FetchEvent/handled}} to |eventHandled|.
3069
+
1. Let |timingInfo|'s [=service worker timing info/fetch event dispatch time=] to the [=coarsened shared current time=] given |useHighResPerformanceTimers|.
3065
3070
1. <a>Dispatch</a> |e| at |activeWorker|'s [=service worker/global object=].
3066
3071
1. Invoke [=Update Service Worker Extended Events Set=] with |activeWorker| and |e|.
3067
3072
1. If |e|'s [=FetchEvent/respond-with entered flag=] is set, set |respondWithEntered| to true.
0 commit comments