Move ResourceFetchTiming into Arc

The purpose of this commit is to ensure that the Response object has
access to Timing updates as previously the Response object simply
stored a ResourceFetchTiming struct so updates on ResourceFetchTiming
that were not explicitly done on the Response would not be passed down.
The references to ServoArc are added because Response uses
servo_arc::Arc rather than std::sync::Arc as is used elsewhere. So,
we've switched those other places to servo_arc::Arc instead of switching
Response to std::sync::Arc.
This commit is contained in:
Javed Nissar 2019-09-17 18:01:40 -04:00
parent bb8166bb97
commit 7596c36959
5 changed files with 16 additions and 9 deletions

View file

@ -23,6 +23,7 @@ use net_traits::request::{Origin, ResponseTainting, Window};
use net_traits::response::{Response, ResponseBody, ResponseType};
use net_traits::ResourceAttribute;
use net_traits::{FetchTaskTarget, NetworkError, ReferrerPolicy, ResourceFetchTiming};
use servo_arc::Arc as ServoArc;
use servo_url::ServoUrl;
use std::borrow::Cow;
use std::fs::File;
@ -52,7 +53,7 @@ pub struct FetchContext {
pub devtools_chan: Option<Sender<DevtoolsControlMsg>>,
pub filemanager: FileManager,
pub cancellation_listener: Arc<Mutex<CancellationListener>>,
pub timing: Arc<Mutex<ResourceFetchTiming>>,
pub timing: ServoArc<Mutex<ResourceFetchTiming>>,
}
pub struct CancellationListener {