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

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: 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..d6392e19600a5577c95a57ed1bbd2e55e964e965 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);
+ enableLongTaskInstrumentation();
}
void PerformanceBase::unregisterPerformanceObserver(PerformanceObserver& oldObserver)
@@ -412,6 +413,7 @@ void PerformanceBase::unregisterPerformanceObserver(PerformanceObserver& oldObse
}
m_observers.remove(&oldObserver);
updatePerformanceObserverFilterOptions();
+ disableLongTaskInstrumentation();
}
void PerformanceBase::updatePerformanceObserverFilterOptions()
@@ -420,6 +422,7 @@ void PerformanceBase::updatePerformanceObserverFilterOptions()
for (const auto& observer : m_observers) {
m_observerFilterOptions |= observer->filterOptions();
}
+ enableLongTaskInstrumentation();
}
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;
}

Powered by Google App Engine
This is Rietveld 408576698