Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface4.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface4.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface4.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e8db0c176da7c4725cc66512cde85157dbf08dd9 |
--- /dev/null |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface4.cpp |
@@ -0,0 +1,209 @@ |
+// 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 "V8TestInterface4.h" |
+ |
+#include "bindings/core/v8/ExceptionState.h" |
+#include "bindings/core/v8/ScriptState.h" |
+#include "bindings/core/v8/V8DOMConfiguration.h" |
+#include "bindings/core/v8/V8Document.h" |
+#include "bindings/core/v8/V8Iterator.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 V8TestInterface4::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface4::domTemplate, V8TestInterface4::refObject, V8TestInterface4::derefObject, V8TestInterface4::trace, 0, 0, V8TestInterface4::preparePrototypeAndInterfaceObject, V8TestInterface4::installConditionallyEnabledProperties, "TestInterface4", 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 TestInterface4.h. |
+// For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
+// bindings/core/v8/ScriptWrappable.h. |
+const WrapperTypeInfo& TestInterface4::s_wrapperTypeInfo = V8TestInterface4::wrapperTypeInfo; |
+ |
+namespace TestInterface4V8Internal { |
+ |
+static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ if (UNLIKELY(info.Length() < 1)) { |
+ V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "voidMethodDocument", "TestInterface4", 1, info.Length()), info.GetIsolate()); |
+ return; |
+ } |
+ TestInterface4* impl = V8TestInterface4::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"); |
+ TestInterface4V8Internal::voidMethodDocumentMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface4", info.Holder(), info.GetIsolate()); |
+ TestInterface4* impl = V8TestInterface4::toImpl(info.Holder()); |
+ ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
+ RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState); |
+ if (exceptionState.hadException()) { |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ v8SetReturnValue(info, result.release()); |
+} |
+ |
+static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestInterface4V8Internal::iteratorMethod(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"); |
+ V8TestInterface4::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"); |
+ V8TestInterface4::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"); |
+ V8TestInterface4::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"); |
+ V8TestInterface4::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"); |
+ V8TestInterface4::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"); |
+ V8TestInterface4::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"); |
+ V8TestInterface4::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"); |
+ V8TestInterface4::namedPropertyEnumeratorCustom(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+} // namespace TestInterface4V8Internal |
+ |
+const V8DOMConfiguration::MethodConfiguration V8TestInterface4Methods[] = { |
+ {"voidMethodDocument", TestInterface4V8Internal::voidMethodDocumentMethodCallback, 0, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
+}; |
+ |
+static void installV8TestInterface4Template(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) |
+{ |
+ functionTemplate->ReadOnlyPrototype(); |
+ |
+ v8::Local<v8::Signature> defaultSignature; |
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface4", v8::Local<v8::FunctionTemplate>(), V8TestInterface4::internalFieldCount, |
+ 0, 0, |
+ 0, 0, |
+ V8TestInterface4Methods, WTF_ARRAY_LENGTH(V8TestInterface4Methods)); |
+ v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate(); |
+ ALLOW_UNUSED_LOCAL(instanceTemplate); |
+ v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate(); |
+ ALLOW_UNUSED_LOCAL(prototypeTemplate); |
+ { |
+ v8::IndexedPropertyHandlerConfiguration config(TestInterface4V8Internal::indexedPropertyGetterCallback, TestInterface4V8Internal::indexedPropertySetterCallback, 0, TestInterface4V8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterface4>); |
+ functionTemplate->InstanceTemplate()->SetHandler(config); |
+ } |
+ { |
+ int flags = static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStrings); |
+ flags |= static_cast<int>(v8::PropertyHandlerFlags::kNonMasking); |
+ v8::NamedPropertyHandlerConfiguration config(TestInterface4V8Internal::namedPropertyGetterCallback, TestInterface4V8Internal::namedPropertySetterCallback, TestInterface4V8Internal::namedPropertyQueryCallback, TestInterface4V8Internal::namedPropertyDeleterCallback, TestInterface4V8Internal::namedPropertyEnumeratorCallback, v8::Handle<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(flags)); |
+ functionTemplate->InstanceTemplate()->SetHandler(config); |
+ } |
+ if (RuntimeEnabledFeatures::featureNameEnabled()) { |
+ const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, TestInterface4V8Internal::iteratorMethodCallback, 0, v8::DontDelete, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype }; |
+ V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignature, symbolKeyedIteratorConfiguration); |
+ } |
+ |
+ // Custom toString template |
+ functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate()); |
+} |
+ |
+v8::Local<v8::FunctionTemplate> V8TestInterface4::domTemplate(v8::Isolate* isolate) |
+{ |
+ return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterface4Template); |
+} |
+ |
+bool V8TestInterface4::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) |
+{ |
+ return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); |
+} |
+ |
+v8::Local<v8::Object> V8TestInterface4::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) |
+{ |
+ return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); |
+} |
+ |
+TestInterface4* V8TestInterface4::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) |
+{ |
+ return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0; |
+} |
+ |
+void V8TestInterface4::refObject(ScriptWrappable* scriptWrappable) |
+{ |
+ scriptWrappable->toImpl<TestInterface4>()->ref(); |
+} |
+ |
+void V8TestInterface4::derefObject(ScriptWrappable* scriptWrappable) |
+{ |
+ scriptWrappable->toImpl<TestInterface4>()->deref(); |
+} |
+ |
+} // namespace blink |