diff options
author | Josh Matthews <josh@joshmatthews.net> | 2016-05-04 18:42:57 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-05-18 08:02:42 -0500 |
commit | 9e8cf19e51d5ff1f7c8aa8d5c2f8ccc5d74531ca (patch) | |
tree | eb29fc64b6fe098187788017bc765b7feb15b2ef /components/script/dom/servohtmlparser.rs | |
parent | 36df00ae96feba73ab32847fda8bec3260c4aa11 (diff) | |
download | servo-9e8cf19e51d5ff1f7c8aa8d5c2f8ccc5d74531ca.tar.gz servo-9e8cf19e51d5ff1f7c8aa8d5c2f8ccc5d74531ca.zip |
Add timeline markers for HTTP requests, JS evaluation, and HTML parsing.
Diffstat (limited to 'components/script/dom/servohtmlparser.rs')
-rw-r--r-- | components/script/dom/servohtmlparser.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/components/script/dom/servohtmlparser.rs b/components/script/dom/servohtmlparser.rs index 8c12c34ffa1..92658189dc0 100644 --- a/components/script/dom/servohtmlparser.rs +++ b/components/script/dom/servohtmlparser.rs @@ -28,6 +28,8 @@ use msg::constellation_msg::{PipelineId, SubpageId}; use net_traits::{AsyncResponseListener, Metadata, NetworkError}; use network_listener::PreInvoke; use parse::{TrustedParser, ParserRef, Parser}; +use profile_traits::time::ProfilerCategory; +use profile_traits::time::{profile, TimerMetadata, TimerMetadataReflowType, TimerMetadataFrameType}; use script_thread::ScriptThread; use std::cell::Cell; use std::default::Default; @@ -315,6 +317,18 @@ impl ServoHTMLParser { impl ServoHTMLParser { pub fn parse_sync(&self) { + let metadata = TimerMetadata { + url: self.document.url().as_str().into(), + iframe: TimerMetadataFrameType::RootWindow, + incremental: TimerMetadataReflowType::FirstReflow, + }; + profile(ProfilerCategory::ScriptParseHTML, + Some(metadata), + self.document.window().time_profiler_chan().clone(), + || self.do_parse_sync()) + } + + fn do_parse_sync(&self) { // This parser will continue to parse while there is either pending input or // the parser remains unsuspended. loop { |