| OLD | NEW |
| 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 "bindings/core/v8/PerformanceObserverCallback.h" | 8 #include "bindings/core/v8/PerformanceObserverCallback.h" |
| 9 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
| 10 #include "core/timing/PerformanceBase.h" | 10 #include "core/timing/PerformanceBase.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void PerformanceObserver::disconnect() { | 64 void PerformanceObserver::disconnect() { |
| 65 if (m_performance) { | 65 if (m_performance) { |
| 66 m_performance->unregisterPerformanceObserver(*this); | 66 m_performance->unregisterPerformanceObserver(*this); |
| 67 } | 67 } |
| 68 m_performanceEntries.clear(); | 68 m_performanceEntries.clear(); |
| 69 m_isRegistered = false; | 69 m_isRegistered = false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void PerformanceObserver::enqueuePerformanceEntry(PerformanceEntry& entry) { | 72 void PerformanceObserver::enqueuePerformanceEntry(PerformanceEntry& entry) { |
| 73 ASSERT(isMainThread()); | 73 ASSERT(isMainThread()); |
| 74 m_performanceEntries.append(&entry); | 74 m_performanceEntries.push_back(&entry); |
| 75 if (m_performance) | 75 if (m_performance) |
| 76 m_performance->activateObserver(*this); | 76 m_performance->activateObserver(*this); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool PerformanceObserver::shouldBeSuspended() const { | 79 bool PerformanceObserver::shouldBeSuspended() const { |
| 80 return m_executionContext->isContextSuspended(); | 80 return m_executionContext->isContextSuspended(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void PerformanceObserver::deliver() { | 83 void PerformanceObserver::deliver() { |
| 84 ASSERT(!shouldBeSuspended()); | 84 ASSERT(!shouldBeSuspended()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 98 visitor->trace(m_callback); | 98 visitor->trace(m_callback); |
| 99 visitor->trace(m_performance); | 99 visitor->trace(m_performance); |
| 100 visitor->trace(m_performanceEntries); | 100 visitor->trace(m_performanceEntries); |
| 101 } | 101 } |
| 102 | 102 |
| 103 DEFINE_TRACE_WRAPPERS(PerformanceObserver) { | 103 DEFINE_TRACE_WRAPPERS(PerformanceObserver) { |
| 104 visitor->traceWrappers(m_callback); | 104 visitor->traceWrappers(m_callback); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |