Skip to content
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

Add start_time to resource timing. #24508

Merged
merged 2 commits into from Oct 22, 2019
Merged

Conversation

pajamapants3000
Copy link
Contributor

@pajamapants3000 pajamapants3000 commented Oct 20, 2019

start_time property added to ResourceFetchTiming, which enables the setting of start_time in the PerformanceEntry member of PerformanceResourceTiming.

Following the specification at https://w3c.github.io/resource-timing/#dfn-starttime, start_time is set to the value of redirect_start if redirection occurs and the timing allow check passes. Otherwise it has the same value as fetch_start.


  • There are tests for these changes OR
  • These changes do not require tests because ___

@highfive
Copy link

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @jdm (or someone else) soon.

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/performanceresourcetiming.rs
  • @KiChjang: components/net/fetch/methods.rs, components/net/http_loader.rs, components/net_traits/lib.rs, components/script/dom/performanceresourcetiming.rs, components/net_traits/tests/lib.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 20, 2019
@pajamapants3000
Copy link
Contributor Author

I question whether the timing logic belongs inside set_attribute. I went with that approach for consistency with existing code, but it seems like the caller already needs to know what times to set and when. Feels like the logic is being split into two places. I could change it so set_attribute just sets the time to whatever the caller says (at least for start_time) and just have the caller be entirely responsible for setting the time correctly. It already mostly is.

@jdm
Copy link
Member

jdm commented Oct 21, 2019

Yeah, I'm on the fence about it. Let's merge it the way it's written and if it turns out to be difficult to reason about in the future we can rewrite it. Thanks!

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 328c45a has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 21, 2019
@jdm
Copy link
Member

jdm commented Oct 21, 2019

And thank you for writing those unit tests, too!

@bors-servo
Copy link
Contributor

⌛ Testing commit 328c45a with merge 0468d8e...

bors-servo pushed a commit that referenced this pull request Oct 21, 2019
Add start_time to resource timing.

<!-- Please describe your changes on the following line: -->
`start_time` property added to `ResourceFetchTiming`, which enables the setting of `start_time` in the `PerformanceEntry` member of `PerformanceResourceTiming`.

Following the specification at https://w3c.github.io/resource-timing/#dfn-starttime, `start_time` is set to the value of `redirect_start` if redirection occurs and the timing allow check passes. Otherwise it has the same value as `fetch_start`.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21254

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 21, 2019
@jdm
Copy link
Member

jdm commented Oct 21, 2019

@bors-servo retry
#23290

@bors-servo
Copy link
Contributor

⌛ Testing commit 328c45a with merge aef21b7...

bors-servo pushed a commit that referenced this pull request Oct 22, 2019
Add start_time to resource timing.

<!-- Please describe your changes on the following line: -->
`start_time` property added to `ResourceFetchTiming`, which enables the setting of `start_time` in the `PerformanceEntry` member of `PerformanceResourceTiming`.

Following the specification at https://w3c.github.io/resource-timing/#dfn-starttime, `start_time` is set to the value of `redirect_start` if redirection occurs and the timing allow check passes. Otherwise it has the same value as `fetch_start`.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21254

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Oct 22, 2019
@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 22, 2019
@jdm
Copy link
Member

jdm commented Oct 22, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Testing commit 328c45a with merge c498b1a...

bors-servo pushed a commit that referenced this pull request Oct 22, 2019
Add start_time to resource timing.

<!-- Please describe your changes on the following line: -->
`start_time` property added to `ResourceFetchTiming`, which enables the setting of `start_time` in the `PerformanceEntry` member of `PerformanceResourceTiming`.

Following the specification at https://w3c.github.io/resource-timing/#dfn-starttime, `start_time` is set to the value of `redirect_start` if redirection occurs and the timing allow check passes. Otherwise it has the same value as `fetch_start`.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21254

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Oct 22, 2019
@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 22, 2019
@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Oct 22, 2019
@jdm
Copy link
Member

jdm commented Oct 22, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Testing commit 328c45a with merge bf587f2...

bors-servo pushed a commit that referenced this pull request Oct 22, 2019
Add start_time to resource timing.

<!-- Please describe your changes on the following line: -->
`start_time` property added to `ResourceFetchTiming`, which enables the setting of `start_time` in the `PerformanceEntry` member of `PerformanceResourceTiming`.

Following the specification at https://w3c.github.io/resource-timing/#dfn-starttime, `start_time` is set to the value of `redirect_start` if redirection occurs and the timing allow check passes. Otherwise it has the same value as `fetch_start`.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21254

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Oct 22, 2019
@bors-servo
Copy link
Contributor

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing bf587f2 to master...

@bors-servo bors-servo merged commit 328c45a into servo:master Oct 22, 2019
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PerformanceResourceTiming: startTime
4 participants