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