mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
refactored performance timing to align with updated spec
refactoring with ResourceFetchMetadata implemented deprecated window.timing functionality created ResourceTimingListener trait fixed w3c links in navigation timing updated include.ini to run resource timing tests on ci
This commit is contained in:
parent
3fe83f1d06
commit
26007fddd3
103 changed files with 1881 additions and 322 deletions
|
@ -22,13 +22,14 @@ use embedder_traits::EmbedderProxy;
|
|||
use hyper_serde::Serde;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcReceiverSet, IpcSender};
|
||||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||
use net_traits::request::{Request, RequestInit};
|
||||
use net_traits::request::{Destination, Request, RequestInit};
|
||||
use net_traits::response::{Response, ResponseInit};
|
||||
use net_traits::storage_thread::StorageThreadMsg;
|
||||
use net_traits::WebSocketNetworkEvent;
|
||||
use net_traits::{CookieSource, CoreResourceThread};
|
||||
use net_traits::{CoreResourceMsg, CustomResponseMediator, FetchChannels};
|
||||
use net_traits::{CookieSource, CoreResourceMsg, CoreResourceThread};
|
||||
use net_traits::{CustomResponseMediator, FetchChannels};
|
||||
use net_traits::{FetchResponseMsg, ResourceThreads, WebSocketDomAction};
|
||||
use net_traits::{ResourceFetchTiming, ResourceTimingType};
|
||||
use profile_traits::mem::ProfilerChan as MemProfilerChan;
|
||||
use profile_traits::mem::{Report, ReportKind, ReportsChan};
|
||||
use profile_traits::time::ProfilerChan;
|
||||
|
@ -440,6 +441,11 @@ impl CoreResourceManager {
|
|||
let dc = self.devtools_chan.clone();
|
||||
let filemanager = self.filemanager.clone();
|
||||
|
||||
let timing_type = match req_init.destination {
|
||||
Destination::Document => ResourceTimingType::Navigation,
|
||||
_ => ResourceTimingType::Resource,
|
||||
};
|
||||
|
||||
thread::Builder::new()
|
||||
.name(format!("fetch thread for {}", req_init.url))
|
||||
.spawn(move || {
|
||||
|
@ -456,11 +462,12 @@ impl CoreResourceManager {
|
|||
cancellation_listener: Arc::new(Mutex::new(CancellationListener::new(
|
||||
cancel_chan,
|
||||
))),
|
||||
timing: Arc::new(Mutex::new(ResourceFetchTiming::new(request.timing_type()))),
|
||||
};
|
||||
|
||||
match res_init_ {
|
||||
Some(res_init) => {
|
||||
let response = Response::from_init(res_init);
|
||||
let response = Response::from_init(res_init, timing_type);
|
||||
http_redirect_fetch(
|
||||
&mut request,
|
||||
&mut CorsCache::new(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue