Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp |
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b06f155e4089b74444db2bee43f0d8761c5ae240 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| + |
| +#include "V8VoidCallbackFunction2.h" |
| + |
| +#include "wtf/Assertions.h" |
| +#include "bindings/core/v8/ScriptState.h" |
| +#include "bindings/core/v8/V8Binding.h" |
| + |
| +namespace blink { |
| + |
| +V8VoidCallbackFunction2::V8VoidCallbackFunction2(v8::Local<v8::Function> callback, ScriptState* scriptState) |
| + : m_callback(scriptState->isolate(), callback) |
| +{ |
| + m_callback.setPhantom(); |
|
bashi
2016/09/13 00:35:06
It seems we need to check isEmpty() before calling
Yuki
2016/09/14 11:57:23
Should have been checked at call sites, but it's a
lkawai
2016/09/16 05:05:51
Done.
lkawai
2016/09/16 05:05:51
Done.
|
| +} |
| + |
| +DEFINE_TRACE(V8VoidCallbackFunction2) |
| +{ |
| +} |
| + |
| +bool V8VoidCallbackFunction2::call(ScriptState* scriptState, ScriptWrappable* scriptWrappable, Nullable<void*>& returnValue) |
| +{ |
| + if (!scriptState->contextIsValid()) |
| + return false; |
| + |
|
Yuki
2016/09/14 11:57:23
I thought that you had
ScriptState::Scope scop
lkawai
2016/09/16 05:05:51
Done.
|
| + if (m_callback.isEmpty()) |
| + return false; |
| + |
| + v8::Local<v8::Value> *argv = 0; |
| + |
| + v8::Local<v8::Value> currentValue; |
| + v8::TryCatch exceptionCatcher(scriptState->isolate()); |
| + exceptionCatcher.SetVerbose(true); |
| + if (V8ScriptRunner::callFunction(m_callback.newLocal(scriptState->isolate()), scriptState->getExecutionContext(), scriptState->context()->Global(), 0, argv, scriptState->isolate()).ToLocal(¤tValue)) |
| + { |
| + returnValue = cppValue; |
|
bashi
2016/09/13 00:35:06
Do we need this?
lkawai
2016/09/16 05:05:51
Done.
|
| + return true; |
| + } |
| + else { return false; } |
| +} |
| + |
| +} // namespace blink |