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

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

Issue 2343553005: enable / disable Long Task instrumentation based on presence of LongTask observer (Closed)
Patch Set: remove check in dtor 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/PerformanceObserver.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp b/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp
index 920a8d5ce3e84a6acd3a792946ff2c0fbc6d8802..374567590d53a8713f1c6a05e4f78a5a48a663cf 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp
@@ -52,14 +52,16 @@ void PerformanceObserver::observe(const PerformanceObserverInit& observerInit, E
m_performance->updatePerformanceObserverFilterOptions();
else
m_performance->registerPerformanceObserver(*this);
+ m_performance->enableLongTaskInstrumentation();
caseq 2016/09/19 22:18:06 Should we rather make this part of PerformanceBase
panicker 2016/09/20 12:00:39 Yes, I started with that in this CL, but the issue
m_isRegistered = true;
}
void PerformanceObserver::disconnect()
{
- if (m_performance)
+ if (m_performance) {
m_performance->unregisterPerformanceObserver(*this);
-
+ m_performance->disableLongTaskInstrumentation();
caseq 2016/09/19 22:18:06 ditto, consider moving to PerformanceBase::unregis
panicker 2016/09/20 12:00:39 Done.
+ }
m_performanceEntries.clear();
m_isRegistered = false;
}

Powered by Google App Engine
This is Rietveld 408576698