-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update timingInfo to follow new spec changes #1143
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,20 +253,20 @@ function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) { | |
return performance.now() | ||
} | ||
|
||
function makeTimingInfo (init) { | ||
// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info | ||
function createOpaqueTimingInfo (timingInfo) { | ||
return { | ||
startTime: 0, | ||
startTime: timingInfo.startTime ?? 0, | ||
redirectStartTime: 0, | ||
redirectEndTime: 0, | ||
postRedirectStartTime: 0, | ||
postRedirectStartTime: timingInfo.startTime ?? 0, | ||
finalServiceWorkerStartTime: 0, | ||
finalNetworkResponseStartTime: 0, | ||
finalNetworkRequestStartTime: 0, | ||
endTime: 0, | ||
encodedBodySize: 0, | ||
decodedBodySize: 0, | ||
finalConnectionTimingInfo: null, | ||
...init | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed this because the spec states to "return a new fetch timing info whose start time and post-redirect start time are timingInfo’s start time.". Since only startTime and postRedirectStartTime can be changed it seems more explicit to show that their values are the only ones being updated. |
||
finalConnectionTimingInfo: null | ||
} | ||
} | ||
|
||
|
@@ -318,7 +318,7 @@ module.exports = { | |
TAOCheck, | ||
corsCheck, | ||
crossOriginResourcePolicyCheck, | ||
makeTimingInfo, | ||
createOpaqueTimingInfo, | ||
setRequestReferrerPolicyOnRedirect, | ||
isValidHTTPToken, | ||
requestBadPort, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this falls under the category of an opaque timing info but it follows the guidelines of having default values and having startTime = postRedirectStartTime