Implement basic Time To First Paint and First Contentful Paint PWMs

This commit is contained in:
Fernando Jiménez Moreno 2017-05-26 19:13:39 +02:00
parent 20a3b0236d
commit 892b30edca
20 changed files with 213 additions and 10 deletions

View file

@ -26,6 +26,7 @@ ipc-channel = "0.8"
itertools = "0.5"
layout_traits = {path = "../layout_traits"}
log = "0.3.5"
metrics = {path = "../metrics"}
msg = {path = "../msg"}
net = {path = "../net"}
net_traits = {path = "../net_traits"}

View file

@ -26,6 +26,7 @@ extern crate itertools;
extern crate layout_traits;
#[macro_use]
extern crate log;
extern crate metrics;
extern crate msg;
extern crate net;
extern crate net_traits;

View file

@ -14,6 +14,7 @@ use ipc_channel::Error;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layout_traits::LayoutThreadFactory;
use metrics::PaintTimeMetrics;
use msg::constellation_msg::{BrowsingContextId, TopLevelBrowsingContextId, FrameType, PipelineId, PipelineNamespaceId};
use net::image_cache::ImageCacheImpl;
use net_traits::{IpcSend, ResourceThreads};
@ -471,6 +472,7 @@ impl UnprivilegedPipelineContent {
STF: ScriptThreadFactory<Message=Message>
{
let image_cache = Arc::new(ImageCacheImpl::new(self.webrender_api_sender.create_api()));
let paint_time_metrics = PaintTimeMetrics::new(self.time_profiler_chan.clone());
let layout_pair = STF::create(InitialScriptState {
id: self.id,
browsing_context_id: self.browsing_context_id,
@ -490,7 +492,7 @@ impl UnprivilegedPipelineContent {
window_size: self.window_size,
pipeline_namespace_id: self.pipeline_namespace_id,
content_process_shutdown_chan: self.script_content_process_shutdown_chan,
webvr_thread: self.webvr_thread
webvr_thread: self.webvr_thread,
}, self.load_data.clone());
LTF::create(self.id,
@ -508,7 +510,8 @@ impl UnprivilegedPipelineContent {
Some(self.layout_content_process_shutdown_chan),
self.webrender_api_sender,
self.prefs.get("layout.threads").expect("exists").value()
.as_u64().expect("count") as usize);
.as_u64().expect("count") as usize,
paint_time_metrics);
if wait_for_completion {
let _ = self.script_content_process_shutdown_port.recv();