mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue