| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 // clang-format off | 7 // clang-format off |
| 8 | 8 |
| 9 #include "VoidCallbackFunctionModules.h" | 9 #include "VoidCallbackFunctionModules.h" |
| 10 | 10 |
| 11 #include "bindings/core/v8/ExceptionState.h" | 11 #include "bindings/core/v8/ExceptionState.h" |
| 12 #include "bindings/core/v8/ScriptState.h" | 12 #include "bindings/core/v8/ScriptState.h" |
| 13 #include "bindings/core/v8/ToV8.h" | 13 #include "bindings/core/v8/ToV8.h" |
| 14 #include "bindings/core/v8/V8Binding.h" | 14 #include "bindings/core/v8/V8Binding.h" |
| 15 #include "core/dom/ExecutionContext.h" | 15 #include "core/dom/ExecutionContext.h" |
| 16 #include "wtf/Assertions.h" | 16 #include "wtf/Assertions.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 VoidCallbackFunctionModules::VoidCallbackFunctionModules(ScriptState* scriptStat
e, v8::Local<v8::Function> callback) | 20 VoidCallbackFunctionModules::VoidCallbackFunctionModules(ScriptState* scriptStat
e, v8::Local<v8::Function> callback) |
| 21 : m_scriptState(scriptState), | 21 : m_scriptState(scriptState), |
| 22 m_callback(scriptState->isolate(), callback) { | 22 m_callback(scriptState->isolate(), this, callback) { |
| 23 DCHECK(!m_callback.isEmpty()); | 23 DCHECK(!m_callback.isEmpty()); |
| 24 m_callback.setPhantom(); | 24 m_callback.setPhantom(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 DEFINE_TRACE(VoidCallbackFunctionModules) {} | 27 DEFINE_TRACE(VoidCallbackFunctionModules) {} |
| 28 | 28 |
| 29 DEFINE_TRACE_WRAPPERS(VoidCallbackFunctionModules) { | 29 DEFINE_TRACE_WRAPPERS(VoidCallbackFunctionModules) { |
| 30 visitor->traceWrappers(&m_callback.cast<v8::Object>()); | 30 visitor->traceWrappers(m_callback.cast<v8::Value>()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool VoidCallbackFunctionModules::call(ScriptWrappable* scriptWrappable) { | 33 bool VoidCallbackFunctionModules::call(ScriptWrappable* scriptWrappable) { |
| 34 if (!m_scriptState->contextIsValid()) | 34 if (!m_scriptState->contextIsValid()) |
| 35 return false; | 35 return false; |
| 36 | 36 |
| 37 ExecutionContext* context = m_scriptState->getExecutionContext(); | 37 ExecutionContext* context = m_scriptState->getExecutionContext(); |
| 38 DCHECK(context); | 38 DCHECK(context); |
| 39 if (context->activeDOMObjectsAreSuspended() || context->activeDOMObjectsAreSto
pped()) | 39 if (context->activeDOMObjectsAreSuspended() || context->activeDOMObjectsAreSto
pped()) |
| 40 return false; | 40 return false; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 55 v8::TryCatch exceptionCatcher(m_scriptState->isolate()); | 55 v8::TryCatch exceptionCatcher(m_scriptState->isolate()); |
| 56 exceptionCatcher.SetVerbose(true); | 56 exceptionCatcher.SetVerbose(true); |
| 57 | 57 |
| 58 if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate())
, m_scriptState->getExecutionContext(), thisValue, 0, argv, m_scriptState->isola
te()).ToLocal(&v8ReturnValue)) { | 58 if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate())
, m_scriptState->getExecutionContext(), thisValue, 0, argv, m_scriptState->isola
te()).ToLocal(&v8ReturnValue)) { |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 return false; | 61 return false; |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |