mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement basic Time To First Paint and First Contentful Paint PWMs
This commit is contained in:
parent
20a3b0236d
commit
892b30edca
20 changed files with 213 additions and 10 deletions
|
@ -56,6 +56,7 @@ jstraceable_derive = {path = "../jstraceable_derive"}
|
|||
lazy_static = "0.2"
|
||||
libc = "0.2"
|
||||
log = "0.3.5"
|
||||
metrics = {path = "../metrics"}
|
||||
mime = "0.2.1"
|
||||
mime_guess = "1.8.0"
|
||||
msg = {path = "../msg"}
|
||||
|
|
|
@ -64,6 +64,7 @@ extern crate lazy_static;
|
|||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate metrics;
|
||||
#[macro_use]
|
||||
extern crate mime;
|
||||
extern crate mime_guess;
|
||||
|
|
|
@ -71,6 +71,7 @@ use js::jsapi::{JSTracer, SetWindowProxyClass};
|
|||
use js::jsval::UndefinedValue;
|
||||
use js::rust::Runtime;
|
||||
use mem::heap_size_of_self_and_children;
|
||||
use metrics::PaintTimeMetrics;
|
||||
use microtask::{MicrotaskQueue, Microtask};
|
||||
use msg::constellation_msg::{BrowsingContextId, FrameType, PipelineId, PipelineNamespace, TopLevelBrowsingContextId};
|
||||
use net_traits::{FetchMetadata, FetchResponseListener, FetchResponseMsg};
|
||||
|
@ -176,6 +177,8 @@ impl InProgressLoad {
|
|||
url: ServoUrl,
|
||||
origin: MutableOrigin) -> InProgressLoad {
|
||||
let current_time = get_time();
|
||||
let navigation_start_precise = precise_time_ns() as f64;
|
||||
layout_chan.send(message::Msg::SetNavigationStart(navigation_start_precise)).unwrap();
|
||||
InProgressLoad {
|
||||
pipeline_id: id,
|
||||
browsing_context_id: browsing_context_id,
|
||||
|
@ -188,7 +191,7 @@ impl InProgressLoad {
|
|||
url: url,
|
||||
origin: origin,
|
||||
navigation_start: (current_time.sec * 1000 + current_time.nsec as i64 / 1000000) as u64,
|
||||
navigation_start_precise: precise_time_ns() as f64,
|
||||
navigation_start_precise: navigation_start_precise,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1453,6 +1456,7 @@ impl ScriptThread {
|
|||
image_cache: self.image_cache.clone(),
|
||||
content_process_shutdown_chan: content_process_shutdown_chan,
|
||||
layout_threads: layout_threads,
|
||||
paint_time_metrics: PaintTimeMetrics::new(self.time_profiler_chan.clone()),
|
||||
});
|
||||
|
||||
// Pick a layout thread, any layout thread
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue