Chromium Code Reviews| 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 aa49b288243b451cf35a4f9024895baed6f96337..660507eee11d03eae3d5bff86da2a268791a26b1 100644 |
| --- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp |
| +++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp |
| @@ -133,12 +133,6 @@ PerformanceEntryVector PerformanceBase::getEntriesByType( |
| PerformanceEntry::toEntryTypeEnum(entryType); |
| switch (type) { |
| - case PerformanceEntry::Invalid: |
| - return entries; |
| - case PerformanceEntry::LongTask: |
| - // Unsupported for LongTask. Per the spec, Long task entries can only be |
| - // accessed via Performance Observer. No separate buffer is maintained. |
| - return entries; |
| case PerformanceEntry::Resource: |
| for (const auto& resource : m_resourceTimingBuffer) |
| entries.append(resource); |
| @@ -163,6 +157,15 @@ PerformanceEntryVector PerformanceBase::getEntriesByType( |
| if (m_userTiming) |
| entries.appendVector(m_userTiming->getMeasures()); |
| break; |
| + // Unsupported for LongTask, TaskAttribution. |
| + // Per the spec, these entries can only be accessed via |
| + // Performance Observer. No separate buffer is maintained. |
| + case PerformanceEntry::LongTask: |
| + break; |
| + case PerformanceEntry::TaskAttribution: |
| + break; |
| + case PerformanceEntry::Invalid: |
| + break; |
|
Yoav Weiss
2017/01/06 10:13:05
Hmm, this is according to spec: https://w3c.github
|
| } |
| std::sort(entries.begin(), entries.end(), |
| @@ -428,15 +431,15 @@ bool PerformanceBase::isFrameTimingBufferFull() { |
| void PerformanceBase::addLongTaskTiming(double startTime, |
| double endTime, |
| const String& name, |
| - const String& culpritFrameSrc, |
| - const String& culpritFrameId, |
| - const String& culpritFrameName) { |
| + const String& frameSrc, |
| + const String& frameId, |
| + const String& frameName) { |
| if (!hasObserverFor(PerformanceEntry::LongTask)) |
| return; |
| PerformanceEntry* entry = PerformanceLongTaskTiming::create( |
| monotonicTimeToDOMHighResTimeStamp(startTime), |
| - monotonicTimeToDOMHighResTimeStamp(endTime), name, culpritFrameSrc, |
| - culpritFrameId, culpritFrameName); |
| + monotonicTimeToDOMHighResTimeStamp(endTime), name, frameSrc, frameId, |
| + frameName); |
| notifyObserversOfEntry(*entry); |
| } |