| 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/V8PerformanceObserverCallback.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" |
| 11 #include "core/timing/PerformanceEntry.h" | 11 #include "core/timing/PerformanceEntry.h" |
| 12 #include "core/timing/PerformanceObserverEntryList.h" | 12 #include "core/timing/PerformanceObserverEntryList.h" |
| 13 #include "core/timing/PerformanceObserverInit.h" | 13 #include "core/timing/PerformanceObserverInit.h" |
| 14 #include "platform/Timer.h" | 14 #include "platform/Timer.h" |
| 15 #include <algorithm> | 15 #include <algorithm> |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 PerformanceObserver* PerformanceObserver::create(ScriptState* scriptState, Perfo
rmanceBase* performance, V8PerformanceObserverCallback* callback) | 19 PerformanceObserver* PerformanceObserver::create(ScriptState* scriptState, Perfo
rmanceBase* performance, PerformanceObserverCallback* callback) |
| 20 { | 20 { |
| 21 ASSERT(isMainThread()); | 21 ASSERT(isMainThread()); |
| 22 return new PerformanceObserver(scriptState, performance, callback); | 22 return new PerformanceObserver(scriptState, performance, callback); |
| 23 } | 23 } |
| 24 | 24 |
| 25 PerformanceObserver::PerformanceObserver(ScriptState* scriptState, PerformanceBa
se* performance, V8PerformanceObserverCallback* callback) | 25 PerformanceObserver::PerformanceObserver(ScriptState* scriptState, PerformanceBa
se* performance, PerformanceObserverCallback* callback) |
| 26 : m_scriptState(scriptState) | 26 : m_scriptState(scriptState) |
| 27 , m_callback(callback) | 27 , m_callback(callback) |
| 28 , m_performance(performance) | 28 , m_performance(performance) |
| 29 , m_filterOptions(PerformanceEntry::Invalid) | 29 , m_filterOptions(PerformanceEntry::Invalid) |
| 30 , m_isRegistered(false) | 30 , m_isRegistered(false) |
| 31 { | 31 { |
| 32 } | 32 } |
| 33 | 33 |
| 34 void PerformanceObserver::observe(const PerformanceObserverInit& observerInit, E
xceptionState& exceptionState) | 34 void PerformanceObserver::observe(const PerformanceObserverInit& observerInit, E
xceptionState& exceptionState) |
| 35 { | 35 { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 DEFINE_TRACE(PerformanceObserver) | 97 DEFINE_TRACE(PerformanceObserver) |
| 98 { | 98 { |
| 99 visitor->trace(m_callback); | 99 visitor->trace(m_callback); |
| 100 visitor->trace(m_performance); | 100 visitor->trace(m_performance); |
| 101 visitor->trace(m_performanceEntries); | 101 visitor->trace(m_performanceEntries); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace blink | 104 } // namespace blink |
| OLD | NEW |