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

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

Issue 2932593002: Attempt 2: Update PaintTiming Web Perf APIs for FP & FCP to report swap time (Closed)
Patch Set: rebase to head Created 3 years, 6 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 3e7c53c2724f428d4395d3cc66ee5f5340e128e9..7cf83ef93b2850bc4e77e587d6d99db52db96e81 100644
--- a/third_party/WebKit/Source/core/paint/PaintTiming.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintTiming.cpp
@@ -141,10 +141,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);
@@ -155,10 +151,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);
@@ -184,12 +176,17 @@ 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