1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
8 #include "V8TestInterfaceEventConstructor.h"
10 #include "bindings/core/v8/Dictionary.h"
11 #include "bindings/core/v8/ExceptionState.h"
12 #include "bindings/core/v8/ScriptValue.h"
13 #include "bindings/core/v8/SerializedScriptValue.h"
14 #include "bindings/core/v8/V8DOMConfiguration.h"
15 #include "bindings/core/v8/V8HiddenValue.h"
16 #include "bindings/core/v8/V8ObjectConstructor.h"
17 #include "bindings/core/v8/V8TestInterfaceEmpty.h"
18 #include "bindings/core/v8/V8Uint8Array.h"
19 #include "core/dom/ContextFeatures.h"
20 #include "core/dom/Document.h"
21 #include "core/frame/LocalDOMWindow.h"
22 #include "core/frame/UseCounter.h"
23 #include "platform/RuntimeEnabledFeatures.h"
24 #include "platform/TraceEvent.h"
25 #include "wtf/GetPtr.h"
26 #include "wtf/RefPtr.h"
30 const WrapperTypeInfo V8TestInterfaceEventConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEventConstructor::domTemplate, V8TestInterfaceEventConstructor::refObject, V8TestInterfaceEventConstructor::derefObject, V8TestInterfaceEventConstructor::trace, 0, 0, 0, V8TestInterfaceEventConstructor::installConditionallyEnabledMethods, V8TestInterfaceEventConstructor::installConditionallyEnabledProperties, &V8Event::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independent, WrapperTypeInfo::WillBeGarbageCollectedObject };
32 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfaceEventConstructor.h.
33 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
34 // bindings/core/v8/ScriptWrappable.h.
35 const WrapperTypeInfo& TestInterfaceEventConstructor::s_wrapperTypeInfo = V8TestInterfaceEventConstructor::wrapperTypeInfo;
37 namespace TestInterfaceEventConstructorV8Internal {
39 static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
41 v8::Handle<v8::Object> holder = info.Holder();
42 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
43 v8SetReturnValueString(info, impl->readonlyStringAttribute(), info.GetIsolate());
46 static void readonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
48 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
49 TestInterfaceEventConstructorV8Internal::readonlyStringAttributeAttributeGetter(info);
50 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
53 static void initializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
55 v8::Handle<v8::Object> holder = info.Holder();
56 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
57 v8SetReturnValueString(info, impl->initializedByEventConstructorReadonlyStringAttribute(), info.GetIsolate());
60 static void initializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
62 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
63 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
64 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
67 static void initializedByEventConstructorReadonlyAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
69 v8::Handle<v8::Object> holder = info.Holder();
70 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
71 v8SetReturnValue(info, impl->initializedByEventConstructorReadonlyAnyAttribute().v8Value());
74 static void initializedByEventConstructorReadonlyAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
76 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
77 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyAnyAttributeAttributeGetter(info);
78 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
81 static void initializedByEventConstructorReadonlyBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
83 v8::Handle<v8::Object> holder = info.Holder();
84 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
85 v8SetReturnValueBool(info, impl->initializedByEventConstructorReadonlyBooleanAttribute());
88 static void initializedByEventConstructorReadonlyBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
90 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
91 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyBooleanAttributeAttributeGetter(info);
92 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
95 static void initializedByEventConstructorReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
97 v8::Handle<v8::Object> holder = info.Holder();
98 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
99 v8SetReturnValueInt(info, impl->initializedByEventConstructorReadonlyLongAttribute());
102 static void initializedByEventConstructorReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
104 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
105 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyLongAttributeAttributeGetter(info);
106 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
109 static void initializedByEventConstructorReadonlyUint8ArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
111 v8::Handle<v8::Object> holder = info.Holder();
112 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
113 RefPtr<DOMUint8Array> cppValue(impl->initializedByEventConstructorReadonlyUint8ArrayAttribute());
114 if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue.get()))
116 v8::Handle<v8::Value> wrapper = toV8(cppValue.get(), holder, info.GetIsolate());
117 if (!wrapper.IsEmpty()) {
118 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "initializedByEventConstructorReadonlyUint8ArrayAttribute"), wrapper);
119 v8SetReturnValue(info, wrapper);
123 static void initializedByEventConstructorReadonlyUint8ArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
125 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
126 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyUint8ArrayAttributeAttributeGetter(info);
127 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
130 static void initializedByEventConstructorReadonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
132 v8::Handle<v8::Object> holder = info.Holder();
133 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
134 RefPtr<TestInterfaceEmpty> cppValue(impl->initializedByEventConstructorReadonlyTestInterfaceEmptyAttribute());
135 if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue.get()))
137 v8::Handle<v8::Value> wrapper = toV8(cppValue.get(), holder, info.GetIsolate());
138 if (!wrapper.IsEmpty()) {
139 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "initializedByEventConstructorReadonlyTestInterfaceEmptyAttribute"), wrapper);
140 v8SetReturnValue(info, wrapper);
144 static void initializedByEventConstructorReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
146 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
147 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyTestInterfaceEmptyAttributeAttributeGetter(info);
148 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
151 static void initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
153 v8::Handle<v8::Object> holder = info.Holder();
154 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
155 v8SetReturnValue(info, v8Array(impl->initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttribute(), info.Holder(), info.GetIsolate()));
158 static void initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
160 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
161 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttributeAttributeGetter(info);
162 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
165 static void initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
167 v8::Handle<v8::Object> holder = info.Holder();
168 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
169 RefPtr<TestInterfaceEmpty> cppValue(impl->initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttribute());
170 if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue.get()))
172 v8::Handle<v8::Value> wrapper = toV8(cppValue.get(), holder, info.GetIsolate());
173 if (!wrapper.IsEmpty()) {
174 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttribute"), wrapper);
175 v8SetReturnValue(info, wrapper);
179 static void initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
181 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
182 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttributeAttributeGetter(info);
183 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
186 static void deprecatedInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
188 v8::Handle<v8::Object> holder = info.Holder();
189 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
190 v8SetReturnValueString(info, impl->deprecatedInitializedByEventConstructorReadonlyStringAttribute(), info.GetIsolate());
193 static void deprecatedInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
195 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
196 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::initializedByEventConstructorReadonlyStringAttribute);
197 TestInterfaceEventConstructorV8Internal::deprecatedInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
198 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
201 static void implementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
203 v8::Handle<v8::Object> holder = info.Holder();
204 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
205 v8SetReturnValueString(info, impl->implementedAsName(), info.GetIsolate());
208 static void implementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
210 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
211 TestInterfaceEventConstructorV8Internal::implementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
212 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
215 static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
217 v8::Handle<v8::Object> holder = info.Holder();
218 TestInterfaceEventConstructor* impl = V8TestInterfaceEventConstructor::toImpl(holder);
219 v8SetReturnValueString(info, impl->deprecatedImplementedAsName(), info.GetIsolate());
222 static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
224 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
225 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::initializedByEventConstructorReadonlyStringAttribute);
226 TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
227 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
230 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
232 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInterfaceEventConstructor", info.Holder(), info.GetIsolate());
233 if (info.Length() < 1) {
234 exceptionState.throwTypeError("An event name must be provided.");
235 exceptionState.throwIfNeeded();
239 TOSTRING_VOID(V8StringResource<>, type, info[0]);
240 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute;
241 TestInterfaceEventConstructorInit eventInit;
242 if (info.Length() >= 2) {
243 Dictionary options(info[1], info.GetIsolate());
244 if (!initializeTestInterfaceEventConstructor(eventInit, options, exceptionState, info)) {
245 exceptionState.throwIfNeeded();
248 options.get("initializedByEventConstructorReadonlyAnyAttribute", initializedByEventConstructorReadonlyAnyAttribute);
249 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
250 V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder(), v8AtomicString(info.GetIsolate(), "initializedByEventConstructorReadonlyAnyAttribute"), initializedByEventConstructorReadonlyAnyAttribute);
252 RefPtrWillBeRawPtr<TestInterfaceEventConstructor> event = TestInterfaceEventConstructor::create(type, eventInit, exceptionState);
253 if (exceptionState.throwIfNeeded())
255 if (DOMWrapperWorld::current(info.GetIsolate()).isIsolatedWorld()) {
256 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
257 event->setSerializedInitializedByEventConstructorReadonlyAnyAttribute(SerializedScriptValue::createAndSwallowExceptions(info.GetIsolate(), initializedByEventConstructorReadonlyAnyAttribute));
260 v8::Handle<v8::Object> wrapper = info.Holder();
261 event->associateWithWrapper(&V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, info.GetIsolate());
262 v8SetReturnValue(info, wrapper);
265 } // namespace TestInterfaceEventConstructorV8Internal
267 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventConstructorAttributes[] = {
268 {"readonlyStringAttribute", TestInterfaceEventConstructorV8Internal::readonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
269 {"initializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
270 {"initializedByEventConstructorReadonlyAnyAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyAnyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
271 {"initializedByEventConstructorReadonlyBooleanAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyBooleanAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
272 {"initializedByEventConstructorReadonlyLongAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
273 {"initializedByEventConstructorReadonlyUint8ArrayAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyUint8ArrayAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
274 {"initializedByEventConstructorReadonlyTestInterfaceEmptyAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
275 {"initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
276 {"initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
277 {"deprecatedInitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::deprecatedInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
278 {"implementedAsInitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::implementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
279 {"deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance},
282 bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit& eventInit, const Dictionary& options, ExceptionState& exceptionState, const v8::FunctionCallbackInfo<v8::Value>& info, const String& forEventName)
284 Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? String("TestInterfaceEventConstructor") : forEventName, "", exceptionState);
285 if (!initializeEvent(eventInit, options, exceptionState, info, forEventName.isEmpty() ? String("TestInterfaceEventConstructor") : forEventName))
288 if (!DictionaryHelper::convert(options, conversionContext.setConversionType("DOMString", false), "initializedByEventConstructorReadonlyStringAttribute", eventInit.initializedByEventConstructorReadonlyStringAttribute))
290 if (!DictionaryHelper::convert(options, conversionContext.setConversionType("boolean", false), "initializedByEventConstructorReadonlyBooleanAttribute", eventInit.initializedByEventConstructorReadonlyBooleanAttribute))
292 if (!DictionaryHelper::convert(options, conversionContext.setConversionType("long", false), "initializedByEventConstructorReadonlyLongAttribute", eventInit.initializedByEventConstructorReadonlyLongAttribute))
294 if (!DictionaryHelper::convert(options, conversionContext.setConversionType("Uint8Array", false), "initializedByEventConstructorReadonlyUint8ArrayAttribute", eventInit.initializedByEventConstructorReadonlyUint8ArrayAttribute))
296 if (!DictionaryHelper::convert(options, conversionContext.setConversionType("TestInterfaceEmpty", false), "initializedByEventConstructorReadonlyTestInterfaceEmptyAttribute", eventInit.initializedByEventConstructorReadonlyTestInterfaceEmptyAttribute))
298 if (!DictionaryHelper::convert(options, conversionContext.setConversionType("TestInterfaceEmpty[]", false), "initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttribute", eventInit.initializedByEventConstructorReadonlyTestInterfaceEmptyArrayAttribute))
300 if (!DictionaryHelper::convert(options, conversionContext.setConversionType("TestInterfaceEmpty", true), "initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttribute", eventInit.initializedByEventConstructorReadonlyNullableTestInterfaceEmptyAttribute))
302 if (DictionaryHelper::convert(options, conversionContext.setConversionType("DOMString", false), "deprecatedInitializedByEventConstructorReadonlyStringAttribute", eventInit.deprecatedInitializedByEventConstructorReadonlyStringAttribute)) {
303 if (options.hasProperty("deprecatedInitializedByEventConstructorReadonlyStringAttribute"))
304 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::initializedByEventConstructorReadonlyStringAttribute);
308 if (!DictionaryHelper::convert(options, conversionContext.setConversionType("DOMString", false), "implementedAsInitializedByEventConstructorReadonlyStringAttribute", eventInit.implementedAsName))
310 if (DictionaryHelper::convert(options, conversionContext.setConversionType("DOMString", false), "deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute", eventInit.deprecatedImplementedAsName)) {
311 if (options.hasProperty("deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute"))
312 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::initializedByEventConstructorReadonlyStringAttribute);
319 void V8TestInterfaceEventConstructor::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
321 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor");
322 if (!info.IsConstructCall()) {
323 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("TestInterfaceEventConstructor"));
327 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
328 v8SetReturnValue(info, info.Holder());
332 TestInterfaceEventConstructorV8Internal::constructor(info);
335 static void installV8TestInterfaceEventConstructorTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
337 functionTemplate->ReadOnlyPrototype();
339 v8::Local<v8::Signature> defaultSignature;
340 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceEventConstructor", V8Event::domTemplate(isolate), V8TestInterfaceEventConstructor::internalFieldCount,
341 V8TestInterfaceEventConstructorAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceEventConstructorAttributes),
345 functionTemplate->SetCallHandler(V8TestInterfaceEventConstructor::constructorCallback);
346 functionTemplate->SetLength(1);
347 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
348 ALLOW_UNUSED_LOCAL(instanceTemplate);
349 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
350 ALLOW_UNUSED_LOCAL(prototypeTemplate);
352 // Custom toString template
353 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
356 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEventConstructor::domTemplate(v8::Isolate* isolate)
358 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceEventConstructorTemplate);
361 bool V8TestInterfaceEventConstructor::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
363 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
366 v8::Handle<v8::Object> V8TestInterfaceEventConstructor::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
368 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
371 TestInterfaceEventConstructor* V8TestInterfaceEventConstructor::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
373 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle<v8::Object>::Cast(value))->toImpl<TestInterfaceEventConstructor>() : 0;
376 void V8TestInterfaceEventConstructor::refObject(ScriptWrappableBase* scriptWrappableBase)
379 scriptWrappableBase->toImpl<TestInterfaceEventConstructor>()->ref();
383 void V8TestInterfaceEventConstructor::derefObject(ScriptWrappableBase* scriptWrappableBase)
386 scriptWrappableBase->toImpl<TestInterfaceEventConstructor>()->deref();
391 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
393 return toV8(impl, creationContext, isolate);