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

Unified Diff: Source/bindings/tests/results/V8TestBlinkInJSInterface.cpp

Issue 345893002: Implement an infrastructure of Blink-in-JS Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: Source/bindings/tests/results/V8TestBlinkInJSInterface.cpp
diff --git a/Source/bindings/tests/results/V8TestBlinkInJSInterface.cpp b/Source/bindings/tests/results/V8TestBlinkInJSInterface.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f042810752977569ea049a7244bae26b902f1ab7
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestBlinkInJSInterface.cpp
@@ -0,0 +1,253 @@
+// 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 "config.h"
+#include "V8TestBlinkInJSInterface.h"
+
+#include "bindings/core/v8/V8Window.h"
+#include "bindings/tests/v8/V8Document.h"
+#include "bindings/tests/v8/V8Node.h"
+#include "bindings/v8/BlinkInJSController.h"
+#include "core/dom/ScriptForbiddenScope.h"
+#include "core/frame/LocalFrame.h"
+
+namespace WebCore {
+
+bool V8TestBlinkInJSInterface::doNothing(LocalFrame* frame)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> *argv = 0;
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "doNothing", windowWrapper, 0, argv);
+ if (block.HasCaught())
+ return false;
+ return true;
+}
+
+bool V8TestBlinkInJSInterface::return123(LocalFrame* frame, int* output)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> *argv = 0;
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ v8::Handle<v8::Value> v8Value = BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "return123", windowWrapper, 0, argv);
+ if (block.HasCaught())
+ return false;
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "return123", "TestBlinkInJSInterface", scriptState->context()->Global(), scriptState->isolate());
+ int cppValue = toInt16(v8Value, exceptionState);
+ if (block.HasCaught())
+ return false;
+ *output = cppValue;
+ return true;
+}
+
+bool V8TestBlinkInJSInterface::echoInteger(LocalFrame* frame, int value, int* output)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
+ v8::Handle<v8::Value> argv[] = { valueHandle };
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ v8::Handle<v8::Value> v8Value = BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "echoInteger", windowWrapper, 1, argv);
+ if (block.HasCaught())
+ return false;
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "echoInteger", "TestBlinkInJSInterface", scriptState->context()->Global(), scriptState->isolate());
+ int cppValue = toInt16(v8Value, exceptionState);
+ if (block.HasCaught())
+ return false;
+ *output = cppValue;
+ return true;
+}
+
+bool V8TestBlinkInJSInterface::echoString(LocalFrame* frame, String value, String* output)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value);
+ v8::Handle<v8::Value> argv[] = { valueHandle };
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ v8::Handle<v8::Value> v8Value = BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "echoString", windowWrapper, 1, argv);
+ if (block.HasCaught())
+ return false;
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "echoString", "TestBlinkInJSInterface", scriptState->context()->Global(), scriptState->isolate());
+ V8StringResource<> cppValue = v8Value;
+ if (block.HasCaught())
+ return false;
+ *output = cppValue;
+ return true;
+}
+
+bool V8TestBlinkInJSInterface::echoNode(LocalFrame* frame, PassRefPtrWillBeRawPtr<Node> value, RefPtrWillBeRawPtr<Node>* output)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Global(), scriptState->isolate());
+ v8::Handle<v8::Value> argv[] = { valueHandle };
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ v8::Handle<v8::Value> v8Value = BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "echoNode", windowWrapper, 1, argv);
+ if (block.HasCaught())
+ return false;
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "echoNode", "TestBlinkInJSInterface", scriptState->context()->Global(), scriptState->isolate());
+ Node* cppValue = V8Node::toNativeWithTypeCheck(scriptState->isolate(), v8Value);
+ if (block.HasCaught())
+ return false;
+ *output = cppValue;
+ return true;
+}
+
+bool V8TestBlinkInJSInterface::addInteger(LocalFrame* frame, int value1, int value2, int* output)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(), value1);
+ v8::Handle<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate(), value2);
+ v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle };
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ v8::Handle<v8::Value> v8Value = BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "addInteger", windowWrapper, 2, argv);
+ if (block.HasCaught())
+ return false;
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "addInteger", "TestBlinkInJSInterface", scriptState->context()->Global(), scriptState->isolate());
+ int cppValue = toInt16(v8Value, exceptionState);
+ if (block.HasCaught())
+ return false;
+ *output = cppValue;
+ return true;
+}
+
+bool V8TestBlinkInJSInterface::addString(LocalFrame* frame, String value1, String value2, String* output)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> value1Handle = v8String(scriptState->isolate(), value1);
+ v8::Handle<v8::Value> value2Handle = v8String(scriptState->isolate(), value2);
+ v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle };
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ v8::Handle<v8::Value> v8Value = BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "addString", windowWrapper, 2, argv);
+ if (block.HasCaught())
+ return false;
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "addString", "TestBlinkInJSInterface", scriptState->context()->Global(), scriptState->isolate());
+ V8StringResource<> cppValue = v8Value;
+ if (block.HasCaught())
+ return false;
+ *output = cppValue;
+ return true;
+}
+
+bool V8TestBlinkInJSInterface::setIntegerToDocument(LocalFrame* frame, PassRefPtrWillBeRawPtr<Document> document, int value)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> documentHandle = toV8(document, scriptState->context()->Global(), scriptState->isolate());
+ v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
+ v8::Handle<v8::Value> argv[] = { documentHandle, valueHandle };
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "setIntegerToDocument", windowWrapper, 2, argv);
+ if (block.HasCaught())
+ return false;
+ return true;
+}
+
+bool V8TestBlinkInJSInterface::getIntegerFromDocument(LocalFrame* frame, PassRefPtrWillBeRawPtr<Document> document, int* output)
+{
+ v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::blinkInJSWorld());
+ if (context.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(context);
+ ScriptState::Scope scope(scriptState);
+ DOMWindow* window = scriptState->domWindow();
+ if (!window)
+ return false;
+ v8::Handle<v8::Value> windowWrapper = toV8(window, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> documentHandle = toV8(document, scriptState->context()->Global(), scriptState->isolate());
+ v8::Handle<v8::Value> argv[] = { documentHandle };
+ // FIXME: Support exceptions thrown from Blink-in-JS.
+ v8::TryCatch block;
+ v8::Handle<v8::Value> v8Value = BlinkInJSController::run(scriptState->isolate(), "TestBlinkInJSInterface", "getIntegerFromDocument", windowWrapper, 1, argv);
+ if (block.HasCaught())
+ return false;
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "getIntegerFromDocument", "TestBlinkInJSInterface", scriptState->context()->Global(), scriptState->isolate());
+ int cppValue = toInt16(v8Value, exceptionState);
+ if (block.HasCaught())
+ return false;
+ *output = cppValue;
+ return true;
+}
+
+} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698