| Index: Source/bindings/tests/results/V8TestPrivateScriptInterface.cpp
|
| diff --git a/Source/bindings/tests/results/V8TestPrivateScriptInterface.cpp b/Source/bindings/tests/results/V8TestPrivateScriptInterface.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f2c8ef083d380227239ec10e550a2bd285999765
|
| --- /dev/null
|
| +++ b/Source/bindings/tests/results/V8TestPrivateScriptInterface.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 "V8TestPrivateScriptInterface.h"
|
| +
|
| +#include "bindings/core/v8/V8Window.h"
|
| +#include "bindings/tests/v8/V8Document.h"
|
| +#include "bindings/tests/v8/V8Node.h"
|
| +#include "bindings/v8/PrivateScriptController.h"
|
| +#include "core/dom/ScriptForbiddenScope.h"
|
| +#include "core/frame/LocalFrame.h"
|
| +
|
| +namespace WebCore {
|
| +
|
| +bool V8TestPrivateScriptInterface::doNothing(LocalFrame* frame)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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;
|
| + PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "doNothing", windowWrapper, 0, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + return true;
|
| +}
|
| +
|
| +bool V8TestPrivateScriptInterface::return123(LocalFrame* frame, int* output)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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 = PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "return123", windowWrapper, 0, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + ExceptionState exceptionState(ExceptionState::ExecutionContext, "return123", "TestPrivateScriptInterface", scriptState->context()->Global(), scriptState->isolate());
|
| + int cppValue = toInt16(v8Value, exceptionState);
|
| + if (block.HasCaught())
|
| + return false;
|
| + *output = cppValue;
|
| + return true;
|
| +}
|
| +
|
| +bool V8TestPrivateScriptInterface::echoInteger(LocalFrame* frame, int value, int* output)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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 = PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "echoInteger", windowWrapper, 1, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + ExceptionState exceptionState(ExceptionState::ExecutionContext, "echoInteger", "TestPrivateScriptInterface", scriptState->context()->Global(), scriptState->isolate());
|
| + int cppValue = toInt16(v8Value, exceptionState);
|
| + if (block.HasCaught())
|
| + return false;
|
| + *output = cppValue;
|
| + return true;
|
| +}
|
| +
|
| +bool V8TestPrivateScriptInterface::echoString(LocalFrame* frame, String value, String* output)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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 = PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "echoString", windowWrapper, 1, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + ExceptionState exceptionState(ExceptionState::ExecutionContext, "echoString", "TestPrivateScriptInterface", scriptState->context()->Global(), scriptState->isolate());
|
| + V8StringResource<> cppValue = v8Value;
|
| + if (block.HasCaught())
|
| + return false;
|
| + *output = cppValue;
|
| + return true;
|
| +}
|
| +
|
| +bool V8TestPrivateScriptInterface::echoNode(LocalFrame* frame, PassRefPtrWillBeRawPtr<Node> value, RefPtrWillBeRawPtr<Node>* output)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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 = PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "echoNode", windowWrapper, 1, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + ExceptionState exceptionState(ExceptionState::ExecutionContext, "echoNode", "TestPrivateScriptInterface", scriptState->context()->Global(), scriptState->isolate());
|
| + Node* cppValue = V8Node::toNativeWithTypeCheck(scriptState->isolate(), v8Value);
|
| + if (block.HasCaught())
|
| + return false;
|
| + *output = cppValue;
|
| + return true;
|
| +}
|
| +
|
| +bool V8TestPrivateScriptInterface::addInteger(LocalFrame* frame, int value1, int value2, int* output)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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 = PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "addInteger", windowWrapper, 2, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + ExceptionState exceptionState(ExceptionState::ExecutionContext, "addInteger", "TestPrivateScriptInterface", scriptState->context()->Global(), scriptState->isolate());
|
| + int cppValue = toInt16(v8Value, exceptionState);
|
| + if (block.HasCaught())
|
| + return false;
|
| + *output = cppValue;
|
| + return true;
|
| +}
|
| +
|
| +bool V8TestPrivateScriptInterface::addString(LocalFrame* frame, String value1, String value2, String* output)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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 = PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "addString", windowWrapper, 2, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + ExceptionState exceptionState(ExceptionState::ExecutionContext, "addString", "TestPrivateScriptInterface", scriptState->context()->Global(), scriptState->isolate());
|
| + V8StringResource<> cppValue = v8Value;
|
| + if (block.HasCaught())
|
| + return false;
|
| + *output = cppValue;
|
| + return true;
|
| +}
|
| +
|
| +bool V8TestPrivateScriptInterface::setIntegerToDocument(LocalFrame* frame, PassRefPtrWillBeRawPtr<Document> document, int value)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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;
|
| + PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "setIntegerToDocument", windowWrapper, 2, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + return true;
|
| +}
|
| +
|
| +bool V8TestPrivateScriptInterface::getIntegerFromDocument(LocalFrame* frame, PassRefPtrWillBeRawPtr<Document> document, int* output)
|
| +{
|
| + v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privateScriptWorld());
|
| + if (context.IsEmpty())
|
| + return false;
|
| + ScriptState* scriptState = ScriptState::from(context);
|
| + ScriptState::Scope scope(scriptState);
|
| + LocalDOMWindow* 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 = PrivateScriptController::run(scriptState->isolate(), "TestPrivateScriptInterface", "getIntegerFromDocument", windowWrapper, 1, argv);
|
| + if (block.HasCaught())
|
| + return false;
|
| + ExceptionState exceptionState(ExceptionState::ExecutionContext, "getIntegerFromDocument", "TestPrivateScriptInterface", scriptState->context()->Global(), scriptState->isolate());
|
| + int cppValue = toInt16(v8Value, exceptionState);
|
| + if (block.HasCaught())
|
| + return false;
|
| + *output = cppValue;
|
| + return true;
|
| +}
|
| +
|
| +} // namespace WebCore
|
|
|