aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorddh <dianehosfelt@gmail.com>2018-03-12 22:24:41 +0000
committerddh <dianehosfelt@gmail.com>2018-11-20 16:21:32 +0000
commit26007fddd3f8aabfe026f06de64207d31edf5318 (patch)
treef1a7ef3496871d67907734dc10c2cc9df31f27cf /components/script/script_thread.rs
parent3fe83f1d06a50969b2fa731a050b35abdc5520d7 (diff)
downloadservo-26007fddd3f8aabfe026f06de64207d31edf5318.tar.gz
servo-26007fddd3f8aabfe026f06de64207d31edf5318.zip
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
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 70c541b14c8..21c87d772e9 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -107,7 +107,10 @@ use net_traits::image_cache::{ImageCache, PendingImageResponse};
use net_traits::request::{CredentialsMode, Destination, RedirectMode, RequestInit};
use net_traits::storage_thread::StorageType;
use net_traits::{FetchMetadata, FetchResponseListener, FetchResponseMsg};
-use net_traits::{Metadata, NetworkError, ReferrerPolicy, ResourceThreads};
+use net_traits::{
+ Metadata, NetworkError, ReferrerPolicy, ResourceFetchTiming, ResourceThreads,
+ ResourceTimingType,
+};
use profile_traits::mem::{self as profile_mem, OpaqueSender, ReportsChan};
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
use script_layout_interface::message::{self, Msg, NewLayoutThreadInfo, ReflowGoal};
@@ -3097,9 +3100,12 @@ impl ScriptThread {
fetch_metadata: Result<FetchMetadata, NetworkError>,
) {
match fetch_metadata {
- Ok(_) => {},
- Err(ref e) => warn!("Network error: {:?}", e),
+ Ok(_) => (),
+ Err(ref e) => {
+ warn!("Network error: {:?}", e);
+ },
};
+
let mut incomplete_parser_contexts = self.incomplete_parser_contexts.borrow_mut();
let parser = incomplete_parser_contexts
.iter_mut()
@@ -3119,12 +3125,13 @@ impl ScriptThread {
}
}
- fn handle_fetch_eof(&self, id: PipelineId, eof: Result<(), NetworkError>) {
+ fn handle_fetch_eof(&self, id: PipelineId, eof: Result<ResourceFetchTiming, NetworkError>) {
let idx = self
.incomplete_parser_contexts
.borrow()
.iter()
.position(|&(pipeline_id, _)| pipeline_id == id);
+
if let Some(idx) = idx {
let (_, mut ctxt) = self.incomplete_parser_contexts.borrow_mut().remove(idx);
ctxt.process_response_eof(eof);
@@ -3161,7 +3168,7 @@ impl ScriptThread {
context.process_response(Ok(FetchMetadata::Unfiltered(meta)));
context.process_response_chunk(chunk);
- context.process_response_eof(Ok(()));
+ context.process_response_eof(Ok(ResourceFetchTiming::new(ResourceTimingType::None)));
}
fn handle_css_error_reporting(