Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..09911b835274ea899e335272545e3f22962f07d9 |
--- /dev/null |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp |
@@ -0,0 +1,294 @@ |
+// 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 "V8TestInterfaceOriginTrialEnabled.h" |
+ |
+#include "bindings/core/v8/ExceptionState.h" |
+#include "bindings/core/v8/V8DOMConfiguration.h" |
+#include "bindings/core/v8/V8ObjectConstructor.h" |
+#include "core/dom/Document.h" |
+#include "core/inspector/ConsoleMessage.h" |
+#include "core/origin_trials/OriginTrials.h" |
+#include "platform/RuntimeEnabledFeatures.h" |
+#include "wtf/GetPtr.h" |
+#include "wtf/RefPtr.h" |
+ |
+namespace blink { |
+ |
+// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial |
+// and does not depend on another global objects. |
+#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
+#pragma clang diagnostic push |
+#pragma clang diagnostic ignored "-Wglobal-constructors" |
+#endif |
+const WrapperTypeInfo V8TestInterfaceOriginTrialEnabled::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceOriginTrialEnabled::domTemplate, V8TestInterfaceOriginTrialEnabled::refObject, V8TestInterfaceOriginTrialEnabled::derefObject, V8TestInterfaceOriginTrialEnabled::trace, 0, 0, V8TestInterfaceOriginTrialEnabled::preparePrototypeAndInterfaceObject, V8TestInterfaceOriginTrialEnabled::installConditionallyEnabledProperties, "TestInterfaceOriginTrialEnabled", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject }; |
+#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
+#pragma clang diagnostic pop |
+#endif |
+ |
+// This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfaceOriginTrialEnabled.h. |
+// For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
+// bindings/core/v8/ScriptWrappable.h. |
+const WrapperTypeInfo& TestInterfaceOriginTrialEnabled::s_wrapperTypeInfo = V8TestInterfaceOriginTrialEnabled::wrapperTypeInfo; |
+ |
+namespace TestInterfaceOriginTrialEnabledV8Internal { |
+ |
+static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder); |
+ v8SetReturnValue(info, impl->doubleAttribute()); |
+} |
+ |
+static void doubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterfaceOriginTrialEnabledV8Internal::doubleAttributeAttributeGetter(info); |
+} |
+ |
+static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestInterfaceOriginTrialEnabled", holder, info.GetIsolate()); |
+ TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder); |
+ double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ impl->setDoubleAttribute(cppValue); |
+} |
+ |
+static void doubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Value> v8Value = info[0]; |
+ TestInterfaceOriginTrialEnabledV8Internal::doubleAttributeAttributeSetter(v8Value, info); |
+} |
+ |
+static void conditionalLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->conditionalLongAttribute()); |
+} |
+ |
+static void conditionalLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterfaceOriginTrialEnabledV8Internal::conditionalLongAttributeAttributeGetter(info); |
+} |
+ |
+static void conditionalLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalLongAttribute", "TestInterfaceOriginTrialEnabled", holder, info.GetIsolate()); |
+ TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder); |
+ int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ impl->setConditionalLongAttribute(cppValue); |
+} |
+ |
+static void conditionalLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Value> v8Value = info[0]; |
+ TestInterfaceOriginTrialEnabledV8Internal::conditionalLongAttributeAttributeSetter(v8Value, info); |
+} |
+ |
+static void conditionalReadOnlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->conditionalReadOnlyLongAttribute()); |
+} |
+ |
+static void conditionalReadOnlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterfaceOriginTrialEnabledV8Internal::conditionalReadOnlyLongAttributeAttributeGetter(info); |
+} |
+ |
+static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8SetReturnValueString(info, TestInterfaceOriginTrialEnabled::staticStringAttribute(), info.GetIsolate()); |
+} |
+ |
+static void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterfaceOriginTrialEnabledV8Internal::staticStringAttributeAttributeGetter(info); |
+} |
+ |
+static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ V8StringResource<> cppValue = v8Value; |
+ if (!cppValue.prepare()) |
+ return; |
+ TestInterfaceOriginTrialEnabled::setStaticStringAttribute(cppValue); |
+} |
+ |
+static void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Value> v8Value = info[0]; |
+ TestInterfaceOriginTrialEnabledV8Internal::staticStringAttributeAttributeSetter(v8Value, info); |
+} |
+ |
+static void staticConditionalReadOnlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8SetReturnValueInt(info, TestInterfaceOriginTrialEnabled::staticConditionalReadOnlyLongAttribute()); |
+} |
+ |
+static void staticConditionalReadOnlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterfaceOriginTrialEnabledV8Internal::staticConditionalReadOnlyLongAttributeAttributeGetter(info); |
+} |
+ |
+static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleArgFloatArg", "TestInterfaceOriginTrialEnabled", info.Holder(), info.GetIsolate()); |
+ if (UNLIKELY(info.Length() < 2)) { |
+ setMinimumArityTypeError(exceptionState, 2, info.Length()); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(info.Holder()); |
+ double doubleArg; |
+ float floatArg; |
+ { |
+ doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ } |
+ impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); |
+} |
+ |
+static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterfaceOriginTrialEnabledV8Internal::voidMethodDoubleArgFloatArgMethod(info); |
+} |
+ |
+static void voidMethodPartialOverload1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(info.Holder()); |
+ impl->voidMethodPartialOverload(); |
+} |
+ |
+static void voidMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodPartialOverload", "TestInterfaceOriginTrialEnabled", info.Holder(), info.GetIsolate()); |
+ TestInterfaceOriginTrialEnabled* impl = V8TestInterfaceOriginTrialEnabled::toImpl(info.Holder()); |
+ double doubleArg; |
+ { |
+ doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ } |
+ impl->voidMethodPartialOverload(doubleArg); |
+} |
+ |
+static void voidMethodPartialOverloadMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodPartialOverload", "TestInterfaceOriginTrialEnabled", info.Holder(), info.GetIsolate()); |
+ switch (std::min(1, info.Length())) { |
+ case 0: |
+ if (true) { |
+ voidMethodPartialOverload1Method(info); |
+ return; |
+ } |
+ break; |
+ case 1: |
+ if (true) { |
+ voidMethodPartialOverload2Method(info); |
+ return; |
+ } |
+ break; |
+ default: |
+ break; |
+ } |
+ exceptionState.throwTypeError("No function was found that matched the signature provided."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+} |
+ |
+static void voidMethodPartialOverloadMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestInterfaceOriginTrialEnabledV8Internal::voidMethodPartialOverloadMethod(info); |
+} |
+ |
+} // namespace TestInterfaceOriginTrialEnabledV8Internal |
+ |
+const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceOriginTrialEnabledAccessors[] = { |
+ {"doubleAttribute", TestInterfaceOriginTrialEnabledV8Internal::doubleAttributeAttributeGetterCallback, TestInterfaceOriginTrialEnabledV8Internal::doubleAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
+ {"staticStringAttribute", TestInterfaceOriginTrialEnabledV8Internal::staticStringAttributeAttributeGetterCallback, TestInterfaceOriginTrialEnabledV8Internal::staticStringAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInterface, V8DOMConfiguration::CheckHolder}, |
+}; |
+ |
+const V8DOMConfiguration::MethodConfiguration V8TestInterfaceOriginTrialEnabledMethods[] = { |
+ {"voidMethodDoubleArgFloatArg", TestInterfaceOriginTrialEnabledV8Internal::voidMethodDoubleArgFloatArgMethodCallback, 0, 2, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
+ {"voidMethodPartialOverload", TestInterfaceOriginTrialEnabledV8Internal::voidMethodPartialOverloadMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
+}; |
+ |
+static void installV8TestInterfaceOriginTrialEnabledTemplate(v8::Local<v8::FunctionTemplate> interfaceTemplate, v8::Isolate* isolate) |
+{ |
+ // Initialize the interface object's template. |
+ V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestInterfaceOriginTrialEnabled::wrapperTypeInfo.interfaceName, v8::Local<v8::FunctionTemplate>(), V8TestInterfaceOriginTrialEnabled::internalFieldCount); |
+ v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate); |
+ ALLOW_UNUSED_LOCAL(signature); |
+ v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate(); |
+ ALLOW_UNUSED_LOCAL(instanceTemplate); |
+ v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate(); |
+ ALLOW_UNUSED_LOCAL(prototypeTemplate); |
+ // Register DOM constants, attributes and operations. |
+ const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceOriginTrialEnabledConstants[] = { |
+ {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong}, |
+ {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort}, |
+ }; |
+ V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototypeTemplate, V8TestInterfaceOriginTrialEnabledConstants, WTF_ARRAY_LENGTH(V8TestInterfaceOriginTrialEnabledConstants)); |
+ static_assert(0 == TestInterfaceOriginTrialEnabled::UNSIGNED_LONG, "the value of TestInterfaceOriginTrialEnabled_UNSIGNED_LONG does not match with implementation"); |
+ static_assert(1 == TestInterfaceOriginTrialEnabled::CONST_JAVASCRIPT, "the value of TestInterfaceOriginTrialEnabled_CONST_JAVASCRIPT does not match with implementation"); |
+ V8DOMConfiguration::installAccessors(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterfaceOriginTrialEnabledAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceOriginTrialEnabledAccessors)); |
+ V8DOMConfiguration::installMethods(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterfaceOriginTrialEnabledMethods, WTF_ARRAY_LENGTH(V8TestInterfaceOriginTrialEnabledMethods)); |
+ |
+ if (RuntimeEnabledFeatures::featureNameEnabled()) { |
+ const V8DOMConfiguration::AccessorConfiguration accessorconditionalReadOnlyLongAttributeConfiguration = \ |
+ {"conditionalReadOnlyLongAttribute", TestInterfaceOriginTrialEnabledV8Internal::conditionalReadOnlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
+ V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, accessorconditionalReadOnlyLongAttributeConfiguration); |
+ const V8DOMConfiguration::AccessorConfiguration accessorstaticConditionalReadOnlyLongAttributeConfiguration = \ |
+ {"staticConditionalReadOnlyLongAttribute", TestInterfaceOriginTrialEnabledV8Internal::staticConditionalReadOnlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInterface, V8DOMConfiguration::CheckHolder}; |
+ V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, accessorstaticConditionalReadOnlyLongAttributeConfiguration); |
+ const V8DOMConfiguration::AccessorConfiguration accessorconditionalLongAttributeConfiguration = \ |
+ {"conditionalLongAttribute", TestInterfaceOriginTrialEnabledV8Internal::conditionalLongAttributeAttributeGetterCallback, TestInterfaceOriginTrialEnabledV8Internal::conditionalLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
+ V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, accessorconditionalLongAttributeConfiguration); |
+ } |
+} |
+ |
+v8::Local<v8::FunctionTemplate> V8TestInterfaceOriginTrialEnabled::domTemplate(v8::Isolate* isolate) |
+{ |
+ return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceOriginTrialEnabledTemplate); |
+} |
+ |
+bool V8TestInterfaceOriginTrialEnabled::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) |
+{ |
+ return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); |
+} |
+ |
+v8::Local<v8::Object> V8TestInterfaceOriginTrialEnabled::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) |
+{ |
+ return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); |
+} |
+ |
+TestInterfaceOriginTrialEnabled* V8TestInterfaceOriginTrialEnabled::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) |
+{ |
+ return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0; |
+} |
+ |
+void V8TestInterfaceOriginTrialEnabled::refObject(ScriptWrappable* scriptWrappable) |
+{ |
+ scriptWrappable->toImpl<TestInterfaceOriginTrialEnabled>()->ref(); |
+} |
+ |
+void V8TestInterfaceOriginTrialEnabled::derefObject(ScriptWrappable* scriptWrappable) |
+{ |
+ scriptWrappable->toImpl<TestInterfaceOriginTrialEnabled>()->deref(); |
+} |
+ |
+} // namespace blink |