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

@ -447,6 +447,7 @@ pub struct ResourceFetchTiming {
pub redirect_count: u16,
pub request_start: u64,
pub response_start: u64,
pub fetch_start: u64,
// pub response_end: u64,
// pub redirect_start: u64,
// pub redirect_end: u64,
@ -458,6 +459,7 @@ pub enum ResourceAttribute {
RedirectCount(u16),
RequestStart,
ResponseStart,
FetchStart,
}
#[derive(Clone, Copy, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
@ -475,6 +477,7 @@ impl ResourceFetchTiming {
redirect_count: 0,
request_start: 0,
response_start: 0,
fetch_start: 0,
}
}
@ -485,6 +488,7 @@ impl ResourceFetchTiming {
ResourceAttribute::RedirectCount(count) => self.redirect_count = count,
ResourceAttribute::RequestStart => self.request_start = precise_time_ns(),
ResourceAttribute::ResponseStart => self.response_start = precise_time_ns(),
ResourceAttribute::FetchStart => self.fetch_start = precise_time_ns(),
}
}
}