Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunctionSequenceStringArg.cpp

Issue 2350813005: bindings: Support sequence in callback function arguments (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunctionSequenceStringArg.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8VoidExperimentalCallbackFunction.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunctionSequenceStringArg.cpp
similarity index 55%
copy from third_party/WebKit/Source/bindings/tests/results/core/V8VoidExperimentalCallbackFunction.cpp
copy to third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunctionSequenceStringArg.cpp
index 56704495e31a4ff73142a0d59e02b71becc9243c..34541923bec61a541fc0916870ff94f42c955474 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8VoidExperimentalCallbackFunction.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunctionSequenceStringArg.cpp
@@ -4,41 +4,46 @@
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
-#include "V8VoidExperimentalCallbackFunction.h"
+#include "V8VoidCallbackFunctionSequenceStringArg.h"
+#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/ToV8.h"
#include "bindings/core/v8/V8Binding.h"
#include "wtf/Assertions.h"
namespace blink {
-V8VoidExperimentalCallbackFunction::V8VoidExperimentalCallbackFunction(v8::Isolate* isolate, v8::Local<v8::Function> callback)
+V8VoidCallbackFunctionSequenceStringArg::V8VoidCallbackFunctionSequenceStringArg(v8::Isolate* isolate, v8::Local<v8::Function> callback)
: m_callback(isolate, callback)
{
DCHECK(!m_callback.isEmpty());
m_callback.setPhantom();
}
-DEFINE_TRACE(V8VoidExperimentalCallbackFunction)
+DEFINE_TRACE(V8VoidCallbackFunctionSequenceStringArg)
{
}
-bool V8VoidExperimentalCallbackFunction::call(ScriptState* scriptState, ScriptWrappable* scriptWrappable)
+bool V8VoidCallbackFunctionSequenceStringArg::call(ScriptState* scriptState, ScriptWrappable* scriptWrappable, const Vector<String>& arg)
{
if (!scriptState->contextIsValid())
return false;
if (m_callback.isEmpty())
return false;
+
ScriptState::Scope scope(scriptState);
+ ExceptionState exceptionState(scriptState->isolate(), ExceptionState::ExecutionContext, "VoidCallbackFunctionSequenceStringArg");
- v8::Local<v8::Value> *argv = nullptr;
+ v8::Local<v8::Value> argArgument = toV8(arg, scriptState->context()->Global(), scriptState->isolate());
+ v8::Local<v8::Value> argv[] = { argArgument };
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))
+ if (V8ScriptRunner::callFunction(m_callback.newLocal(scriptState->isolate()), scriptState->getExecutionContext(), scriptState->context()->Global(), 1, argv, scriptState->isolate()).ToLocal(&v8ReturnValue))
{
return true;
}

Powered by Google App Engine
This is Rietveld 408576698