mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
metrics: Simplify ProgressiveWebMetrics
(#35985)
Simply how `ProgressiveWebMetrics` works: 1. Keep only a single struct instead of one in layout and one script that both implement the `ProgressiveWebMetrics` trait. Since layout and script are the same thread these can now just be a single `ProgressiveWebMetrics` struct stored in script. 2. Have the compositor be responsible for informing the Constellation (which informs the ScripThread) about paint metrics. This makes communication flow one way and removes one dependency between the compositor and script (of two). 3. All units tests are moved into the `metrics` crate itself since there is only one struct there now. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
1f232eb17c
commit
5424479768
26 changed files with 416 additions and 787 deletions
|
@ -34,9 +34,8 @@ use net_traits::image_cache::ImageCache;
|
|||
use profile_traits::{mem as profile_mem, time};
|
||||
use script_layout_interface::{LayoutFactory, ScriptThreadFactory};
|
||||
use script_traits::{
|
||||
AnimationState, DiscardBrowsingContext, DocumentActivity, InitialScriptState, LayoutMsg,
|
||||
LoadData, NewLayoutInfo, SWManagerMsg, ScriptThreadMessage, ScriptToConstellationChan,
|
||||
WindowSizeData,
|
||||
AnimationState, DiscardBrowsingContext, DocumentActivity, InitialScriptState, LoadData,
|
||||
NewLayoutInfo, SWManagerMsg, ScriptThreadMessage, ScriptToConstellationChan, WindowSizeData,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::opts::{self, Opts};
|
||||
|
@ -133,9 +132,6 @@ pub struct InitialPipelineState {
|
|||
/// A channel for the background hang monitor to send messages to the constellation.
|
||||
pub background_hang_monitor_to_constellation_chan: IpcSender<HangMonitorAlert>,
|
||||
|
||||
/// A channel for the layout to send messages to the constellation.
|
||||
pub layout_to_constellation_chan: IpcSender<LayoutMsg>,
|
||||
|
||||
/// A fatory for creating layouts to be used by the ScriptThread.
|
||||
pub layout_factory: Arc<dyn LayoutFactory>,
|
||||
|
||||
|
@ -279,7 +275,6 @@ impl Pipeline {
|
|||
time_profiler_chan: state.time_profiler_chan,
|
||||
mem_profiler_chan: state.mem_profiler_chan,
|
||||
window_size: state.window_size,
|
||||
layout_to_constellation_chan: state.layout_to_constellation_chan,
|
||||
script_chan: script_chan.clone(),
|
||||
load_data: state.load_data.clone(),
|
||||
script_port,
|
||||
|
@ -481,7 +476,6 @@ pub struct UnprivilegedPipelineContent {
|
|||
script_to_constellation_chan: ScriptToConstellationChan,
|
||||
background_hang_monitor_to_constellation_chan: IpcSender<HangMonitorAlert>,
|
||||
bhm_control_port: Option<IpcReceiver<BackgroundHangMonitorControlMsg>>,
|
||||
layout_to_constellation_chan: IpcSender<LayoutMsg>,
|
||||
devtools_ipc_sender: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
|
||||
#[cfg(feature = "bluetooth")]
|
||||
bluetooth_thread: IpcSender<BluetoothRequest>,
|
||||
|
@ -533,7 +527,6 @@ impl UnprivilegedPipelineContent {
|
|||
constellation_receiver: self.script_port,
|
||||
pipeline_to_constellation_sender: self.script_to_constellation_chan.clone(),
|
||||
background_hang_monitor_register: background_hang_monitor_register.clone(),
|
||||
layout_to_constellation_ipc_sender: self.layout_to_constellation_chan.clone(),
|
||||
#[cfg(feature = "bluetooth")]
|
||||
bluetooth_sender: self.bluetooth_thread,
|
||||
resource_threads: self.resource_threads,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue