OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8PerformanceObserverCallback_h |
| 6 #define V8PerformanceObserverCallback_h |
| 7 |
| 8 #include "bindings/core/v8/ActiveDOMCallback.h" |
| 9 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 10 #include "bindings/core/v8/ScopedPersistent.h" |
| 11 #include "core/CoreExport.h" |
| 12 #include "core/timing/PerformanceObserverCallback.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class V8PerformanceObserverCallback final : public PerformanceObserverCallback,
public ActiveDOMCallback { |
| 17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8PerformanceObserverCallback); |
| 18 public: |
| 19 static V8PerformanceObserverCallback* create(v8::Local<v8::Function> callbac
k, v8::Local<v8::Object> owner, ScriptState* scriptState) |
| 20 { |
| 21 return new V8PerformanceObserverCallback(callback, owner, scriptState); |
| 22 } |
| 23 |
| 24 ~V8PerformanceObserverCallback() override; |
| 25 |
| 26 DECLARE_VIRTUAL_TRACE(); |
| 27 |
| 28 void handleEvent(PerformanceObserverEntryList*, PerformanceObserver*) overri
de; |
| 29 ExecutionContext* executionContext() const override { return ContextLifecycl
eObserver::executionContext(); } |
| 30 private: |
| 31 CORE_EXPORT V8PerformanceObserverCallback(v8::Local<v8::Function>, v8::Local
<v8::Object>, ScriptState*); |
| 32 |
| 33 static void setWeakCallback(const v8::WeakCallbackInfo<V8PerformanceObserver
Callback>&); |
| 34 |
| 35 ScopedPersistent<v8::Function> m_callback; |
| 36 RefPtr<ScriptState> m_scriptState; |
| 37 }; |
| 38 |
| 39 } |
| 40 #endif // V8PerformanceObserverCallback_h |
OLD | NEW |