Auto merge of #22808 - servo:jdm-patch-10, r=asajeffrey

Avoid locking network timing data unnecessarily.

<!-- 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/22808)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-03-06 18:57:35 -05:00 committed by GitHub
commit 008368fa67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -618,8 +618,7 @@ pub fn http_fetch(
request.redirect_count as u16,
));
let timing = &*context.timing.lock().unwrap();
response.resource_timing = timing.clone();
response.resource_timing = context.timing.lock().unwrap().clone();
// Step 6
response
@ -1207,8 +1206,8 @@ fn http_network_fetch(
}
}
let timing = &*context.timing.lock().unwrap();
let mut response = Response::new(url.clone(), timing.clone());
let timing = context.timing.lock().unwrap().clone();
let mut response = Response::new(url.clone(), timing);
response.status = Some((
res.status(),
res.status().canonical_reason().unwrap_or("").into(),