| 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. | 5 // This file has been auto-generated by code_generator_v8.py. |
| 6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
| 7 | 7 |
| 8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
| 9 // third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl |
| 10 | 10 |
| 11 // clang-format off | 11 // clang-format off |
| 12 | 12 |
| 13 #include "VoidCallbackFunctionModules.h" | 13 #include "VoidCallbackFunctionModules.h" |
| 14 | 14 |
| 15 #include "bindings/core/v8/ExceptionState.h" | 15 #include "bindings/core/v8/ExceptionState.h" |
| 16 #include "bindings/core/v8/ScriptState.h" | 16 #include "bindings/core/v8/ScriptState.h" |
| 17 #include "bindings/core/v8/ToV8.h" | 17 #include "bindings/core/v8/ToV8.h" |
| 18 #include "bindings/core/v8/V8Binding.h" | 18 #include "bindings/core/v8/V8Binding.h" |
| 19 #include "core/dom/ExecutionContext.h" | 19 #include "core/dom/ExecutionContext.h" |
| 20 #include "wtf/Assertions.h" | 20 #include "wtf/Assertions.h" |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 | 23 |
| 24 // static |
| 25 VoidCallbackFunctionModules* VoidCallbackFunctionModules::create(ScriptState* sc
riptState, v8::Local<v8::Value> callback){ |
| 26 if (isUndefinedOrNull(callback)) |
| 27 return nullptr; |
| 28 return new VoidCallbackFunctionModules(scriptState, v8::Local<v8::Function>::C
ast(callback)); |
| 29 } |
| 30 |
| 24 VoidCallbackFunctionModules::VoidCallbackFunctionModules(ScriptState* scriptStat
e, v8::Local<v8::Function> callback) | 31 VoidCallbackFunctionModules::VoidCallbackFunctionModules(ScriptState* scriptStat
e, v8::Local<v8::Function> callback) |
| 25 : m_scriptState(scriptState), | 32 : m_scriptState(scriptState), |
| 26 m_callback(scriptState->isolate(), this, callback) { | 33 m_callback(scriptState->isolate(), this, callback) { |
| 27 DCHECK(!m_callback.isEmpty()); | 34 DCHECK(!m_callback.isEmpty()); |
| 28 } | 35 } |
| 29 | 36 |
| 30 DEFINE_TRACE(VoidCallbackFunctionModules) {} | 37 DEFINE_TRACE(VoidCallbackFunctionModules) {} |
| 31 | 38 |
| 32 DEFINE_TRACE_WRAPPERS(VoidCallbackFunctionModules) { | 39 DEFINE_TRACE_WRAPPERS(VoidCallbackFunctionModules) { |
| 33 visitor->traceWrappers(m_callback.cast<v8::Value>()); | 40 visitor->traceWrappers(m_callback.cast<v8::Value>()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 58 v8::TryCatch exceptionCatcher(m_scriptState->isolate()); | 65 v8::TryCatch exceptionCatcher(m_scriptState->isolate()); |
| 59 exceptionCatcher.SetVerbose(true); | 66 exceptionCatcher.SetVerbose(true); |
| 60 | 67 |
| 61 if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate())
, m_scriptState->getExecutionContext(), thisValue, 0, argv, m_scriptState->isola
te()).ToLocal(&v8ReturnValue)) { | 68 if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate())
, m_scriptState->getExecutionContext(), thisValue, 0, argv, m_scriptState->isola
te()).ToLocal(&v8ReturnValue)) { |
| 62 return true; | 69 return true; |
| 63 } | 70 } |
| 64 return false; | 71 return false; |
| 65 } | 72 } |
| 66 | 73 |
| 67 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |