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

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

Issue 2039363003: FirstMeaningfulPaint UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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
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 bc69e96dd1e2df464790f5f80011045f73349640..c23493ca5a154bf53853fa2e10920a6f560c3a30 100644
--- a/third_party/WebKit/Source/core/paint/PaintTiming.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintTiming.cpp
@@ -65,14 +65,35 @@ void PaintTiming::markFirstImagePaint()
notifyPaintTimingChanged();
}
+void PaintTiming::setFirstMeaningfulPaint(double stamp)
+{
+ DCHECK_EQ(m_firstMeaningfulPaint, 0.0);
+ m_firstMeaningfulPaint = stamp;
+ TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing", "firstMeaningfulPaint", m_firstMeaningfulPaint, "frame", frame());
+ notifyPaintTimingChanged();
+}
+
+void PaintTiming::notifyPaint(bool isFirstPaint, bool textPainted, bool imagePainted)
+{
+ if (isFirstPaint)
+ markFirstPaint();
+ if (textPainted)
+ markFirstTextPaint();
+ if (imagePainted)
+ markFirstImagePaint();
+ m_fmpDetector->notifyPaint();
+}
+
DEFINE_TRACE(PaintTiming)
{
visitor->trace(m_document);
+ visitor->trace(m_fmpDetector);
Supplement<Document>::trace(visitor);
}
PaintTiming::PaintTiming(Document& document)
: m_document(document)
+ , m_fmpDetector(new FirstMeaningfulPaintDetector(this))
{
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintTiming.h ('k') | third_party/WebKit/Source/core/timing/PerformanceTiming.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698