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