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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/timing/PerformanceObserver.h" 5 #include "core/timing/PerformanceObserver.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/timing/PerformanceBase.h" 9 #include "core/timing/PerformanceBase.h"
10 #include "core/timing/PerformanceEntry.h" 10 #include "core/timing/PerformanceEntry.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 m_filterOptions = entryTypes; 50 m_filterOptions = entryTypes;
51 if (m_isRegistered) 51 if (m_isRegistered)
52 m_performance->updatePerformanceObserverFilterOptions(); 52 m_performance->updatePerformanceObserverFilterOptions();
53 else 53 else
54 m_performance->registerPerformanceObserver(*this); 54 m_performance->registerPerformanceObserver(*this);
55 m_isRegistered = true; 55 m_isRegistered = true;
56 } 56 }
57 57
58 void PerformanceObserver::disconnect() 58 void PerformanceObserver::disconnect()
59 { 59 {
60 if (m_performance) 60 if (m_performance) {
61 m_performance->unregisterPerformanceObserver(*this); 61 m_performance->unregisterPerformanceObserver(*this);
62 62 }
63 m_performanceEntries.clear(); 63 m_performanceEntries.clear();
64 m_isRegistered = false; 64 m_isRegistered = false;
65 } 65 }
66 66
67 void PerformanceObserver::enqueuePerformanceEntry(PerformanceEntry& entry) 67 void PerformanceObserver::enqueuePerformanceEntry(PerformanceEntry& entry)
68 { 68 {
69 ASSERT(isMainThread()); 69 ASSERT(isMainThread());
70 m_performanceEntries.append(&entry); 70 m_performanceEntries.append(&entry);
71 if (m_performance) 71 if (m_performance)
72 m_performance->activateObserver(*this); 72 m_performance->activateObserver(*this);
(...skipping 19 matching lines...) Expand all
92 } 92 }
93 93
94 DEFINE_TRACE(PerformanceObserver) 94 DEFINE_TRACE(PerformanceObserver)
95 { 95 {
96 visitor->trace(m_callback); 96 visitor->trace(m_callback);
97 visitor->trace(m_performance); 97 visitor->trace(m_performance);
98 visitor->trace(m_performanceEntries); 98 visitor->trace(m_performanceEntries);
99 } 99 }
100 100
101 } // namespace blink 101 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceBase.cpp ('k') | third_party/WebKit/Source/core/timing/PerformanceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698