Auto merge of #22714 - aditj:patch-3, r=jdm

Added fetch_start functionality

<!-- Please describe your changes on the following line: -->
Added the fetch_start functionality in http_loader.rs (http_fetch function)

---
<!-- 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 #21258 (GitHub issue number if applicable)

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22714)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-01-28 18:45:26 -05:00 committed by GitHub
commit fe07d2c575
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 20 deletions

View file

@ -78,7 +78,7 @@ impl PerformanceResourceTiming {
entry: PerformanceEntry::new_inherited(
DOMString::from(url.into_string()),
DOMString::from("resource"),
fetch_start,
0.,
0.,
),
initiator_type: initiator_type,
@ -118,7 +118,7 @@ impl PerformanceResourceTiming {
worker_start: 0.,
redirect_start: 0.,
redirect_end: 0.,
fetch_start: 0.,
fetch_start: resource_timing.fetch_start as f64,
domain_lookup_start: 0.,
domain_lookup_end: 0.,
connect_start: 0.,
@ -184,4 +184,9 @@ impl PerformanceResourceTimingMethods for PerformanceResourceTiming {
// TODO
Finite::wrap(self.response_start)
}
// https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-fetchstart
fn FetchStart(&self) -> DOMHighResTimeStamp {
Finite::wrap(self.fetch_start)
}
}

View file

@ -6,6 +6,7 @@
* https://w3c.github.io/resource-timing/
*/
// https://w3c.github.io/resource-timing/#sec-performanceresourcetiming
[Exposed=(Window,Worker)]
interface PerformanceResourceTiming : PerformanceEntry {
readonly attribute DOMString initiatorType;
@ -13,7 +14,7 @@ interface PerformanceResourceTiming : PerformanceEntry {
// readonly attribute DOMHighResTimeStamp workerStart;
// readonly attribute DOMHighResTimeStamp redirectStart;
// readonly attribute DOMHighResTimeStamp redirectEnd;
// readonly attribute DOMHighResTimeStamp fetchStart;
readonly attribute DOMHighResTimeStamp fetchStart;
// readonly attribute DOMHighResTimeStamp domainLookupStart;
// readonly attribute DOMHighResTimeStamp domainLookupEnd;
// readonly attribute DOMHighResTimeStamp connectStart;
@ -27,9 +28,3 @@ interface PerformanceResourceTiming : PerformanceEntry {
/// readonly attribute unsigned long long decodedBodySize;
// [Default] object toJSON();
};
// partial interface Performance {
// void clearResourceTimings();
// void setResourceTimingBufferSize(unsigned long maxSize);
// attribute EventHandler onresourcetimingbufferfull;
// };