serviece worker: Fix PerformanceNavigationTiming#fetchStart
This is a follow-up CL of crrev.com/c/1212423 and fixes timing ordering of PerformanceNavigationTiming attributes. Background: `fetchStart` of PerformanceNavigationTiming comes from |fetch_start| of NavigationTiming, which is set by NavigationRequest. Since NavigationRequest isn't aware of service worker interception `fetchStart` could come earlier than `workerStart` when the navigation is routed to a service worker. However, `fetchStart` is supposed to come after `workerStart`. We can address this mis-ordering by using worker ready time. When worker ready time is greater than |fetch_start| of NavigationTiming, use worker ready time as |fetch_start|. Justifications: - `fetchStart` is should be recorded after redirects end. - `fetchStart` is should be recorded after `workerStart` if a service worker intercepted the navigation. - There seems no particular ordering between `redirectEnd` and `workerStart`. - NavigationRequest already updates |fetch_start| for redirects. Bug: 782958 Change-Id: I90bdeaee73d361c9d35024f13fd0d3f91ba42b02 Reviewed-on: https://chromium-review.googlesource.com/1215426Reviewed-by:Makoto Shimazu <shimazu@chromium.org> Reviewed-by:
Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/master@{#589851}
Showing
Please register or sign in to comment