Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/tests/results/core/V8VoidExperimentalCallbackFunction.cpp |
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8VoidExperimentalCallbackFunction.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8VoidExperimentalCallbackFunction.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..92ebce5732c0bd4eed75387969f77fcc69006c73 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8VoidExperimentalCallbackFunction.cpp |
| @@ -0,0 +1,48 @@ |
| +// 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 "V8VoidExperimentalCallbackFunction.h" |
| + |
| +#include "bindings/core/v8/ScriptState.h" |
| +#include "bindings/core/v8/V8Binding.h" |
| +#include "wtf/Assertions.h" |
| + |
| +namespace blink { |
| + |
| +V8VoidExperimentalCallbackFunction::V8VoidExperimentalCallbackFunction(v8::Isolate* isolate, v8::Local<v8::Function> callback) |
| + : m_callback(isolate, callback) |
| +{ |
| + DCHECK(!m_callback.isEmpty()); |
| + m_callback.setPhantom(); |
| +} |
| + |
| +DEFINE_TRACE(V8VoidExperimentalCallbackFunction) |
| +{ |
| +} |
| + |
| +bool V8VoidExperimentalCallbackFunction::call(ScriptState* scriptState, ScriptWrappable* scriptWrappable) |
| +{ |
| + if (!scriptState->contextIsValid()) |
| + return false; |
| + |
| + ScriptState::Scope scope(scriptState); |
| + if (m_callback.isEmpty()) |
|
haraken
2016/09/20 07:08:22
I'd move this check to above line 31. If m_callbac
lkawai
2016/09/20 08:15:06
Done.
|
| + return false; |
| + |
| + v8::Local<v8::Value> *argv = nullptr; |
| + |
| + v8::Local<v8::Value> v8ReturnValue; |
| + 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(&v8ReturnValue)) |
| + { |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| +} // namespace blink |