OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef V8IntersectionObserverCallback_h | 5 #ifndef V8IntersectionObserverCallback_h |
6 #define V8IntersectionObserverCallback_h | 6 #define V8IntersectionObserverCallback_h |
7 | 7 |
8 #include "bindings/core/v8/ActiveDOMCallback.h" | 8 #include "bindings/core/v8/ActiveDOMCallback.h" |
9 #include "bindings/core/v8/DOMWrapperWorld.h" | 9 #include "bindings/core/v8/DOMWrapperWorld.h" |
10 #include "bindings/core/v8/ScopedPersistent.h" | 10 #include "bindings/core/v8/ScopedPersistent.h" |
11 #include "core/CoreExport.h" | 11 #include "core/CoreExport.h" |
12 #include "core/dom/IntersectionObserverCallback.h" | 12 #include "core/dom/IntersectionObserverCallback.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class V8IntersectionObserverCallback final : public IntersectionObserverCallback
, public ActiveDOMCallback { | 16 class V8IntersectionObserverCallback final : public IntersectionObserverCallback
, public ActiveDOMCallback { |
17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8IntersectionObserverCallback); | 17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8IntersectionObserverCallback); |
18 public: | 18 public: |
19 CORE_EXPORT V8IntersectionObserverCallback(v8::Local<v8::Function>, v8::Loca
l<v8::Object>, ScriptState*); | 19 CORE_EXPORT V8IntersectionObserverCallback(v8::Local<v8::Function>, v8::Loca
l<v8::Object>, ScriptState*); |
20 ~V8IntersectionObserverCallback() override; | 20 ~V8IntersectionObserverCallback() override; |
21 | 21 |
22 DECLARE_VIRTUAL_TRACE(); | 22 DECLARE_VIRTUAL_TRACE(); |
23 | 23 |
24 void handleEvent(const HeapVector<Member<IntersectionObserverEntry>>&, Inter
sectionObserver&) override; | 24 void handleEvent(const HeapVector<Member<IntersectionObserverEntry>>&, Inter
sectionObserver&) override; |
25 ExecutionContext* executionContext() const override { return ContextLifecycl
eObserver::executionContext(); } | 25 ExecutionContext* getExecutionContext() const override { return ContextLifec
ycleObserver::getExecutionContext(); } |
26 private: | 26 private: |
27 | 27 |
28 static void setWeakCallback(const v8::WeakCallbackInfo<V8IntersectionObserve
rCallback>&); | 28 static void setWeakCallback(const v8::WeakCallbackInfo<V8IntersectionObserve
rCallback>&); |
29 | 29 |
30 ScopedPersistent<v8::Function> m_callback; | 30 ScopedPersistent<v8::Function> m_callback; |
31 RefPtr<ScriptState> m_scriptState; | 31 RefPtr<ScriptState> m_scriptState; |
32 }; | 32 }; |
33 | 33 |
34 } // namespace blink | 34 } // namespace blink |
35 #endif // V8IntersectionObserverCallback_h | 35 #endif // V8IntersectionObserverCallback_h |
OLD | NEW |