Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: third_party/WebKit/Source/core/paint/PaintTiming.cpp

Issue 2873033002: Update PaintTiming Web Perf APIs for FP & FCP to report swap time (Closed)
Patch Set: missed virtual/mojo-loading tests Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/observable.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintTiming.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintTiming.cpp b/third_party/WebKit/Source/core/paint/PaintTiming.cpp
index 27902b2aaee57c3c94862b9e4a30191aef6a097b..799970f6eb3607a3bd41f451192601efc0fe2d9d 100644
--- a/third_party/WebKit/Source/core/paint/PaintTiming.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintTiming.cpp
@@ -140,10 +140,6 @@ void PaintTiming::SetFirstPaint(double stamp) {
if (first_paint_ != 0.0)
return;
first_paint_ = stamp;
- Performance* performance = GetPerformanceInstance(GetFrame());
- if (performance)
- performance->AddFirstPaintTiming(first_paint_);
-
TRACE_EVENT_INSTANT1("loading,rail,devtools.timeline", "firstPaint",
TRACE_EVENT_SCOPE_PROCESS, "frame", GetFrame());
RegisterNotifySwapTime(PaintEvent::kFirstPaint);
@@ -154,10 +150,6 @@ void PaintTiming::SetFirstContentfulPaint(double stamp) {
return;
SetFirstPaint(stamp);
first_contentful_paint_ = stamp;
- Performance* performance = GetPerformanceInstance(GetFrame());
- if (performance)
- performance->AddFirstContentfulPaintTiming(first_contentful_paint_);
-
TRACE_EVENT_INSTANT1("loading,rail,devtools.timeline", "firstContentfulPaint",
TRACE_EVENT_SCOPE_PROCESS, "frame", GetFrame());
RegisterNotifySwapTime(PaintEvent::kFirstContentfulPaint);
@@ -182,12 +174,18 @@ void PaintTiming::ReportSwapTime(PaintEvent event,
double timestamp) {
if (!did_swap)
return;
+
+ Performance* performance = GetPerformanceInstance(GetFrame());
switch (event) {
case PaintEvent::kFirstPaint:
first_paint_swap_ = timestamp;
+ if (performance)
+ performance->AddFirstPaintTiming(first_paint_);
return;
case PaintEvent::kFirstContentfulPaint:
first_contentful_paint_swap_ = timestamp;
+ if (performance)
+ performance->AddFirstContentfulPaintTiming(first_contentful_paint_);
return;
case PaintEvent::kFirstMeaningfulPaint:
first_meaningful_paint_swap_ = timestamp;
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/performance-timing/paint-timing/observable.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698