mirror of
https://github.com/servo/servo.git
synced 2025-07-25 00:00:20 +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
|
@ -46,21 +46,6 @@ pub struct IFrameSizeMsg {
|
|||
pub type_: WindowSizeType,
|
||||
}
|
||||
|
||||
/// Messages from the layout to the constellation.
|
||||
#[derive(Deserialize, IntoStaticStr, Serialize)]
|
||||
pub enum LayoutMsg {
|
||||
/// Requests that the constellation inform the compositor that it needs to record
|
||||
/// the time when the frame with the given ID (epoch) is painted.
|
||||
PendingPaintMetric(WebViewId, PipelineId, Epoch),
|
||||
}
|
||||
|
||||
impl fmt::Debug for LayoutMsg {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
let variant_string: &'static str = self.into();
|
||||
write!(formatter, "LayoutMsg::{variant_string}")
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the default action for a touch event was prevented by web content
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum TouchEventResult {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue