| 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/DOMWrapperWorld.h" | |
| 9 #include "bindings/core/v8/ScopedPersistent.h" | |
| 10 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 11 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
| 12 #include "core/dom/IntersectionObserverCallback.h" | 10 #include "core/dom/IntersectionObserverCallback.h" |
| 11 #include "platform/bindings/DOMWrapperWorld.h" |
| 12 #include "platform/bindings/ScopedPersistent.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class V8IntersectionObserverCallback final | 16 class V8IntersectionObserverCallback final |
| 17 : public IntersectionObserverCallback { | 17 : public IntersectionObserverCallback { |
| 18 public: | 18 public: |
| 19 CORE_EXPORT V8IntersectionObserverCallback(v8::Local<v8::Function>, | 19 CORE_EXPORT V8IntersectionObserverCallback(v8::Local<v8::Function>, |
| 20 v8::Local<v8::Object>, | 20 v8::Local<v8::Object>, |
| 21 ScriptState*); | 21 ScriptState*); |
| 22 ~V8IntersectionObserverCallback() override; | 22 ~V8IntersectionObserverCallback() override; |
| 23 | 23 |
| 24 DECLARE_VIRTUAL_TRACE(); | 24 DECLARE_VIRTUAL_TRACE(); |
| 25 | 25 |
| 26 void HandleEvent(const HeapVector<Member<IntersectionObserverEntry>>&, | 26 void HandleEvent(const HeapVector<Member<IntersectionObserverEntry>>&, |
| 27 IntersectionObserver&) override; | 27 IntersectionObserver&) override; |
| 28 | 28 |
| 29 ExecutionContext* GetExecutionContext() const override { | 29 ExecutionContext* GetExecutionContext() const override { |
| 30 return ExecutionContext::From(script_state_.Get()); | 30 return ExecutionContext::From(script_state_.Get()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 ScopedPersistent<v8::Function> callback_; | 34 ScopedPersistent<v8::Function> callback_; |
| 35 RefPtr<ScriptState> script_state_; | 35 RefPtr<ScriptState> script_state_; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace blink | 38 } // namespace blink |
| 39 #endif // V8IntersectionObserverCallback_h | 39 #endif // V8IntersectionObserverCallback_h |
| OLD | NEW |