Auto merge of #18155 - ferjm:pwm.perf.timeline, r=jdm

Add paint metrics to Performance Timeline API

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18111
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18155)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-23 15:06:12 -05:00 committed by GitHub
commit 173079c144
15 changed files with 152 additions and 20 deletions

View file

@ -220,6 +220,15 @@ pub enum DocumentActivity {
FullyActive,
}
/// The type of recorded paint metric.
#[derive(Deserialize, Serialize)]
pub enum PaintMetricType {
/// Time to First Paint type.
FirstPaint,
/// Time to First Contentful Paint type.
FirstContentfulPaint,
}
/// The reason why the pipeline id of an iframe is being updated.
#[derive(Copy, Clone, PartialEq, Eq, Hash, HeapSizeOf, Debug, Deserialize, Serialize)]
pub enum UpdatePipelineIdReason {
@ -300,7 +309,9 @@ pub enum ConstellationControlMsg {
/// Reload the given page.
Reload(PipelineId),
/// Notifies the script thread of WebVR events.
WebVREvents(PipelineId, Vec<WebVREvent>)
WebVREvents(PipelineId, Vec<WebVREvent>),
/// Notifies the script thread about a new recorded paint metric.
PaintMetric(PipelineId, PaintMetricType, f64),
}
impl fmt::Debug for ConstellationControlMsg {
@ -334,6 +345,7 @@ impl fmt::Debug for ConstellationControlMsg {
ReportCSSError(..) => "ReportCSSError",
Reload(..) => "Reload",
WebVREvents(..) => "WebVREvents",
PaintMetric(..) => "PaintMetric",
};
write!(formatter, "ConstellationMsg::{}", variant)
}