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 #include "bindings/core/v8/V8IntersectionObserverCallback.h" | 5 #include "bindings/core/v8/V8IntersectionObserverCallback.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptController.h" | 7 #include "bindings/core/v8/ScriptController.h" |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "bindings/core/v8/V8IntersectionObserver.h" | 9 #include "bindings/core/v8/V8IntersectionObserver.h" |
10 #include "bindings/core/v8/V8PrivateProperty.h" | 10 #include "bindings/core/v8/V8PrivateProperty.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 ScriptState::Scope scope(m_scriptState.get()); | 36 ScriptState::Scope scope(m_scriptState.get()); |
37 | 37 |
38 if (m_callback.isEmpty()) | 38 if (m_callback.isEmpty()) |
39 return; | 39 return; |
40 v8::Local<v8::Value> observerHandle = toV8(&observer, m_scriptState->context
()->Global(), m_scriptState->isolate()); | 40 v8::Local<v8::Value> observerHandle = toV8(&observer, m_scriptState->context
()->Global(), m_scriptState->isolate()); |
41 if (!observerHandle->IsObject()) | 41 if (!observerHandle->IsObject()) |
42 return; | 42 return; |
43 | 43 |
44 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(observerHandl
e); | 44 v8::Local<v8::Object> thisObject = v8::Local<v8::Object>::Cast(observerHandl
e); |
45 v8::Local<v8::Value> entriesHandle = toV8(entries, m_scriptState->context()-
>Global(), m_scriptState->isolate()); | 45 v8::Local<v8::Value> entriesHandle = toV8(entries, m_scriptState->context()-
>Global(), m_scriptState->isolate()); |
46 if (entriesHandle.IsEmpty()) { | |
47 return; | |
48 } | |
49 v8::Local<v8::Value> argv[] = { entriesHandle, observerHandle }; | 46 v8::Local<v8::Value> argv[] = { entriesHandle, observerHandle }; |
50 | 47 |
51 v8::TryCatch exceptionCatcher(m_scriptState->isolate()); | 48 v8::TryCatch exceptionCatcher(m_scriptState->isolate()); |
52 exceptionCatcher.SetVerbose(true); | 49 exceptionCatcher.SetVerbose(true); |
53 V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()),
m_scriptState->getExecutionContext(), thisObject, 2, argv, m_scriptState->isolat
e()); | 50 V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()),
m_scriptState->getExecutionContext(), thisObject, 2, argv, m_scriptState->isolat
e()); |
54 } | 51 } |
55 | 52 |
56 DEFINE_TRACE(V8IntersectionObserverCallback) | 53 DEFINE_TRACE(V8IntersectionObserverCallback) |
57 { | 54 { |
58 IntersectionObserverCallback::trace(visitor); | 55 IntersectionObserverCallback::trace(visitor); |
59 ActiveDOMCallback::trace(visitor); | 56 ActiveDOMCallback::trace(visitor); |
60 } | 57 } |
61 | 58 |
62 } // namespace blink | 59 } // namespace blink |
OLD | NEW |