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

Unified Diff: Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp

Issue 618373003: [bindings] partial interfaces should not violate componentization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed patch conflict Created 6 years, 2 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
« no previous file with comments | « Source/bindings/tests/results/modules/V8TestInterfacePartial.h ('k') | Source/core/core.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
diff --git a/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp b/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6e9268415c10c8db320aa84a42cb30f799f0cfb1
--- /dev/null
+++ b/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
@@ -0,0 +1,247 @@
+// 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"
+#if ENABLE(CONDITION)
+#include "V8TestInterfacePartial.h"
+
+#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/PrivateScriptRunner.h"
+#include "bindings/core/v8/ScriptValue.h"
+#include "bindings/core/v8/V8DOMConfiguration.h"
+#include "bindings/core/v8/V8HiddenValue.h"
+#include "bindings/core/v8/V8Node.h"
+#include "bindings/core/v8/V8ObjectConstructor.h"
+#include "bindings/core/v8/V8TestInterface.h"
+#include "bindings/core/v8/V8TestInterfaceEmpty.h"
+#include "bindings/tests/idls/modules/TestPartialInterfaceImplementation3.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "core/frame/LocalFrame.h"
+#include "platform/RuntimeEnabledFeatures.h"
+#include "platform/ScriptForbiddenScope.h"
+#include "platform/TraceEvent.h"
+#include "wtf/GetPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace blink {
+
+namespace TestInterfaceImplementationPartialV8Internal {
+
+static void voidMethodPartialOverload3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
+ V8StringResource<> value;
+ {
+ TOSTRING_VOID_INTERNAL(value, info[0]);
+ }
+ TestPartialInterfaceImplementation3::voidMethodPartialOverload(*impl, value);
+}
+
+static void voidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodPartialOverload", "TestInterface", info.Holder(), info.GetIsolate());
+ switch (std::min(1, info.Length())) {
+ case 0:
+ break;
+ case 1:
+ if (true) {
+ voidMethodPartialOverload3Method(info);
+ return;
+ }
+ break;
+ default:
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length()));
+ exceptionState.throwIfNeeded();
+ return;
+ }
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
+}
+
+static void staticVoidMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ V8StringResource<> value;
+ {
+ TOSTRING_VOID_INTERNAL(value, info[0]);
+ }
+ TestPartialInterfaceImplementation3::staticVoidMethodPartialOverload(value);
+}
+
+static void staticVoidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "staticVoidMethodPartialOverload", "TestInterface", info.Holder(), info.GetIsolate());
+ switch (std::min(1, info.Length())) {
+ case 0:
+ break;
+ case 1:
+ if (true) {
+ staticVoidMethodPartialOverload2Method(info);
+ return;
+ }
+ break;
+ default:
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length()));
+ exceptionState.throwIfNeeded();
+ return;
+ }
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
+}
+
+static void partial2VoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
+ V8StringResource<> value;
+ {
+ TOSTRING_VOID_INTERNAL(value, info[0]);
+ }
+ TestPartialInterfaceImplementation3::partial2VoidMethod(*impl, value);
+}
+
+static void partial2VoidMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
+ Node* node;
+ {
+ if (info.Length() > 0 && !V8Node::hasInstance(info[0], info.GetIsolate())) {
+ V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("partial2VoidMethod", "TestInterface", "parameter 1 is not of type 'Node'."), info.GetIsolate());
+ return;
+ }
+ node = V8Node::toImpl(v8::Handle<v8::Object>::Cast(info[0]));
+ }
+ TestPartialInterfaceImplementation3::partial2VoidMethod(*impl, node);
+}
+
+static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "partial2VoidMethod", "TestInterface", info.Holder(), info.GetIsolate());
+ switch (std::min(1, info.Length())) {
+ case 0:
+ break;
+ case 1:
+ if (V8Node::hasInstance(info[0], info.GetIsolate())) {
+ partial2VoidMethod3Method(info);
+ return;
+ }
+ if (true) {
+ partial2VoidMethod2Method(info);
+ return;
+ }
+ break;
+ default:
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length()));
+ exceptionState.throwIfNeeded();
+ return;
+ }
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
+}
+
+static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ V8StringResource<> value;
+ {
+ TOSTRING_VOID_INTERNAL(value, info[0]);
+ }
+ TestPartialInterfaceImplementation3::partial2StaticVoidMethod(value);
+}
+
+static void partial2StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "partial2StaticVoidMethod", "TestInterface", info.Holder(), info.GetIsolate());
+ switch (std::min(1, info.Length())) {
+ case 0:
+ break;
+ case 1:
+ if (true) {
+ partial2StaticVoidMethod2Method(info);
+ return;
+ }
+ break;
+ default:
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length()));
+ exceptionState.throwIfNeeded();
+ return;
+ }
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
+}
+
+} // namespace TestInterfaceImplementationPartialV8Internal
+
+void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
+{
+ V8TestInterface::installV8TestInterfaceTemplate(functionTemplate, isolate);
+
+ v8::Local<v8::Signature> defaultSignature;
+ if (!RuntimeEnabledFeatures::featureNameEnabled())
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", v8::Local<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate);
+ else
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ isolate);
+ v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
+ ALLOW_UNUSED_LOCAL(instanceTemplate);
+ v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
+ ALLOW_UNUSED_LOCAL(prototypeTemplate);
+ static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConstants[] = {
+ {"PARTIAL3_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort},
+ };
+ V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate);
+ functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterface::legacyCallCustom);
+}
+
+void V8TestInterfacePartial::installConditionallyEnabledMethods(v8::Handle<v8::Object> prototypeObject, v8::Isolate* isolate)
+{
+ V8TestInterface::installConditionallyEnabledMethods(prototypeObject, isolate);
+}
+
+bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPrivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int* result)
+{
+ if (!frame)
+ return false;
+ v8::HandleScope handleScope(toIsolate(frame));
+ ScriptForbiddenScope::AllowUserAgentScript script;
+ v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld());
+ if (contextInPrivateScript.IsEmpty())
+ return false;
+ ScriptState* scriptState = ScriptState::from(contextInPrivateScript);
+ ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame);
+ if (!scriptState->executionContext())
+ return false;
+
+ ScriptState::Scope scope(scriptState);
+ v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate());
+
+ v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
+ v8::Handle<v8::Value> argv[] = { valueHandle };
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethodWithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState->isolate());
+ v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "TestInterfaceImplementation", "shortMethodWithShortArgumentImplementedInPrivateScript", holder, 1, argv);
+ if (v8Value.IsEmpty())
+ return false;
+ TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState, false);
+ *result = cppValue;
+ RELEASE_ASSERT(!exceptionState.hadException());
+ return true;
+}
+
+void V8TestInterfacePartial::initialize()
+{
+ // Should be invoked from initModules.
+ V8TestInterface::updateWrapperTypeInfo(
+ &V8TestInterfacePartial::installV8TestInterfaceTemplate,
+ &V8TestInterfacePartial::installConditionallyEnabledMethods);
+ V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface(&TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod);
+ V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInterface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOverloadMethod);
+ V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestInterfaceImplementationPartialV8Internal::partial2VoidMethodMethod);
+ V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(&TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod);
+}
+
+} // namespace blink
+#endif // ENABLE(CONDITION)
« no previous file with comments | « Source/bindings/tests/results/modules/V8TestInterfacePartial.h ('k') | Source/core/core.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698