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

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

Issue 2343553005: enable / disable Long Task instrumentation based on presence of LongTask observer (Closed)
Patch Set: address review comments Created 4 years, 3 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/timing/PerformanceBase.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
index 512e6ebd6432ab2f21863f4b9c0c1e70544b9006..b4d1bf667669ad613f249fa91c17046575e8c660 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -400,6 +400,7 @@ void PerformanceBase::registerPerformanceObserver(PerformanceObserver& observer)
{
m_observerFilterOptions |= observer.filterOptions();
m_observers.add(&observer);
+ updateLongTaskInstrumentation();
}
void PerformanceBase::unregisterPerformanceObserver(PerformanceObserver& oldObserver)
@@ -412,6 +413,7 @@ void PerformanceBase::unregisterPerformanceObserver(PerformanceObserver& oldObse
}
m_observers.remove(&oldObserver);
updatePerformanceObserverFilterOptions();
+ updateLongTaskInstrumentation();
}
void PerformanceBase::updatePerformanceObserverFilterOptions()
@@ -420,6 +422,7 @@ void PerformanceBase::updatePerformanceObserverFilterOptions()
for (const auto& observer : m_observers) {
m_observerFilterOptions |= observer->filterOptions();
}
+ updateLongTaskInstrumentation();
}
void PerformanceBase::notifyObserversOfEntry(PerformanceEntry& entry)
@@ -430,7 +433,7 @@ void PerformanceBase::notifyObserversOfEntry(PerformanceEntry& entry)
}
}
-bool PerformanceBase::hasObserverFor(PerformanceEntry::EntryType filterType)
+bool PerformanceBase::hasObserverFor(PerformanceEntry::EntryType filterType) const
{
return m_observerFilterOptions & filterType;
}
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceBase.h ('k') | third_party/WebKit/Source/core/timing/PerformanceObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698