mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
commit
fe07d2c575
6 changed files with 27 additions and 20 deletions
|
@ -525,8 +525,6 @@ pub fn http_fetch(
|
|||
request.service_workers_mode = ServiceWorkersMode::None;
|
||||
}
|
||||
|
||||
// Substep 3
|
||||
// TODO(#21258) maybe set fetch_start (if this is the last resource)
|
||||
// Generally, we use a persistent connection, so we will also set other PerformanceResourceTiming
|
||||
// attributes to this as well (domain_lookup_start, domain_lookup_end, connect_start, connect_end,
|
||||
// secure_connection_start)
|
||||
|
@ -660,6 +658,13 @@ pub fn http_redirect_fetch(
|
|||
Some(Ok(url)) => url,
|
||||
};
|
||||
|
||||
// Step 1 of https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-fetchstart
|
||||
context
|
||||
.timing
|
||||
.lock()
|
||||
.unwrap()
|
||||
.set_attribute(ResourceAttribute::FetchStart);
|
||||
|
||||
// Step 5
|
||||
if request.redirect_count >= 20 {
|
||||
return Response::network_error(NetworkError::Internal("Too many redirects".into()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue