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; |