aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-11-20 12:00:05 -0500
committerGitHub <noreply@github.com>2018-11-20 12:00:05 -0500
commit5da10694912fa43b673f74445f4f249eaf46b451 (patch)
treef1a7ef3496871d67907734dc10c2cc9df31f27cf /components/script/script_thread.rs
parent3fe83f1d06a50969b2fa731a050b35abdc5520d7 (diff)
parent26007fddd3f8aabfe026f06de64207d31edf5318 (diff)
downloadservo-5da10694912fa43b673f74445f4f249eaf46b451.tar.gz
servo-5da10694912fa43b673f74445f4f249eaf46b451.zip
Auto merge of #20459 - avadacatavra:time-origin, r=avadacatavra
Updating performance implementation and putting more measurements in <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] 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/20459) <!-- Reviewable:end -->
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(