Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f2c6eab79a9cc6d28c679fa49827c4166f3f5727 |
--- /dev/null |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp |
@@ -0,0 +1,232 @@ |
+// 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 "V8TestIntegerIndexedPrimaryGlobal.h" |
+ |
+#include "bindings/core/v8/ExceptionState.h" |
+#include "bindings/core/v8/V8DOMConfiguration.h" |
+#include "bindings/core/v8/V8Document.h" |
+#include "bindings/core/v8/V8Node.h" |
+#include "bindings/core/v8/V8ObjectConstructor.h" |
+#include "core/dom/ContextFeatures.h" |
+#include "core/dom/Document.h" |
+#include "platform/RuntimeEnabledFeatures.h" |
+#include "platform/TraceEvent.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 V8TestIntegerIndexedPrimaryGlobal::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestIntegerIndexedPrimaryGlobal::domTemplate, V8TestIntegerIndexedPrimaryGlobal::refObject, V8TestIntegerIndexedPrimaryGlobal::derefObject, V8TestIntegerIndexedPrimaryGlobal::trace, 0, 0, V8TestIntegerIndexedPrimaryGlobal::preparePrototypeAndInterfaceObject, V8TestIntegerIndexedPrimaryGlobal::installConditionallyEnabledProperties, "TestIntegerIndexedPrimaryGlobal", 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 TestIntegerIndexedPrimaryGlobal.h. |
+// For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
+// bindings/core/v8/ScriptWrappable.h. |
+const WrapperTypeInfo& TestIntegerIndexedPrimaryGlobal::s_wrapperTypeInfo = V8TestIntegerIndexedPrimaryGlobal::wrapperTypeInfo; |
+ |
+namespace TestIntegerIndexedPrimaryGlobalV8Internal { |
+ |
+static void lengthAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ TestIntegerIndexedPrimaryGlobal* impl = V8TestIntegerIndexedPrimaryGlobal::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->length()); |
+} |
+ |
+static void lengthAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestIntegerIndexedPrimaryGlobalV8Internal::lengthAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void lengthAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "length", "TestIntegerIndexedPrimaryGlobal", holder, info.GetIsolate()); |
+ TestIntegerIndexedPrimaryGlobal* impl = V8TestIntegerIndexedPrimaryGlobal::toImpl(holder); |
+ int cppValue = toInt8(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ impl->setLength(cppValue); |
+} |
+ |
+static void lengthAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Value> v8Value = info[0]; |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestIntegerIndexedPrimaryGlobalV8Internal::lengthAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ if (UNLIKELY(info.Length() < 1)) { |
+ V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "voidMethodDocument", "TestIntegerIndexedPrimaryGlobal", 1, info.Length()), info.GetIsolate()); |
+ return; |
+ } |
+ TestIntegerIndexedPrimaryGlobal* impl = V8TestIntegerIndexedPrimaryGlobal::toImpl(info.Holder()); |
+ Document* document; |
+ { |
+ document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]); |
+ } |
+ impl->voidMethodDocument(document); |
+} |
+ |
+static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestIntegerIndexedPrimaryGlobalV8Internal::voidMethodDocumentMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); |
+ V8TestIntegerIndexedPrimaryGlobal::indexedPropertyGetterCustom(index, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); |
+ V8TestIntegerIndexedPrimaryGlobal::indexedPropertySetterCustom(index, v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); |
+ V8TestIntegerIndexedPrimaryGlobal::indexedPropertyDeleterCustom(index, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ V8TestIntegerIndexedPrimaryGlobal::namedPropertyGetterCustom(name, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ V8TestIntegerIndexedPrimaryGlobal::namedPropertySetterCustom(name, v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ V8TestIntegerIndexedPrimaryGlobal::namedPropertyQueryCustom(name, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Boolean>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ V8TestIntegerIndexedPrimaryGlobal::namedPropertyDeleterCustom(name, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); |
+ V8TestIntegerIndexedPrimaryGlobal::namedPropertyEnumeratorCustom(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+} // namespace TestIntegerIndexedPrimaryGlobalV8Internal |
+ |
+const V8DOMConfiguration::AccessorConfiguration V8TestIntegerIndexedPrimaryGlobalAccessors[] = { |
+ {"length", TestIntegerIndexedPrimaryGlobalV8Internal::lengthAttributeGetterCallback, TestIntegerIndexedPrimaryGlobalV8Internal::lengthAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::CheckHolder}, |
+}; |
+ |
+const V8DOMConfiguration::MethodConfiguration V8TestIntegerIndexedPrimaryGlobalMethods[] = { |
+ {"voidMethodDocument", TestIntegerIndexedPrimaryGlobalV8Internal::voidMethodDocumentMethodCallback, 0, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, |
+}; |
+ |
+static void installV8TestIntegerIndexedPrimaryGlobalTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) |
+{ |
+ functionTemplate->ReadOnlyPrototype(); |
+ |
+ v8::Local<v8::Signature> defaultSignature; |
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestIntegerIndexedPrimaryGlobal", V8TestIntegerIndexedPrimaryGlobal::domTemplateForNamedPropertiesObject(isolate), V8TestIntegerIndexedPrimaryGlobal::internalFieldCount, |
+ 0, 0, |
+ V8TestIntegerIndexedPrimaryGlobalAccessors, WTF_ARRAY_LENGTH(V8TestIntegerIndexedPrimaryGlobalAccessors), |
+ V8TestIntegerIndexedPrimaryGlobalMethods, WTF_ARRAY_LENGTH(V8TestIntegerIndexedPrimaryGlobalMethods)); |
+ v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate(); |
+ ALLOW_UNUSED_LOCAL(instanceTemplate); |
+ v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate(); |
+ ALLOW_UNUSED_LOCAL(prototypeTemplate); |
+ if (RuntimeEnabledFeatures::iterableCollectionsEnabled()) { |
+ instanceTemplate->SetIntrinsicDataProperty(v8::Symbol::GetIterator(isolate), v8::kArrayProto_values, v8::DontEnum); |
+ } |
+ v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestIntegerIndexedPrimaryGlobalV8Internal::indexedPropertyGetterCallback, TestIntegerIndexedPrimaryGlobalV8Internal::indexedPropertySetterCallback, 0, TestIntegerIndexedPrimaryGlobalV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestIntegerIndexedPrimaryGlobal>, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNone); |
+ instanceTemplate->SetHandler(indexedPropertyHandlerConfig); |
+ functionTemplate->SetHiddenPrototype(true); |
+ |
+ // Custom toString template |
+ functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate()); |
+} |
+ |
+v8::Local<v8::FunctionTemplate> V8TestIntegerIndexedPrimaryGlobal::domTemplate(v8::Isolate* isolate) |
+{ |
+ return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestIntegerIndexedPrimaryGlobalTemplate); |
+} |
+ |
+v8::Local<v8::FunctionTemplate> V8TestIntegerIndexedPrimaryGlobal::domTemplateForNamedPropertiesObject(v8::Isolate* isolate) |
+{ |
+ v8::Local<v8::FunctionTemplate> parentTemplate = V8None::domTemplate(isolate); |
+ |
+ v8::Local<v8::FunctionTemplate> namedPropertiesObjectFunctionTemplate = v8::FunctionTemplate::New(isolate); |
+ namedPropertiesObjectFunctionTemplate->SetClassName(v8AtomicString(isolate, "TestIntegerIndexedPrimaryGlobalProperties")); |
+ namedPropertiesObjectFunctionTemplate->Inherit(parentTemplate); |
+ |
+ v8::Local<v8::ObjectTemplate> namedPropertiesObjectTemplate = namedPropertiesObjectFunctionTemplate->PrototypeTemplate(); |
+ namedPropertiesObjectTemplate->SetInternalFieldCount(V8TestIntegerIndexedPrimaryGlobal::internalFieldCount); |
+ v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestIntegerIndexedPrimaryGlobalV8Internal::namedPropertyGetterCallback, TestIntegerIndexedPrimaryGlobalV8Internal::namedPropertySetterCallback, TestIntegerIndexedPrimaryGlobalV8Internal::namedPropertyQueryCallback, TestIntegerIndexedPrimaryGlobalV8Internal::namedPropertyDeleterCallback, TestIntegerIndexedPrimaryGlobalV8Internal::namedPropertyEnumeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(int(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::PropertyHandlerFlags::kNonMasking))); |
+ namedPropertiesObjectTemplate->SetHandler(namedPropertyHandlerConfig); |
+ |
+ return namedPropertiesObjectFunctionTemplate; |
+} |
+ |
+bool V8TestIntegerIndexedPrimaryGlobal::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) |
+{ |
+ return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); |
+} |
+ |
+v8::Local<v8::Object> V8TestIntegerIndexedPrimaryGlobal::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) |
+{ |
+ return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); |
+} |
+ |
+TestIntegerIndexedPrimaryGlobal* V8TestIntegerIndexedPrimaryGlobal::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) |
+{ |
+ return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0; |
+} |
+ |
+void V8TestIntegerIndexedPrimaryGlobal::refObject(ScriptWrappable* scriptWrappable) |
+{ |
+ scriptWrappable->toImpl<TestIntegerIndexedPrimaryGlobal>()->ref(); |
+} |
+ |
+void V8TestIntegerIndexedPrimaryGlobal::derefObject(ScriptWrappable* scriptWrappable) |
+{ |
+ scriptWrappable->toImpl<TestIntegerIndexedPrimaryGlobal>()->deref(); |
+} |
+ |
+} // namespace blink |