mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add timeline markers for HTTP requests, JS evaluation, and HTML parsing.
This commit is contained in:
parent
36df00ae96
commit
9e8cf19e51
19 changed files with 126 additions and 30 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue