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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceBase.cpp

Issue 2528513003: first-paint and first-contentful paint (Closed)
Patch Set: updated layout tests Created 4 years 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/timing/PerformanceBase.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
index 377a1aed2fef0359fd57b733cf2bb90313c3c678..2eaa02a0132814542de106fb669ccdbbe0b93f00 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -103,9 +103,11 @@ PerformanceEntryVector PerformanceBase::getEntriesByType(
switch (type) {
case PerformanceEntry::Invalid:
return entries;
+ case PerformanceEntry::Paint:
panicker 2016/12/05 20:51:23 Nit: add another comment here instead of adding to
sunjian 2016/12/07 21:55:44 Done.
case PerformanceEntry::LongTask:
- // Unsupported for LongTask. Per the spec, Long task entries can only be
- // accessed via Performance Observer. No separate buffer is maintained.
+ // Unsupported for LongTask or Paint. Per the spec, Long task entries and
+ // Paint entries can only be accessed via Performance Observer.
+ // No separate buffer is maintained.
return entries;
case PerformanceEntry::Resource:
for (const auto& resource : m_resourceTimingBuffer)
@@ -355,6 +357,15 @@ void PerformanceBase::addNavigationTiming(LocalFrame* frame) {
notifyObserversOfEntry(*m_navigationTiming);
}
+void PerformanceBase::addPaintTiming(PerformancePaintTiming::PaintType type,
+ double startTime) {
+ if (!RuntimeEnabledFeatures::performancePaintTimingEnabled())
+ return;
+ PerformanceEntry* entry = new PerformancePaintTiming(
+ type, monotonicTimeToDOMHighResTimeStamp(startTime));
+ notifyObserversOfEntry(*entry);
+}
+
void PerformanceBase::addResourceTimingBuffer(PerformanceEntry& entry) {
m_resourceTimingBuffer.append(&entry);

Powered by Google App Engine
This is Rietveld 408576698