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 "V8TestObject.h"
10 #include "HTMLNames.h"
11 #include "RuntimeEnabledFeatures.h"
12 #include "V8DOMStringList.h"
13 #include "V8Document.h"
14 #include "V8MessagePort.h"
16 #include "V8TestCallbackInterface.h"
17 #include "V8TestInterface.h"
18 #include "V8TestNode.h"
19 #include "V8TestObjectectA.h"
20 #include "V8TestObjectectB.h"
21 #include "V8TestObjectectC.h"
22 #include "V8TestSubObj.h"
23 #include "bindings/v8/BindingSecurity.h"
24 #include "bindings/v8/Dictionary.h"
25 #include "bindings/v8/ExceptionState.h"
26 #include "bindings/v8/ScriptState.h"
27 #include "bindings/v8/ScriptValue.h"
28 #include "bindings/v8/SerializedScriptValue.h"
29 #include "bindings/v8/V8AbstractEventListener.h"
30 #include "bindings/v8/V8DOMActivityLogger.h"
31 #include "bindings/v8/V8DOMConfiguration.h"
32 #include "bindings/v8/V8EventListenerList.h"
33 #include "bindings/v8/V8HiddenValue.h"
34 #include "bindings/v8/V8ObjectConstructor.h"
35 #include "bindings/v8/custom/V8Float32ArrayCustom.h"
36 #include "core/css/MediaQueryListListener.h"
37 #include "core/dom/ContextFeatures.h"
38 #include "core/dom/Document.h"
39 #include "core/dom/custom/CustomElementCallbackDispatcher.h"
40 #include "core/frame/UseCounter.h"
41 #include "platform/TraceEvent.h"
42 #include "wtf/GetPtr.h"
43 #include "wtf/RefPtr.h"
47 static void initializeScriptWrappableForInterface(TestObject* object)
49 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
50 ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeInfo);
55 } // namespace WebCore
57 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObject* object)
59 WebCore::initializeScriptWrappableForInterface(object);
63 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::domTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype, false };
65 namespace TestObjectV8Internal {
67 template <typename T> void V8_USE(T) { }
69 static void readOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
71 v8::Handle<v8::Object> holder = info.Holder();
72 TestObject* impl = V8TestObject::toNative(holder);
73 v8SetReturnValueInt(info, impl->readOnlyLongAttr());
76 static void readOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
78 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
79 TestObjectV8Internal::readOnlyLongAttrAttributeGetter(info);
80 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
83 static void readOnlyStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
85 v8::Handle<v8::Object> holder = info.Holder();
86 TestObject* impl = V8TestObject::toNative(holder);
87 v8SetReturnValueString(info, impl->readOnlyStringAttr(), info.GetIsolate());
90 static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
92 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
93 TestObjectV8Internal::readOnlyStringAttrAttributeGetter(info);
94 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
97 static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
99 v8::Handle<v8::Object> holder = info.Holder();
100 TestObject* impl = V8TestObject::toNative(holder);
101 RefPtr<TestObject> result(impl->readOnlyTestObjectAttr());
102 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get()))
104 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate());
105 if (!wrapper.IsEmpty()) {
106 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "readOnlyTestObjectAttr"), wrapper);
107 v8SetReturnValue(info, wrapper);
111 static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
114 TestObjectV8Internal::readOnlyTestObjectAttrAttributeGetter(info);
115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
118 static void staticReadOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
120 v8SetReturnValueInt(info, TestObject::staticReadOnlyLongAttr());
123 static void staticReadOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
126 TestObjectV8Internal::staticReadOnlyLongAttrAttributeGetter(info);
127 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
130 static void staticStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
132 v8SetReturnValueString(info, TestObject::staticStringAttr(), info.GetIsolate());
135 static void staticStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
137 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
138 TestObjectV8Internal::staticStringAttrAttributeGetter(info);
139 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
142 static void staticStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
144 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
145 TestObject::setStaticStringAttr(cppValue);
148 static void staticStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
151 TestObjectV8Internal::staticStringAttrAttributeSetter(v8Value, info);
152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
155 static void enumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
157 v8::Handle<v8::Object> holder = info.Holder();
158 TestObject* impl = V8TestObject::toNative(holder);
159 v8SetReturnValueString(info, impl->enumAttr(), info.GetIsolate());
162 static void enumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
165 TestObjectV8Internal::enumAttrAttributeGetter(info);
166 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
169 static void enumAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
171 v8::Handle<v8::Object> holder = info.Holder();
172 TestObject* impl = V8TestObject::toNative(holder);
173 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
174 String string = cppValue;
175 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3"))
177 impl->setEnumAttr(cppValue);
180 static void enumAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
182 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
183 TestObjectV8Internal::enumAttrAttributeSetter(v8Value, info);
184 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
187 static void readOnlyEnumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
189 v8::Handle<v8::Object> holder = info.Holder();
190 TestObject* impl = V8TestObject::toNative(holder);
191 v8SetReturnValueString(info, impl->readOnlyEnumAttr(), info.GetIsolate());
194 static void readOnlyEnumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
196 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
197 TestObjectV8Internal::readOnlyEnumAttrAttributeGetter(info);
198 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
201 static void byteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
203 v8::Handle<v8::Object> holder = info.Holder();
204 TestObject* impl = V8TestObject::toNative(holder);
205 v8SetReturnValueInt(info, impl->byteAttr());
208 static void byteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
210 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
211 TestObjectV8Internal::byteAttrAttributeGetter(info);
212 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
215 static void byteAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
217 v8::Handle<v8::Object> holder = info.Holder();
218 ExceptionState exceptionState(ExceptionState::SetterContext, "byteAttr", "TestObject", holder, info.GetIsolate());
219 TestObject* impl = V8TestObject::toNative(holder);
220 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt8(v8Value, exceptionState), exceptionState);
221 impl->setByteAttr(cppValue);
224 static void byteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
227 TestObjectV8Internal::byteAttrAttributeSetter(v8Value, info);
228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
231 static void octetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
233 v8::Handle<v8::Object> holder = info.Holder();
234 TestObject* impl = V8TestObject::toNative(holder);
235 v8SetReturnValueUnsigned(info, impl->octetAttr());
238 static void octetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
240 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
241 TestObjectV8Internal::octetAttrAttributeGetter(info);
242 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
245 static void octetAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
247 v8::Handle<v8::Object> holder = info.Holder();
248 ExceptionState exceptionState(ExceptionState::SetterContext, "octetAttr", "TestObject", holder, info.GetIsolate());
249 TestObject* impl = V8TestObject::toNative(holder);
250 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt8(v8Value, exceptionState), exceptionState);
251 impl->setOctetAttr(cppValue);
254 static void octetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
256 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
257 TestObjectV8Internal::octetAttrAttributeSetter(v8Value, info);
258 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
261 static void shortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
263 v8::Handle<v8::Object> holder = info.Holder();
264 TestObject* impl = V8TestObject::toNative(holder);
265 v8SetReturnValueInt(info, impl->shortAttr());
268 static void shortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
270 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
271 TestObjectV8Internal::shortAttrAttributeGetter(info);
272 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
275 static void shortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
277 v8::Handle<v8::Object> holder = info.Holder();
278 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttr", "TestObject", holder, info.GetIsolate());
279 TestObject* impl = V8TestObject::toNative(holder);
280 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt16(v8Value, exceptionState), exceptionState);
281 impl->setShortAttr(cppValue);
284 static void shortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
286 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
287 TestObjectV8Internal::shortAttrAttributeSetter(v8Value, info);
288 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
291 static void unsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
293 v8::Handle<v8::Object> holder = info.Holder();
294 TestObject* impl = V8TestObject::toNative(holder);
295 v8SetReturnValueUnsigned(info, impl->unsignedShortAttr());
298 static void unsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
300 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
301 TestObjectV8Internal::unsignedShortAttrAttributeGetter(info);
302 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
305 static void unsignedShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
307 v8::Handle<v8::Object> holder = info.Holder();
308 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedShortAttr", "TestObject", holder, info.GetIsolate());
309 TestObject* impl = V8TestObject::toNative(holder);
310 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt16(v8Value, exceptionState), exceptionState);
311 impl->setUnsignedShortAttr(cppValue);
314 static void unsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
316 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
317 TestObjectV8Internal::unsignedShortAttrAttributeSetter(v8Value, info);
318 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
321 static void longAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
323 v8::Handle<v8::Object> holder = info.Holder();
324 TestObject* impl = V8TestObject::toNative(holder);
325 v8SetReturnValueInt(info, impl->longAttr());
328 static void longAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
330 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
331 TestObjectV8Internal::longAttrAttributeGetter(info);
332 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
335 static void longAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
337 v8::Handle<v8::Object> holder = info.Holder();
338 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttr", "TestObject", holder, info.GetIsolate());
339 TestObject* impl = V8TestObject::toNative(holder);
340 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
341 impl->setLongAttr(cppValue);
344 static void longAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
346 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
347 TestObjectV8Internal::longAttrAttributeSetter(v8Value, info);
348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
351 static void longLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
353 v8::Handle<v8::Object> holder = info.Holder();
354 TestObject* impl = V8TestObject::toNative(holder);
355 v8SetReturnValue(info, static_cast<double>(impl->longLongAttr()));
358 static void longLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
360 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
361 TestObjectV8Internal::longLongAttrAttributeGetter(info);
362 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
365 static void longLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
367 v8::Handle<v8::Object> holder = info.Holder();
368 ExceptionState exceptionState(ExceptionState::SetterContext, "longLongAttr", "TestObject", holder, info.GetIsolate());
369 TestObject* impl = V8TestObject::toNative(holder);
370 V8TRYCATCH_EXCEPTION_VOID(long long, cppValue, toInt64(v8Value, exceptionState), exceptionState);
371 impl->setLongLongAttr(cppValue);
374 static void longLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
376 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
377 TestObjectV8Internal::longLongAttrAttributeSetter(v8Value, info);
378 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
381 static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
383 v8::Handle<v8::Object> holder = info.Holder();
384 TestObject* impl = V8TestObject::toNative(holder);
385 v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongAttr()));
388 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
390 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
391 TestObjectV8Internal::unsignedLongLongAttrAttributeGetter(info);
392 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
395 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
397 v8::Handle<v8::Object> holder = info.Holder();
398 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLongAttr", "TestObject", holder, info.GetIsolate());
399 TestObject* impl = V8TestObject::toNative(holder);
400 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(v8Value, exceptionState), exceptionState);
401 impl->setUnsignedLongLongAttr(cppValue);
404 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
406 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
407 TestObjectV8Internal::unsignedLongLongAttrAttributeSetter(v8Value, info);
408 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
411 static void stringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
413 v8::Handle<v8::Object> holder = info.Holder();
414 TestObject* impl = V8TestObject::toNative(holder);
415 v8SetReturnValueString(info, impl->stringAttr(), info.GetIsolate());
418 static void stringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
420 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
421 TestObjectV8Internal::stringAttrAttributeGetter(info);
422 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
425 static void stringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
427 v8::Handle<v8::Object> holder = info.Holder();
428 TestObject* impl = V8TestObject::toNative(holder);
429 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
430 impl->setStringAttr(cppValue);
433 static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
435 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
436 TestObjectV8Internal::stringAttrAttributeSetter(v8Value, info);
437 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
440 static void treatNullAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
442 v8::Handle<v8::Object> holder = info.Holder();
443 TestObject* impl = V8TestObject::toNative(holder);
444 v8SetReturnValueString(info, impl->treatNullAsNullStringStringAttr(), info.GetIsolate());
447 static void treatNullAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
449 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
450 TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeGetter(info);
451 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
454 static void treatNullAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
456 v8::Handle<v8::Object> holder = info.Holder();
457 TestObject* impl = V8TestObject::toNative(holder);
458 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value);
459 impl->setTreatNullAsNullStringStringAttr(cppValue);
462 static void treatNullAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
464 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
465 TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeSetter(v8Value, info);
466 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
469 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
471 v8::Handle<v8::Object> holder = info.Holder();
472 TestObject* impl = V8TestObject::toNative(holder);
473 v8SetReturnValueString(info, impl->treatNullAsNullStringTreatUndefinedAsNullStringStringAttr(), info.GetIsolate());
476 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
478 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
479 TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(info);
480 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
483 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
485 v8::Handle<v8::Object> holder = info.Holder();
486 TestObject* impl = V8TestObject::toNative(holder);
487 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value);
488 impl->setTreatNullAsNullStringTreatUndefinedAsNullStringStringAttr(cppValue);
491 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
493 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
494 TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8Value, info);
495 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
498 static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
500 v8::Handle<v8::Object> holder = info.Holder();
501 TestObject* impl = V8TestObject::toNative(holder);
502 EventListener* v8Value = impl->eventHandlerAttr();
503 v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
506 static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
509 TestObjectV8Internal::eventHandlerAttrAttributeGetter(info);
510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
513 static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
515 v8::Handle<v8::Object> holder = info.Holder();
516 TestObject* impl = V8TestObject::toNative(holder);
517 moveEventListenerToNewWrapper(holder, impl->eventHandlerAttr(), v8Value, V8TestObject::eventListenerCacheIndex, info.GetIsolate());
518 impl->setEventHandlerAttr(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
521 static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
523 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
524 TestObjectV8Internal::eventHandlerAttrAttributeSetter(v8Value, info);
525 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
528 static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
530 v8::Handle<v8::Object> holder = info.Holder();
531 TestObject* impl = V8TestObject::toNative(holder);
532 v8SetReturnValueFast(info, WTF::getPtr(impl->testObjAttr()), impl);
535 static void testObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
537 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
538 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature);
539 TestObjectV8Internal::testObjAttrAttributeGetter(info);
540 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
543 static void testObjAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
545 v8::Handle<v8::Object> holder = info.Holder();
546 TestObject* impl = V8TestObject::toNative(holder);
547 V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
548 impl->setTestObjAttr(WTF::getPtr(cppValue));
551 static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
553 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
554 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature);
555 TestObjectV8Internal::testObjAttrAttributeSetter(v8Value, info);
556 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
559 static void attrWithJSGetterAndSetterAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
561 v8::Handle<v8::Object> holder = info.Holder();
562 TestObject* impl = V8TestObject::toNative(holder);
563 v8SetReturnValueString(info, impl->attrWithJSGetterAndSetter(), info.GetIsolate());
566 static void attrWithJSGetterAndSetterAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
568 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
569 TestObjectV8Internal::attrWithJSGetterAndSetterAttributeGetter(info);
570 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
573 static void attrWithJSGetterAndSetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
575 v8::Handle<v8::Object> holder = info.Holder();
576 TestObject* impl = V8TestObject::toNative(holder);
577 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
578 impl->setAttrWithJSGetterAndSetter(cppValue);
581 static void attrWithJSGetterAndSetterAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
583 v8::Local<v8::Value> v8Value = info[0];
584 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
585 TestObjectV8Internal::attrWithJSGetterAndSetterAttributeSetter(v8Value, info);
586 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
589 static void XMLObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
591 v8::Handle<v8::Object> holder = info.Holder();
592 TestObject* impl = V8TestObject::toNative(holder);
593 v8SetReturnValueFast(info, WTF::getPtr(impl->xmlObjAttr()), impl);
596 static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
598 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
599 TestObjectV8Internal::XMLObjAttrAttributeGetter(info);
600 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
603 static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
605 v8::Handle<v8::Object> holder = info.Holder();
606 TestObject* impl = V8TestObject::toNative(holder);
607 V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
608 impl->setXMLObjAttr(WTF::getPtr(cppValue));
611 static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
613 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
614 TestObjectV8Internal::XMLObjAttrAttributeSetter(v8Value, info);
615 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
618 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
620 v8::Handle<v8::Object> holder = info.Holder();
621 TestObject* impl = V8TestObject::toNative(holder);
622 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedstringattrAttr), info.GetIsolate());
625 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
627 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
628 TestObjectV8Internal::reflectedStringAttrAttributeGetter(info);
629 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
632 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
634 v8::Handle<v8::Object> holder = info.Holder();
635 TestObject* impl = V8TestObject::toNative(holder);
636 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
637 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
638 impl->setAttribute(HTMLNames::reflectedstringattrAttr, cppValue);
641 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
643 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
644 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
645 TestObjectV8Internal::reflectedStringAttrAttributeSetter(v8Value, info);
646 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
649 static void reflectedTreatNullAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
651 v8::Handle<v8::Object> holder = info.Holder();
652 TestObject* impl = V8TestObject::toNative(holder);
653 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedtreatnullasnullstringstringattrAttr), info.GetIsolate());
656 static void reflectedTreatNullAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
658 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
659 TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeGetter(info);
660 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
663 static void reflectedTreatNullAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
665 v8::Handle<v8::Object> holder = info.Holder();
666 TestObject* impl = V8TestObject::toNative(holder);
667 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value);
668 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
669 impl->setAttribute(HTMLNames::reflectedtreatnullasnullstringstringattrAttr, cppValue);
672 static void reflectedTreatNullAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
674 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
675 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
676 TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeSetter(v8Value, info);
677 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
680 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
682 v8::Handle<v8::Object> holder = info.Holder();
683 TestObject* impl = V8TestObject::toNative(holder);
684 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringstringattrAttr), info.GetIsolate());
687 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
689 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
690 TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(info);
691 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
694 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
696 v8::Handle<v8::Object> holder = info.Holder();
697 TestObject* impl = V8TestObject::toNative(holder);
698 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value);
699 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
700 impl->setAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringstringattrAttr, cppValue);
703 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
705 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
706 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
707 TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8Value, info);
708 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
711 static void reflectedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
713 v8::Handle<v8::Object> holder = info.Holder();
714 TestObject* impl = V8TestObject::toNative(holder);
715 v8SetReturnValueInt(info, impl->getIntegralAttribute(HTMLNames::reflectedintegralattrAttr));
718 static void reflectedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
720 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
721 TestObjectV8Internal::reflectedIntegralAttrAttributeGetter(info);
722 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
725 static void reflectedIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
727 v8::Handle<v8::Object> holder = info.Holder();
728 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedIntegralAttr", "TestObject", holder, info.GetIsolate());
729 TestObject* impl = V8TestObject::toNative(holder);
730 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
731 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
732 impl->setIntegralAttribute(HTMLNames::reflectedintegralattrAttr, cppValue);
735 static void reflectedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
737 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
738 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
739 TestObjectV8Internal::reflectedIntegralAttrAttributeSetter(v8Value, info);
740 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
743 static void reflectedUnsignedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
745 v8::Handle<v8::Object> holder = info.Holder();
746 TestObject* impl = V8TestObject::toNative(holder);
747 v8SetReturnValueUnsigned(info, std::max(0, impl->getIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr)));
750 static void reflectedUnsignedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
752 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
753 TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeGetter(info);
754 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
757 static void reflectedUnsignedIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
759 v8::Handle<v8::Object> holder = info.Holder();
760 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedUnsignedIntegralAttr", "TestObject", holder, info.GetIsolate());
761 TestObject* impl = V8TestObject::toNative(holder);
762 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt32(v8Value, exceptionState), exceptionState);
763 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
764 impl->setUnsignedIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr, cppValue);
767 static void reflectedUnsignedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
769 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
770 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
771 TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeSetter(v8Value, info);
772 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
775 static void reflectedBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
777 v8::Handle<v8::Object> holder = info.Holder();
778 TestObject* impl = V8TestObject::toNative(holder);
779 v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::reflectedbooleanattrAttr));
782 static void reflectedBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
784 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
785 TestObjectV8Internal::reflectedBooleanAttrAttributeGetter(info);
786 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
789 static void reflectedBooleanAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
791 v8::Handle<v8::Object> holder = info.Holder();
792 TestObject* impl = V8TestObject::toNative(holder);
793 V8TRYCATCH_VOID(bool, cppValue, v8Value->BooleanValue());
794 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
795 impl->setBooleanAttribute(HTMLNames::reflectedbooleanattrAttr, cppValue);
798 static void reflectedBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
800 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
801 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
802 TestObjectV8Internal::reflectedBooleanAttrAttributeSetter(v8Value, info);
803 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
806 static void reflectedURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
808 v8::Handle<v8::Object> holder = info.Holder();
809 TestObject* impl = V8TestObject::toNative(holder);
810 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedurlattrAttr), info.GetIsolate());
813 static void reflectedURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
815 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
816 TestObjectV8Internal::reflectedURLAttrAttributeGetter(info);
817 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
820 static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
822 v8::Handle<v8::Object> holder = info.Holder();
823 TestObject* impl = V8TestObject::toNative(holder);
824 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
825 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
826 impl->setAttribute(HTMLNames::reflectedurlattrAttr, cppValue);
829 static void reflectedURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
831 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
832 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
833 TestObjectV8Internal::reflectedURLAttrAttributeSetter(v8Value, info);
834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
837 static void reflectedTreatNullAsNullStringURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
839 v8::Handle<v8::Object> holder = info.Holder();
840 TestObject* impl = V8TestObject::toNative(holder);
841 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedtreatnullasnullstringurlattrAttr), info.GetIsolate());
844 static void reflectedTreatNullAsNullStringURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
846 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
847 TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeGetter(info);
848 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
851 static void reflectedTreatNullAsNullStringURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
853 v8::Handle<v8::Object> holder = info.Holder();
854 TestObject* impl = V8TestObject::toNative(holder);
855 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value);
856 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
857 impl->setAttribute(HTMLNames::reflectedtreatnullasnullstringurlattrAttr, cppValue);
860 static void reflectedTreatNullAsNullStringURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
862 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
863 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
864 TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeSetter(v8Value, info);
865 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
868 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
870 v8::Handle<v8::Object> holder = info.Holder();
871 TestObject* impl = V8TestObject::toNative(holder);
872 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringurlattrAttr), info.GetIsolate());
875 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
877 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
878 TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetter(info);
879 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
882 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
884 v8::Handle<v8::Object> holder = info.Holder();
885 TestObject* impl = V8TestObject::toNative(holder);
886 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value);
887 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
888 impl->setAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringurlattrAttr, cppValue);
891 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
893 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
894 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
895 TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetter(v8Value, info);
896 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
899 static void reflectedCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
901 v8::Handle<v8::Object> holder = info.Holder();
902 TestObject* impl = V8TestObject::toNative(holder);
903 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate());
906 static void reflectedCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
908 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
909 TestObjectV8Internal::reflectedCustomStringAttrAttributeGetter(info);
910 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
913 static void reflectedCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
915 v8::Handle<v8::Object> holder = info.Holder();
916 TestObject* impl = V8TestObject::toNative(holder);
917 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
918 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
919 impl->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue);
922 static void reflectedCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
924 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
925 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
926 TestObjectV8Internal::reflectedCustomStringAttrAttributeSetter(v8Value, info);
927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
930 static void reflectedTreatNullAsNullStringCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
932 v8::Handle<v8::Object> holder = info.Holder();
933 TestObject* impl = V8TestObject::toNative(holder);
934 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate());
937 static void reflectedTreatNullAsNullStringCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
939 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
940 TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeGetter(info);
941 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
944 static void reflectedTreatNullAsNullStringCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
946 v8::Handle<v8::Object> holder = info.Holder();
947 TestObject* impl = V8TestObject::toNative(holder);
948 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value);
949 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
950 impl->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue);
953 static void reflectedTreatNullAsNullStringCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
955 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
956 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
957 TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeSetter(v8Value, info);
958 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
961 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
963 v8::Handle<v8::Object> holder = info.Holder();
964 TestObject* impl = V8TestObject::toNative(holder);
965 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate());
968 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
970 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
971 TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetter(info);
972 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
975 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
977 v8::Handle<v8::Object> holder = info.Holder();
978 TestObject* impl = V8TestObject::toNative(holder);
979 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value);
980 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
981 impl->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue);
984 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
986 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
987 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
988 TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetter(v8Value, info);
989 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
992 static void reflectedCustomIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
994 v8::Handle<v8::Object> holder = info.Holder();
995 TestObject* impl = V8TestObject::toNative(holder);
996 v8SetReturnValueInt(info, impl->getIntegralAttribute(HTMLNames::customContentIntegralAttrAttr));
999 static void reflectedCustomIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1001 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1002 TestObjectV8Internal::reflectedCustomIntegralAttrAttributeGetter(info);
1003 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1006 static void reflectedCustomIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1008 v8::Handle<v8::Object> holder = info.Holder();
1009 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectedCustomIntegralAttr", "TestObject", holder, info.GetIsolate());
1010 TestObject* impl = V8TestObject::toNative(holder);
1011 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
1012 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1013 impl->setIntegralAttribute(HTMLNames::customContentIntegralAttrAttr, cppValue);
1016 static void reflectedCustomIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1018 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1019 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1020 TestObjectV8Internal::reflectedCustomIntegralAttrAttributeSetter(v8Value, info);
1021 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1024 static void reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1026 v8::Handle<v8::Object> holder = info.Holder();
1027 TestObject* impl = V8TestObject::toNative(holder);
1028 v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::customContentBooleanAttrAttr));
1031 static void reflectedCustomBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1033 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1034 TestObjectV8Internal::reflectedCustomBooleanAttrAttributeGetter(info);
1035 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1038 static void reflectedCustomBooleanAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1040 v8::Handle<v8::Object> holder = info.Holder();
1041 TestObject* impl = V8TestObject::toNative(holder);
1042 V8TRYCATCH_VOID(bool, cppValue, v8Value->BooleanValue());
1043 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1044 impl->setBooleanAttribute(HTMLNames::customContentBooleanAttrAttr, cppValue);
1047 static void reflectedCustomBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1049 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1050 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1051 TestObjectV8Internal::reflectedCustomBooleanAttrAttributeSetter(v8Value, info);
1052 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1055 static void reflectedCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1057 v8::Handle<v8::Object> holder = info.Holder();
1058 TestObject* impl = V8TestObject::toNative(holder);
1059 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate());
1062 static void reflectedCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1064 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1065 TestObjectV8Internal::reflectedCustomURLAttrAttributeGetter(info);
1066 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1069 static void reflectedCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1071 v8::Handle<v8::Object> holder = info.Holder();
1072 TestObject* impl = V8TestObject::toNative(holder);
1073 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1074 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1075 impl->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue);
1078 static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1080 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1081 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1082 TestObjectV8Internal::reflectedCustomURLAttrAttributeSetter(v8Value, info);
1083 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1086 static void reflectedTreatNullAsNullStringCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1088 v8::Handle<v8::Object> holder = info.Holder();
1089 TestObject* impl = V8TestObject::toNative(holder);
1090 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate());
1093 static void reflectedTreatNullAsNullStringCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1095 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1096 TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeGetter(info);
1097 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1100 static void reflectedTreatNullAsNullStringCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1102 v8::Handle<v8::Object> holder = info.Holder();
1103 TestObject* impl = V8TestObject::toNative(holder);
1104 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value);
1105 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1106 impl->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue);
1109 static void reflectedTreatNullAsNullStringCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1111 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1112 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1113 TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeSetter(v8Value, info);
1114 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1117 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1119 v8::Handle<v8::Object> holder = info.Holder();
1120 TestObject* impl = V8TestObject::toNative(holder);
1121 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate());
1124 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1126 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1127 TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetter(info);
1128 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1131 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1133 v8::Handle<v8::Object> holder = info.Holder();
1134 TestObject* impl = V8TestObject::toNative(holder);
1135 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, cppValue, v8Value);
1136 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1137 impl->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue);
1140 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1142 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1143 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1144 TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetter(v8Value, info);
1145 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1148 static void limitedToOnlyOneAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1150 v8::Handle<v8::Object> holder = info.Holder();
1151 TestObject* impl = V8TestObject::toNative(holder);
1152 String v8Value = impl->fastGetAttribute(HTMLNames::limitedtoonlyoneattributeAttr);
1153 if (v8Value.isEmpty()) {
1155 } else if (equalIgnoringCase(v8Value, "unique")) {
1160 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1163 static void limitedToOnlyOneAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1165 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1166 TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetter(info);
1167 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1170 static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1172 v8::Handle<v8::Object> holder = info.Holder();
1173 TestObject* impl = V8TestObject::toNative(holder);
1174 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1175 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1176 impl->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue);
1179 static void limitedToOnlyOneAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1181 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1182 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1183 TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetter(v8Value, info);
1184 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1187 static void limitedToOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1189 v8::Handle<v8::Object> holder = info.Holder();
1190 TestObject* impl = V8TestObject::toNative(holder);
1191 String v8Value = impl->fastGetAttribute(HTMLNames::limitedtoonlyattributeAttr);
1192 if (v8Value.isEmpty()) {
1194 } else if (equalIgnoringCase(v8Value, "Per")) {
1196 } else if (equalIgnoringCase(v8Value, "Paal")) {
1198 } else if (equalIgnoringCase(v8Value, "Espen")) {
1203 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1206 static void limitedToOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1208 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1209 TestObjectV8Internal::limitedToOnlyAttributeAttributeGetter(info);
1210 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1213 static void limitedToOnlyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1215 v8::Handle<v8::Object> holder = info.Holder();
1216 TestObject* impl = V8TestObject::toNative(holder);
1217 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1218 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1219 impl->setAttribute(HTMLNames::limitedtoonlyattributeAttr, cppValue);
1222 static void limitedToOnlyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1225 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1226 TestObjectV8Internal::limitedToOnlyAttributeAttributeSetter(v8Value, info);
1227 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1230 static void limitedToOnlyOtherAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1232 v8::Handle<v8::Object> holder = info.Holder();
1233 TestObject* impl = V8TestObject::toNative(holder);
1234 String v8Value = impl->fastGetAttribute(HTMLNames::OtherAttr);
1235 if (v8Value.isEmpty()) {
1237 } else if (equalIgnoringCase(v8Value, "Value1")) {
1239 } else if (equalIgnoringCase(v8Value, "Value2")) {
1244 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1247 static void limitedToOnlyOtherAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1249 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1250 TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetter(info);
1251 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1254 static void limitedToOnlyOtherAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1256 v8::Handle<v8::Object> holder = info.Holder();
1257 TestObject* impl = V8TestObject::toNative(holder);
1258 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1259 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1260 impl->setAttribute(HTMLNames::OtherAttr, cppValue);
1263 static void limitedToOnlyOtherAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1265 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1266 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1267 TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetter(v8Value, info);
1268 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1271 static void limitedWithMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1273 v8::Handle<v8::Object> holder = info.Holder();
1274 TestObject* impl = V8TestObject::toNative(holder);
1275 String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr);
1276 if (v8Value.isEmpty()) {
1278 } else if (equalIgnoringCase(v8Value, "rsa")) {
1280 } else if (equalIgnoringCase(v8Value, "dsa")) {
1285 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1288 static void limitedWithMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1290 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1291 TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetter(info);
1292 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1295 static void limitedWithMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1297 v8::Handle<v8::Object> holder = info.Holder();
1298 TestObject* impl = V8TestObject::toNative(holder);
1299 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1300 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1301 impl->setAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr, cppValue);
1304 static void limitedWithMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1306 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1307 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1308 TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetter(v8Value, info);
1309 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1312 static void limitedWithInvalidMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1314 v8::Handle<v8::Object> holder = info.Holder();
1315 TestObject* impl = V8TestObject::toNative(holder);
1316 String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr);
1317 if (v8Value.isEmpty()) {
1319 } else if (equalIgnoringCase(v8Value, "ltr")) {
1321 } else if (equalIgnoringCase(v8Value, "rtl")) {
1323 } else if (equalIgnoringCase(v8Value, "auto")) {
1328 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1331 static void limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1333 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1334 TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetter(info);
1335 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1338 static void limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1340 v8::Handle<v8::Object> holder = info.Holder();
1341 TestObject* impl = V8TestObject::toNative(holder);
1342 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1343 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1344 impl->setAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr, cppValue);
1347 static void limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1349 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1350 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1351 TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8Value, info);
1352 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1355 static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1357 v8::Handle<v8::Object> holder = info.Holder();
1358 TestObject* impl = V8TestObject::toNative(holder);
1359 String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithinvalidandmissingdefaultattributeAttr);
1360 if (v8Value.isEmpty()) {
1362 } else if (equalIgnoringCase(v8Value, "left")) {
1364 } else if (equalIgnoringCase(v8Value, "right")) {
1369 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1372 static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1374 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1375 TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeGetter(info);
1376 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1379 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1381 v8::Handle<v8::Object> holder = info.Holder();
1382 TestObject* impl = V8TestObject::toNative(holder);
1383 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1384 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1385 impl->setAttribute(HTMLNames::limitedwithinvalidandmissingdefaultattributeAttr, cppValue);
1388 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1390 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1391 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
1392 TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeSetter(v8Value, info);
1393 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1396 static void corsSettingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1398 v8::Handle<v8::Object> holder = info.Holder();
1399 TestObject* impl = V8TestObject::toNative(holder);
1400 String v8Value = impl->fastGetAttribute(HTMLNames::corssettingattributeAttr);
1401 if (v8Value.isNull()) {
1403 } else if (v8Value.isEmpty()) {
1404 v8Value = "anonymous";
1405 } else if (equalIgnoringCase(v8Value, "anonymous")) {
1406 v8Value = "anonymous";
1407 } else if (equalIgnoringCase(v8Value, "use-credentials")) {
1408 v8Value = "use-credentials";
1410 v8Value = "anonymous";
1412 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1415 static void corsSettingAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1417 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1418 TestObjectV8Internal::corsSettingAttributeAttributeGetter(info);
1419 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1422 static void limitedWithEmptyMissingInvalidAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1424 v8::Handle<v8::Object> holder = info.Holder();
1425 TestObject* impl = V8TestObject::toNative(holder);
1426 String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithemptymissinginvalidattributeAttr);
1427 if (v8Value.isNull()) {
1428 v8Value = "missing";
1429 } else if (v8Value.isEmpty()) {
1431 } else if (equalIgnoringCase(v8Value, "empty")) {
1433 } else if (equalIgnoringCase(v8Value, "missing")) {
1434 v8Value = "missing";
1435 } else if (equalIgnoringCase(v8Value, "invalid")) {
1436 v8Value = "invalid";
1437 } else if (equalIgnoringCase(v8Value, "a-normal")) {
1438 v8Value = "a-normal";
1440 v8Value = "invalid";
1442 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1445 static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1447 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1448 TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(info);
1449 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1452 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1454 v8::Handle<v8::Object> holder = info.Holder();
1455 TestObject* impl = V8TestObject::toNative(holder);
1456 v8SetReturnValueFast(info, WTF::getPtr(impl->typedArrayAttr()), impl);
1459 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1461 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1462 TestObjectV8Internal::typedArrayAttrAttributeGetter(info);
1463 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1466 static void typedArrayAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1468 v8::Handle<v8::Object> holder = info.Holder();
1469 TestObject* impl = V8TestObject::toNative(holder);
1470 V8TRYCATCH_VOID(Float32Array*, cppValue, v8Value->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(v8Value)) : 0);
1471 impl->setTypedArrayAttr(WTF::getPtr(cppValue));
1474 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1476 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1477 TestObjectV8Internal::typedArrayAttrAttributeSetter(v8Value, info);
1478 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1481 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1483 v8::Handle<v8::Object> holder = info.Holder();
1484 TestObject* impl = V8TestObject::toNative(holder);
1485 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetterException", "TestObject", holder, info.GetIsolate());
1486 int v8Value = impl->attrWithGetterException(exceptionState);
1487 if (UNLIKELY(exceptionState.throwIfNeeded()))
1489 v8SetReturnValueInt(info, v8Value);
1492 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1494 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1495 TestObjectV8Internal::attrWithGetterExceptionAttributeGetter(info);
1496 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1499 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1501 v8::Handle<v8::Object> holder = info.Holder();
1502 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithGetterException", "TestObject", holder, info.GetIsolate());
1503 TestObject* impl = V8TestObject::toNative(holder);
1504 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
1505 impl->setAttrWithGetterException(cppValue);
1508 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1510 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1511 TestObjectV8Internal::attrWithGetterExceptionAttributeSetter(v8Value, info);
1512 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1515 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1517 v8::Handle<v8::Object> holder = info.Holder();
1518 TestObject* impl = V8TestObject::toNative(holder);
1519 v8SetReturnValueInt(info, impl->attrWithSetterException());
1522 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1524 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1525 TestObjectV8Internal::attrWithSetterExceptionAttributeGetter(info);
1526 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1529 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1531 v8::Handle<v8::Object> holder = info.Holder();
1532 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetterException", "TestObject", holder, info.GetIsolate());
1533 TestObject* impl = V8TestObject::toNative(holder);
1534 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
1535 impl->setAttrWithSetterException(cppValue, exceptionState);
1536 exceptionState.throwIfNeeded();
1539 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1541 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1542 TestObjectV8Internal::attrWithSetterExceptionAttributeSetter(v8Value, info);
1543 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1546 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1548 v8::Handle<v8::Object> holder = info.Holder();
1549 TestObject* impl = V8TestObject::toNative(holder);
1550 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWithGetterException", "TestObject", holder, info.GetIsolate());
1551 String v8Value = impl->stringAttrWithGetterException(exceptionState);
1552 if (UNLIKELY(exceptionState.throwIfNeeded()))
1554 v8SetReturnValueString(info, v8Value, info.GetIsolate());
1557 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1559 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1560 TestObjectV8Internal::stringAttrWithGetterExceptionAttributeGetter(info);
1561 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1564 static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1566 v8::Handle<v8::Object> holder = info.Holder();
1567 TestObject* impl = V8TestObject::toNative(holder);
1568 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1569 impl->setStringAttrWithGetterException(cppValue);
1572 static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1574 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1575 TestObjectV8Internal::stringAttrWithGetterExceptionAttributeSetter(v8Value, info);
1576 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1579 static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1581 v8::Handle<v8::Object> holder = info.Holder();
1582 TestObject* impl = V8TestObject::toNative(holder);
1583 v8SetReturnValueString(info, impl->stringAttrWithSetterException(), info.GetIsolate());
1586 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1588 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1589 TestObjectV8Internal::stringAttrWithSetterExceptionAttributeGetter(info);
1590 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1593 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1595 v8::Handle<v8::Object> holder = info.Holder();
1596 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWithSetterException", "TestObject", holder, info.GetIsolate());
1597 TestObject* impl = V8TestObject::toNative(holder);
1598 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
1599 impl->setStringAttrWithSetterException(cppValue, exceptionState);
1600 exceptionState.throwIfNeeded();
1603 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1605 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1606 TestObjectV8Internal::stringAttrWithSetterExceptionAttributeSetter(v8Value, info);
1607 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1610 static void customAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1612 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1613 V8TestObject::customAttrAttributeGetterCustom(info);
1614 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1617 static void customAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1619 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1620 V8TestObject::customAttrAttributeSetterCustom(v8Value, info);
1621 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1624 static void withExecutionContextAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1626 v8::Handle<v8::Object> holder = info.Holder();
1627 TestObject* impl = V8TestObject::toNative(holder);
1628 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
1629 v8SetReturnValueFast(info, WTF::getPtr(impl->withExecutionContextAttribute(scriptContext)), impl);
1632 static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1634 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1635 TestObjectV8Internal::withExecutionContextAttributeAttributeGetter(info);
1636 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1639 static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1641 v8::Handle<v8::Object> holder = info.Holder();
1642 TestObject* impl = V8TestObject::toNative(holder);
1643 V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
1644 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
1645 impl->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue));
1648 static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1650 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1651 TestObjectV8Internal::withExecutionContextAttributeAttributeSetter(v8Value, info);
1652 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1655 static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1657 v8::Handle<v8::Object> holder = info.Holder();
1658 TestObject* impl = V8TestObject::toNative(holder);
1659 v8SetReturnValueFast(info, WTF::getPtr(impl->withActiveWindowAndFirstWindowAttribute()), impl);
1662 static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1664 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1665 TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(info);
1666 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1669 static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1671 v8::Handle<v8::Object> holder = info.Holder();
1672 TestObject* impl = V8TestObject::toNative(holder);
1673 V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
1674 impl->setWithActiveWindowAndFirstWindowAttribute(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), WTF::getPtr(cppValue));
1677 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1680 TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(v8Value, info);
1681 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1684 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1686 v8::Handle<v8::Object> holder = info.Holder();
1687 TestObject* impl = V8TestObject::toNative(holder);
1688 ExceptionState exceptionState(ExceptionState::GetterContext, "withScriptStateAttributeRaises", "TestObject", holder, info.GetIsolate());
1689 RefPtr<TestObject> v8Value = impl->withScriptStateAttributeRaises(exceptionState);
1690 if (UNLIKELY(exceptionState.throwIfNeeded()))
1692 v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl);
1695 static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1697 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1698 TestObjectV8Internal::withScriptStateAttributeRaisesAttributeGetter(info);
1699 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1702 static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1704 v8::Handle<v8::Object> holder = info.Holder();
1705 TestObject* impl = V8TestObject::toNative(holder);
1706 V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
1707 impl->setWithScriptStateAttributeRaises(WTF::getPtr(cppValue));
1710 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1712 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1713 TestObjectV8Internal::withScriptStateAttributeRaisesAttributeSetter(v8Value, info);
1714 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1717 static void enforcedRangeByteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1719 v8::Handle<v8::Object> holder = info.Holder();
1720 TestObject* impl = V8TestObject::toNative(holder);
1721 v8SetReturnValueInt(info, impl->enforcedRangeByteAttr());
1724 static void enforcedRangeByteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1726 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1727 TestObjectV8Internal::enforcedRangeByteAttrAttributeGetter(info);
1728 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1731 static void enforcedRangeByteAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1733 v8::Handle<v8::Object> holder = info.Holder();
1734 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeByteAttr", "TestObject", holder, info.GetIsolate());
1735 TestObject* impl = V8TestObject::toNative(holder);
1736 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt8(v8Value, EnforceRange, exceptionState), exceptionState);
1737 impl->setEnforcedRangeByteAttr(cppValue);
1740 static void enforcedRangeByteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1742 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1743 TestObjectV8Internal::enforcedRangeByteAttrAttributeSetter(v8Value, info);
1744 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1747 static void enforcedRangeOctetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1749 v8::Handle<v8::Object> holder = info.Holder();
1750 TestObject* impl = V8TestObject::toNative(holder);
1751 v8SetReturnValueUnsigned(info, impl->enforcedRangeOctetAttr());
1754 static void enforcedRangeOctetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1756 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1757 TestObjectV8Internal::enforcedRangeOctetAttrAttributeGetter(info);
1758 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1761 static void enforcedRangeOctetAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1763 v8::Handle<v8::Object> holder = info.Holder();
1764 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeOctetAttr", "TestObject", holder, info.GetIsolate());
1765 TestObject* impl = V8TestObject::toNative(holder);
1766 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt8(v8Value, EnforceRange, exceptionState), exceptionState);
1767 impl->setEnforcedRangeOctetAttr(cppValue);
1770 static void enforcedRangeOctetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1772 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1773 TestObjectV8Internal::enforcedRangeOctetAttrAttributeSetter(v8Value, info);
1774 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1777 static void enforcedRangeShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1779 v8::Handle<v8::Object> holder = info.Holder();
1780 TestObject* impl = V8TestObject::toNative(holder);
1781 v8SetReturnValueInt(info, impl->enforcedRangeShortAttr());
1784 static void enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1786 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1787 TestObjectV8Internal::enforcedRangeShortAttrAttributeGetter(info);
1788 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1791 static void enforcedRangeShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1793 v8::Handle<v8::Object> holder = info.Holder();
1794 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeShortAttr", "TestObject", holder, info.GetIsolate());
1795 TestObject* impl = V8TestObject::toNative(holder);
1796 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt16(v8Value, EnforceRange, exceptionState), exceptionState);
1797 impl->setEnforcedRangeShortAttr(cppValue);
1800 static void enforcedRangeShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1802 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1803 TestObjectV8Internal::enforcedRangeShortAttrAttributeSetter(v8Value, info);
1804 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1807 static void enforcedRangeUnsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1809 v8::Handle<v8::Object> holder = info.Holder();
1810 TestObject* impl = V8TestObject::toNative(holder);
1811 v8SetReturnValueUnsigned(info, impl->enforcedRangeUnsignedShortAttr());
1814 static void enforcedRangeUnsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1816 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1817 TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeGetter(info);
1818 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1821 static void enforcedRangeUnsignedShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1823 v8::Handle<v8::Object> holder = info.Holder();
1824 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeUnsignedShortAttr", "TestObject", holder, info.GetIsolate());
1825 TestObject* impl = V8TestObject::toNative(holder);
1826 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt16(v8Value, EnforceRange, exceptionState), exceptionState);
1827 impl->setEnforcedRangeUnsignedShortAttr(cppValue);
1830 static void enforcedRangeUnsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1832 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1833 TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeSetter(v8Value, info);
1834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1837 static void enforcedRangeLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1839 v8::Handle<v8::Object> holder = info.Holder();
1840 TestObject* impl = V8TestObject::toNative(holder);
1841 v8SetReturnValueInt(info, impl->enforcedRangeLongAttr());
1844 static void enforcedRangeLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1846 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1847 TestObjectV8Internal::enforcedRangeLongAttrAttributeGetter(info);
1848 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1851 static void enforcedRangeLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1853 v8::Handle<v8::Object> holder = info.Holder();
1854 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeLongAttr", "TestObject", holder, info.GetIsolate());
1855 TestObject* impl = V8TestObject::toNative(holder);
1856 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, EnforceRange, exceptionState), exceptionState);
1857 impl->setEnforcedRangeLongAttr(cppValue);
1860 static void enforcedRangeLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1862 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1863 TestObjectV8Internal::enforcedRangeLongAttrAttributeSetter(v8Value, info);
1864 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1867 static void enforcedRangeUnsignedLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1869 v8::Handle<v8::Object> holder = info.Holder();
1870 TestObject* impl = V8TestObject::toNative(holder);
1871 v8SetReturnValueUnsigned(info, impl->enforcedRangeUnsignedLongAttr());
1874 static void enforcedRangeUnsignedLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1876 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1877 TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeGetter(info);
1878 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1881 static void enforcedRangeUnsignedLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1883 v8::Handle<v8::Object> holder = info.Holder();
1884 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeUnsignedLongAttr", "TestObject", holder, info.GetIsolate());
1885 TestObject* impl = V8TestObject::toNative(holder);
1886 V8TRYCATCH_EXCEPTION_VOID(unsigned, cppValue, toUInt32(v8Value, EnforceRange, exceptionState), exceptionState);
1887 impl->setEnforcedRangeUnsignedLongAttr(cppValue);
1890 static void enforcedRangeUnsignedLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1892 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1893 TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeSetter(v8Value, info);
1894 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1897 static void enforcedRangeLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1899 v8::Handle<v8::Object> holder = info.Holder();
1900 TestObject* impl = V8TestObject::toNative(holder);
1901 v8SetReturnValue(info, static_cast<double>(impl->enforcedRangeLongLongAttr()));
1904 static void enforcedRangeLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1906 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1907 TestObjectV8Internal::enforcedRangeLongLongAttrAttributeGetter(info);
1908 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1911 static void enforcedRangeLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1913 v8::Handle<v8::Object> holder = info.Holder();
1914 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeLongLongAttr", "TestObject", holder, info.GetIsolate());
1915 TestObject* impl = V8TestObject::toNative(holder);
1916 V8TRYCATCH_EXCEPTION_VOID(long long, cppValue, toInt64(v8Value, EnforceRange, exceptionState), exceptionState);
1917 impl->setEnforcedRangeLongLongAttr(cppValue);
1920 static void enforcedRangeLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1922 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1923 TestObjectV8Internal::enforcedRangeLongLongAttrAttributeSetter(v8Value, info);
1924 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1927 static void enforcedRangeUnsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1929 v8::Handle<v8::Object> holder = info.Holder();
1930 TestObject* impl = V8TestObject::toNative(holder);
1931 v8SetReturnValue(info, static_cast<double>(impl->enforcedRangeUnsignedLongLongAttr()));
1934 static void enforcedRangeUnsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1936 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1937 TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetter(info);
1938 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1941 static void enforcedRangeUnsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1943 v8::Handle<v8::Object> holder = info.Holder();
1944 ExceptionState exceptionState(ExceptionState::SetterContext, "enforcedRangeUnsignedLongLongAttr", "TestObject", holder, info.GetIsolate());
1945 TestObject* impl = V8TestObject::toNative(holder);
1946 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, cppValue, toUInt64(v8Value, EnforceRange, exceptionState), exceptionState);
1947 impl->setEnforcedRangeUnsignedLongLongAttr(cppValue);
1950 static void enforcedRangeUnsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1952 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1953 TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetter(v8Value, info);
1954 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1957 #if ENABLE(Condition1)
1958 static void conditionalAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1960 v8::Handle<v8::Object> holder = info.Holder();
1961 TestObject* impl = V8TestObject::toNative(holder);
1962 v8SetReturnValueInt(info, impl->conditionalAttr1());
1964 #endif // ENABLE(Condition1)
1966 #if ENABLE(Condition1)
1967 static void conditionalAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1969 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1970 TestObjectV8Internal::conditionalAttr1AttributeGetter(info);
1971 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1973 #endif // ENABLE(Condition1)
1975 #if ENABLE(Condition1)
1976 static void conditionalAttr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1978 v8::Handle<v8::Object> holder = info.Holder();
1979 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAttr1", "TestObject", holder, info.GetIsolate());
1980 TestObject* impl = V8TestObject::toNative(holder);
1981 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
1982 impl->setConditionalAttr1(cppValue);
1984 #endif // ENABLE(Condition1)
1986 #if ENABLE(Condition1)
1987 static void conditionalAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1989 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1990 TestObjectV8Internal::conditionalAttr1AttributeSetter(v8Value, info);
1991 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1993 #endif // ENABLE(Condition1)
1995 #if ENABLE(Condition1) && ENABLE(Condition2)
1996 static void conditionalAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1998 v8::Handle<v8::Object> holder = info.Holder();
1999 TestObject* impl = V8TestObject::toNative(holder);
2000 v8SetReturnValueInt(info, impl->conditionalAttr2());
2002 #endif // ENABLE(Condition1) && ENABLE(Condition2)
2004 #if ENABLE(Condition1) && ENABLE(Condition2)
2005 static void conditionalAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2007 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2008 TestObjectV8Internal::conditionalAttr2AttributeGetter(info);
2009 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2011 #endif // ENABLE(Condition1) && ENABLE(Condition2)
2013 #if ENABLE(Condition1) && ENABLE(Condition2)
2014 static void conditionalAttr2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2016 v8::Handle<v8::Object> holder = info.Holder();
2017 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAttr2", "TestObject", holder, info.GetIsolate());
2018 TestObject* impl = V8TestObject::toNative(holder);
2019 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2020 impl->setConditionalAttr2(cppValue);
2022 #endif // ENABLE(Condition1) && ENABLE(Condition2)
2024 #if ENABLE(Condition1) && ENABLE(Condition2)
2025 static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2027 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2028 TestObjectV8Internal::conditionalAttr2AttributeSetter(v8Value, info);
2029 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2031 #endif // ENABLE(Condition1) && ENABLE(Condition2)
2033 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2034 static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2036 v8::Handle<v8::Object> holder = info.Holder();
2037 TestObject* impl = V8TestObject::toNative(holder);
2038 v8SetReturnValueInt(info, impl->conditionalAttr3());
2040 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2042 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2043 static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2045 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2046 TestObjectV8Internal::conditionalAttr3AttributeGetter(info);
2047 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2049 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2051 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2052 static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2054 v8::Handle<v8::Object> holder = info.Holder();
2055 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAttr3", "TestObject", holder, info.GetIsolate());
2056 TestObject* impl = V8TestObject::toNative(holder);
2057 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2058 impl->setConditionalAttr3(cppValue);
2060 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2062 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2063 static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2065 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2066 TestObjectV8Internal::conditionalAttr3AttributeSetter(v8Value, info);
2067 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2069 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2071 static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2073 v8::Handle<v8::Object> holder = info.Holder();
2074 TestObject* impl = V8TestObject::toNative(holder);
2075 v8SetReturnValue(info, impl->cachedAttribute1().v8Value());
2078 static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2080 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2081 TestObjectV8Internal::cachedAttribute1AttributeGetter(info);
2082 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2085 static void cachedAttribute2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2087 v8::Handle<v8::Object> holder = info.Holder();
2088 TestObject* impl = V8TestObject::toNative(holder);
2089 v8SetReturnValue(info, impl->cachedAttribute2().v8Value());
2092 static void cachedAttribute2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2094 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2095 TestObjectV8Internal::cachedAttribute2AttributeGetter(info);
2096 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2099 static void cachedDirtyableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2101 v8::Handle<v8::Object> holder = info.Holder();
2102 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedDirtyableAttribute");
2103 TestObject* impl = V8TestObject::toNative(holder);
2104 if (!impl->isValueDirty()) {
2105 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName);
2106 if (!v8Value.IsEmpty()) {
2107 v8SetReturnValue(info, v8Value);
2111 ScriptValue v8Value = impl->cachedDirtyableAttribute();
2112 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value.v8Value());
2113 v8SetReturnValue(info, v8Value.v8Value());
2116 static void cachedDirtyableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2118 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2119 TestObjectV8Internal::cachedDirtyableAttributeAttributeGetter(info);
2120 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2123 static void cachedDirtyableAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2125 v8::Handle<v8::Object> holder = info.Holder();
2126 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedDirtyableAttributeRaises");
2127 TestObject* impl = V8TestObject::toNative(holder);
2128 if (!impl->isValueDirty()) {
2129 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName);
2130 if (!v8Value.IsEmpty()) {
2131 v8SetReturnValue(info, v8Value);
2135 ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyableAttributeRaises", "TestObject", holder, info.GetIsolate());
2136 ScriptValue v8Value = impl->cachedDirtyableAttributeRaises(exceptionState);
2137 if (UNLIKELY(exceptionState.throwIfNeeded()))
2139 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value.v8Value());
2140 v8SetReturnValue(info, v8Value.v8Value());
2143 static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2146 TestObjectV8Internal::cachedDirtyableAttributeRaisesAttributeGetter(info);
2147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2150 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2152 v8::Handle<v8::Object> holder = info.Holder();
2153 TestObject* impl = V8TestObject::toNative(holder);
2154 v8SetReturnValue(info, impl->anyAttribute().v8Value());
2157 static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2159 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2160 TestObjectV8Internal::anyAttributeAttributeGetter(info);
2161 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2164 static void anyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2166 v8::Handle<v8::Object> holder = info.Holder();
2167 TestObject* impl = V8TestObject::toNative(holder);
2168 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(v8Value, info.GetIsolate()));
2169 impl->setAnyAttribute(cppValue);
2172 static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2175 TestObjectV8Internal::anyAttributeAttributeSetter(v8Value, info);
2176 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2179 static void callbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2181 v8::Handle<v8::Object> holder = info.Holder();
2182 TestObject* impl = V8TestObject::toNative(holder);
2183 v8SetReturnValue(info, impl->callbackFunctionAttribute().v8Value());
2186 static void callbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2188 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2189 TestObjectV8Internal::callbackFunctionAttributeAttributeGetter(info);
2190 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2193 static void callbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2195 v8::Handle<v8::Object> holder = info.Holder();
2196 TestObject* impl = V8TestObject::toNative(holder);
2197 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(v8Value, info.GetIsolate()));
2198 impl->setCallbackFunctionAttribute(cppValue);
2201 static void callbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2203 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2204 TestObjectV8Internal::callbackFunctionAttributeAttributeSetter(v8Value, info);
2205 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2208 static void enabledAtRuntimeAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2210 v8::Handle<v8::Object> holder = info.Holder();
2211 TestObject* impl = V8TestObject::toNative(holder);
2212 v8SetReturnValueInt(info, impl->enabledAtRuntimeAttr());
2215 static void enabledAtRuntimeAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2217 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2218 TestObjectV8Internal::enabledAtRuntimeAttrAttributeGetter(info);
2219 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2222 static void enabledAtRuntimeAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2224 v8::Handle<v8::Object> holder = info.Holder();
2225 ExceptionState exceptionState(ExceptionState::SetterContext, "enabledAtRuntimeAttr", "TestObject", holder, info.GetIsolate());
2226 TestObject* impl = V8TestObject::toNative(holder);
2227 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2228 impl->setEnabledAtRuntimeAttr(cppValue);
2231 static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2233 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2234 TestObjectV8Internal::enabledAtRuntimeAttrAttributeSetter(v8Value, info);
2235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2238 static void enabledPerContextAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2240 v8::Handle<v8::Object> holder = info.Holder();
2241 TestObject* impl = V8TestObject::toNative(holder);
2242 v8SetReturnValueInt(info, impl->enabledPerContextAttr());
2245 static void enabledPerContextAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2247 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2248 TestObjectV8Internal::enabledPerContextAttrAttributeGetter(info);
2249 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2252 static void enabledPerContextAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2254 v8::Handle<v8::Object> holder = info.Holder();
2255 ExceptionState exceptionState(ExceptionState::SetterContext, "enabledPerContextAttr", "TestObject", holder, info.GetIsolate());
2256 TestObject* impl = V8TestObject::toNative(holder);
2257 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2258 impl->setEnabledPerContextAttr(cppValue);
2261 static void enabledPerContextAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2263 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2264 TestObjectV8Internal::enabledPerContextAttrAttributeSetter(v8Value, info);
2265 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2268 static void floatArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2270 v8::Handle<v8::Object> holder = info.Holder();
2271 TestObject* impl = V8TestObject::toNative(holder);
2272 v8SetReturnValue(info, v8Array(impl->floatArray(), info.GetIsolate()));
2275 static void floatArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2277 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2278 TestObjectV8Internal::floatArrayAttributeGetter(info);
2279 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2282 static void floatArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2284 v8::Handle<v8::Object> holder = info.Holder();
2285 TestObject* impl = V8TestObject::toNative(holder);
2286 V8TRYCATCH_VOID(Vector<float>, cppValue, toNativeArray<float>(v8Value, 0, info.GetIsolate()));
2287 impl->setFloatArray(cppValue);
2290 static void floatArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2293 TestObjectV8Internal::floatArrayAttributeSetter(v8Value, info);
2294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2297 static void doubleArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2299 v8::Handle<v8::Object> holder = info.Holder();
2300 TestObject* impl = V8TestObject::toNative(holder);
2301 v8SetReturnValue(info, v8Array(impl->doubleArray(), info.GetIsolate()));
2304 static void doubleArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2306 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2307 TestObjectV8Internal::doubleArrayAttributeGetter(info);
2308 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2311 static void doubleArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2313 v8::Handle<v8::Object> holder = info.Holder();
2314 TestObject* impl = V8TestObject::toNative(holder);
2315 V8TRYCATCH_VOID(Vector<double>, cppValue, toNativeArray<double>(v8Value, 0, info.GetIsolate()));
2316 impl->setDoubleArray(cppValue);
2319 static void doubleArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2321 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2322 TestObjectV8Internal::doubleArrayAttributeSetter(v8Value, info);
2323 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2326 static void messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2328 v8::Handle<v8::Object> holder = info.Holder();
2329 TestObject* impl = V8TestObject::toNative(holder);
2330 v8SetReturnValue(info, v8Array(impl->messagePortArray(), info.GetIsolate()));
2333 static void messagePortArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2335 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2336 TestObjectV8Internal::messagePortArrayAttributeGetter(info);
2337 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2340 static void messagePortArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2342 v8::Handle<v8::Object> holder = info.Holder();
2343 TestObject* impl = V8TestObject::toNative(holder);
2344 V8TRYCATCH_VOID(Vector<RefPtr<MessagePort> >, cppValue, (toRefPtrNativeArray<MessagePort, V8MessagePort>(v8Value, 0, info.GetIsolate())));
2345 impl->setMessagePortArray(cppValue);
2348 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2350 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2351 TestObjectV8Internal::messagePortArrayAttributeSetter(v8Value, info);
2352 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2355 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2357 v8::Handle<v8::Object> holder = info.Holder();
2358 TestObject* impl = V8TestObject::toNative(holder);
2359 ExceptionState exceptionState(ExceptionState::GetterContext, "contentDocument", "TestObject", holder, info.GetIsolate());
2360 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->contentDocument(), exceptionState)) {
2361 v8SetReturnValueNull(info);
2362 exceptionState.throwIfNeeded();
2365 v8SetReturnValueFast(info, WTF::getPtr(impl->contentDocument()), impl);
2368 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2370 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2371 TestObjectV8Internal::contentDocumentAttributeGetter(info);
2372 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2375 static void strawberryAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2377 v8::Handle<v8::Object> holder = info.Holder();
2378 TestObject* impl = V8TestObject::toNative(holder);
2379 v8SetReturnValueInt(info, impl->blueberry());
2382 static void strawberryAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2384 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2385 TestObjectV8Internal::strawberryAttributeGetter(info);
2386 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2389 static void strawberryAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2391 v8::Handle<v8::Object> holder = info.Holder();
2392 ExceptionState exceptionState(ExceptionState::SetterContext, "strawberry", "TestObject", holder, info.GetIsolate());
2393 TestObject* impl = V8TestObject::toNative(holder);
2394 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2395 impl->setBlueberry(cppValue);
2398 static void strawberryAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2400 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2401 TestObjectV8Internal::strawberryAttributeSetter(v8Value, info);
2402 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2405 static void strictFloatAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2407 v8::Handle<v8::Object> holder = info.Holder();
2408 TestObject* impl = V8TestObject::toNative(holder);
2409 v8SetReturnValue(info, impl->strictFloat());
2412 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2414 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2415 TestObjectV8Internal::strictFloatAttributeGetter(info);
2416 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2419 static void strictFloatAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2421 v8::Handle<v8::Object> holder = info.Holder();
2422 TestObject* impl = V8TestObject::toNative(holder);
2423 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue()));
2424 impl->setStrictFloat(cppValue);
2427 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2429 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2430 TestObjectV8Internal::strictFloatAttributeSetter(v8Value, info);
2431 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2434 static void replaceableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2436 v8::Handle<v8::Object> holder = info.Holder();
2437 TestObject* impl = V8TestObject::toNative(holder);
2438 v8SetReturnValueInt(info, impl->replaceableAttribute());
2441 static void replaceableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2443 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2444 TestObjectV8Internal::replaceableAttributeAttributeGetter(info);
2445 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2448 static void nullableDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2450 v8::Handle<v8::Object> holder = info.Holder();
2451 TestObject* impl = V8TestObject::toNative(holder);
2452 bool isNull = false;
2453 double v8Value = impl->nullableDoubleAttribute(isNull);
2455 v8SetReturnValueNull(info);
2458 v8SetReturnValue(info, v8Value);
2461 static void nullableDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2463 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2464 TestObjectV8Internal::nullableDoubleAttributeAttributeGetter(info);
2465 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2468 static void nullableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2470 v8::Handle<v8::Object> holder = info.Holder();
2471 TestObject* impl = V8TestObject::toNative(holder);
2472 bool isNull = false;
2473 int v8Value = impl->nullableLongAttribute(isNull);
2475 v8SetReturnValueNull(info);
2478 v8SetReturnValueInt(info, v8Value);
2481 static void nullableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2483 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2484 TestObjectV8Internal::nullableLongAttributeAttributeGetter(info);
2485 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2488 static void nullableBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2490 v8::Handle<v8::Object> holder = info.Holder();
2491 TestObject* impl = V8TestObject::toNative(holder);
2492 bool isNull = false;
2493 bool v8Value = impl->nullableBooleanAttribute(isNull);
2495 v8SetReturnValueNull(info);
2498 v8SetReturnValueBool(info, v8Value);
2501 static void nullableBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2503 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2504 TestObjectV8Internal::nullableBooleanAttributeAttributeGetter(info);
2505 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2508 static void nullableStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2510 v8::Handle<v8::Object> holder = info.Holder();
2511 TestObject* impl = V8TestObject::toNative(holder);
2512 bool isNull = false;
2513 String v8Value = impl->nullableStringAttribute(isNull);
2515 v8SetReturnValueNull(info);
2518 v8SetReturnValueString(info, v8Value, info.GetIsolate());
2521 static void nullableStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2523 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2524 TestObjectV8Internal::nullableStringAttributeAttributeGetter(info);
2525 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2528 static void nullableLongSettableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2530 v8::Handle<v8::Object> holder = info.Holder();
2531 TestObject* impl = V8TestObject::toNative(holder);
2532 bool isNull = false;
2533 int v8Value = impl->nullableLongSettableAttribute(isNull);
2535 v8SetReturnValueNull(info);
2538 v8SetReturnValueInt(info, v8Value);
2541 static void nullableLongSettableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2543 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2544 TestObjectV8Internal::nullableLongSettableAttributeAttributeGetter(info);
2545 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2548 static void nullableLongSettableAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2550 v8::Handle<v8::Object> holder = info.Holder();
2551 ExceptionState exceptionState(ExceptionState::SetterContext, "nullableLongSettableAttribute", "TestObject", holder, info.GetIsolate());
2552 TestObject* impl = V8TestObject::toNative(holder);
2553 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2554 impl->setNullableLongSettableAttribute(cppValue);
2557 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2559 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2560 TestObjectV8Internal::nullableLongSettableAttributeAttributeSetter(v8Value, info);
2561 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2564 static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2566 v8::Handle<v8::Object> holder = info.Holder();
2567 TestObject* impl = V8TestObject::toNative(holder);
2568 RefPtr<TestObject> result(impl->perWorldReadOnlyAttribute());
2569 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get()))
2571 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate());
2572 if (!wrapper.IsEmpty()) {
2573 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "perWorldReadOnlyAttribute"), wrapper);
2574 v8SetReturnValue(info, wrapper);
2578 static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2580 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2581 TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetter(info);
2582 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2585 static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2587 v8::Handle<v8::Object> holder = info.Holder();
2588 TestObject* impl = V8TestObject::toNative(holder);
2589 RefPtr<TestObject> result(impl->perWorldReadOnlyAttribute());
2590 if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObject>(info.GetReturnValue(), result.get()))
2592 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate());
2593 if (!wrapper.IsEmpty()) {
2594 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "perWorldReadOnlyAttribute"), wrapper);
2595 v8SetReturnValue(info, wrapper);
2599 static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2601 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2602 TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetterForMainWorld(info);
2603 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2606 static void perWorldAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2608 v8::Handle<v8::Object> holder = info.Holder();
2609 TestObject* impl = V8TestObject::toNative(holder);
2610 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldAttribute()), impl);
2613 static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2615 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2616 TestObjectV8Internal::perWorldAttributeAttributeGetter(info);
2617 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2620 static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2622 v8::Handle<v8::Object> holder = info.Holder();
2623 TestObject* impl = V8TestObject::toNative(holder);
2624 V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
2625 impl->setPerWorldAttribute(WTF::getPtr(cppValue));
2628 static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2630 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2631 TestObjectV8Internal::perWorldAttributeAttributeSetter(v8Value, info);
2632 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2635 static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2637 v8::Handle<v8::Object> holder = info.Holder();
2638 TestObject* impl = V8TestObject::toNative(holder);
2639 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldAttribute()));
2642 static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2644 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2645 TestObjectV8Internal::perWorldAttributeAttributeGetterForMainWorld(info);
2646 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2649 static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2651 v8::Handle<v8::Object> holder = info.Holder();
2652 TestObject* impl = V8TestObject::toNative(holder);
2653 V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
2654 impl->setPerWorldAttribute(WTF::getPtr(cppValue));
2657 static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2659 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2660 TestObjectV8Internal::perWorldAttributeAttributeSetterForMainWorld(v8Value, info);
2661 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2664 static void activityLoggedAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2666 v8::Handle<v8::Object> holder = info.Holder();
2667 TestObject* impl = V8TestObject::toNative(holder);
2668 v8SetReturnValueInt(info, impl->activityLoggedAttr1());
2671 static void activityLoggedAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2673 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2674 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2675 if (contextData && contextData->activityLogger())
2676 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 0, 0, "Getter");
2677 TestObjectV8Internal::activityLoggedAttr1AttributeGetter(info);
2678 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2681 static void activityLoggedAttr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2683 v8::Handle<v8::Object> holder = info.Holder();
2684 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttr1", "TestObject", holder, info.GetIsolate());
2685 TestObject* impl = V8TestObject::toNative(holder);
2686 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2687 impl->setActivityLoggedAttr1(cppValue);
2690 static void activityLoggedAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2692 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2693 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2694 if (contextData && contextData->activityLogger()) {
2695 v8::Handle<v8::Value> loggerArg[] = { v8Value };
2696 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1, &loggerArg[0], "Setter");
2698 TestObjectV8Internal::activityLoggedAttr1AttributeSetter(v8Value, info);
2699 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2702 static void activityLoggedAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2704 v8::Handle<v8::Object> holder = info.Holder();
2705 TestObject* impl = V8TestObject::toNative(holder);
2706 v8SetReturnValueInt(info, impl->activityLoggedAttr2());
2709 static void activityLoggedAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2711 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2712 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2713 if (contextData && contextData->activityLogger())
2714 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0, 0, "Getter");
2715 TestObjectV8Internal::activityLoggedAttr2AttributeGetter(info);
2716 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2719 static void activityLoggedAttr2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2721 v8::Handle<v8::Object> holder = info.Holder();
2722 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttr2", "TestObject", holder, info.GetIsolate());
2723 TestObject* impl = V8TestObject::toNative(holder);
2724 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2725 impl->setActivityLoggedAttr2(cppValue);
2728 static void activityLoggedAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2730 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2731 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2732 if (contextData && contextData->activityLogger()) {
2733 v8::Handle<v8::Value> loggerArg[] = { v8Value };
2734 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter");
2736 TestObjectV8Internal::activityLoggedAttr2AttributeSetter(v8Value, info);
2737 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2740 static void activityLoggedAttr2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2742 v8::Handle<v8::Object> holder = info.Holder();
2743 TestObject* impl = V8TestObject::toNative(holder);
2744 v8SetReturnValueInt(info, impl->activityLoggedAttr2());
2747 static void activityLoggedAttr2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2749 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2750 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2751 if (contextData && contextData->activityLogger())
2752 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0, 0, "Getter");
2753 TestObjectV8Internal::activityLoggedAttr2AttributeGetterForMainWorld(info);
2754 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2757 static void activityLoggedAttr2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2759 v8::Handle<v8::Object> holder = info.Holder();
2760 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttr2", "TestObject", holder, info.GetIsolate());
2761 TestObject* impl = V8TestObject::toNative(holder);
2762 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2763 impl->setActivityLoggedAttr2(cppValue);
2766 static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2768 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2769 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2770 if (contextData && contextData->activityLogger()) {
2771 v8::Handle<v8::Value> loggerArg[] = { v8Value };
2772 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter");
2774 TestObjectV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(v8Value, info);
2775 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2778 static void activityLoggedInIsolatedWorldsAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2780 v8::Handle<v8::Object> holder = info.Holder();
2781 TestObject* impl = V8TestObject::toNative(holder);
2782 v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttr());
2785 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2787 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2788 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2789 if (contextData && contextData->activityLogger())
2790 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 0, 0, "Getter");
2791 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetter(info);
2792 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2795 static void activityLoggedInIsolatedWorldsAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2797 v8::Handle<v8::Object> holder = info.Holder();
2798 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttr", "TestObject", holder, info.GetIsolate());
2799 TestObject* impl = V8TestObject::toNative(holder);
2800 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2801 impl->setActivityLoggedInIsolatedWorldsAttr(cppValue);
2804 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2806 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2807 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2808 if (contextData && contextData->activityLogger()) {
2809 v8::Handle<v8::Value> loggerArg[] = { v8Value };
2810 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 1, &loggerArg[0], "Setter");
2812 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetter(v8Value, info);
2813 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2816 static void activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2818 v8::Handle<v8::Object> holder = info.Holder();
2819 TestObject* impl = V8TestObject::toNative(holder);
2820 v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttr());
2823 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2825 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2826 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(info);
2827 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2830 static void activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2832 v8::Handle<v8::Object> holder = info.Holder();
2833 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttr", "TestObject", holder, info.GetIsolate());
2834 TestObject* impl = V8TestObject::toNative(holder);
2835 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2836 impl->setActivityLoggedInIsolatedWorldsAttr(cppValue);
2839 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2841 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2842 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8Value, info);
2843 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2846 static void activityLoggedAttrSetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2848 v8::Handle<v8::Object> holder = info.Holder();
2849 TestObject* impl = V8TestObject::toNative(holder);
2850 v8SetReturnValueInt(info, impl->activityLoggedAttrSetter1());
2853 static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2855 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2856 TestObjectV8Internal::activityLoggedAttrSetter1AttributeGetter(info);
2857 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2860 static void activityLoggedAttrSetter1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2862 v8::Handle<v8::Object> holder = info.Holder();
2863 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrSetter1", "TestObject", holder, info.GetIsolate());
2864 TestObject* impl = V8TestObject::toNative(holder);
2865 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2866 impl->setActivityLoggedAttrSetter1(cppValue);
2869 static void activityLoggedAttrSetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2871 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2872 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2873 if (contextData && contextData->activityLogger()) {
2874 v8::Handle<v8::Value> loggerArg[] = { v8Value };
2875 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1", 1, &loggerArg[0], "Setter");
2877 TestObjectV8Internal::activityLoggedAttrSetter1AttributeSetter(v8Value, info);
2878 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2881 static void activityLoggedAttrSetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2883 v8::Handle<v8::Object> holder = info.Holder();
2884 TestObject* impl = V8TestObject::toNative(holder);
2885 v8SetReturnValueInt(info, impl->activityLoggedAttrSetter2());
2888 static void activityLoggedAttrSetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2890 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2891 TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetter(info);
2892 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2895 static void activityLoggedAttrSetter2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2897 v8::Handle<v8::Object> holder = info.Holder();
2898 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrSetter2", "TestObject", holder, info.GetIsolate());
2899 TestObject* impl = V8TestObject::toNative(holder);
2900 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2901 impl->setActivityLoggedAttrSetter2(cppValue);
2904 static void activityLoggedAttrSetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2906 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2907 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2908 if (contextData && contextData->activityLogger()) {
2909 v8::Handle<v8::Value> loggerArg[] = { v8Value };
2910 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter");
2912 TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetter(v8Value, info);
2913 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2916 static void activityLoggedAttrSetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2918 v8::Handle<v8::Object> holder = info.Holder();
2919 TestObject* impl = V8TestObject::toNative(holder);
2920 v8SetReturnValueInt(info, impl->activityLoggedAttrSetter2());
2923 static void activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2925 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2926 TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetterForMainWorld(info);
2927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2930 static void activityLoggedAttrSetter2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2932 v8::Handle<v8::Object> holder = info.Holder();
2933 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrSetter2", "TestObject", holder, info.GetIsolate());
2934 TestObject* impl = V8TestObject::toNative(holder);
2935 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2936 impl->setActivityLoggedAttrSetter2(cppValue);
2939 static void activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2941 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2942 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2943 if (contextData && contextData->activityLogger()) {
2944 v8::Handle<v8::Value> loggerArg[] = { v8Value };
2945 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter");
2947 TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetterForMainWorld(v8Value, info);
2948 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2951 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2953 v8::Handle<v8::Object> holder = info.Holder();
2954 TestObject* impl = V8TestObject::toNative(holder);
2955 v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrSetter());
2958 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2960 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2961 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(info);
2962 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2965 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2967 v8::Handle<v8::Object> holder = info.Holder();
2968 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttrSetter", "TestObject", holder, info.GetIsolate());
2969 TestObject* impl = V8TestObject::toNative(holder);
2970 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
2971 impl->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue);
2974 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2976 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2977 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2978 if (contextData && contextData->activityLogger()) {
2979 v8::Handle<v8::Value> loggerArg[] = { v8Value };
2980 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrSetter", 1, &loggerArg[0], "Setter");
2982 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8Value, info);
2983 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2986 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2988 v8::Handle<v8::Object> holder = info.Holder();
2989 TestObject* impl = V8TestObject::toNative(holder);
2990 v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrSetter());
2993 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2995 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2996 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(info);
2997 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3000 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3002 v8::Handle<v8::Object> holder = info.Holder();
3003 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttrSetter", "TestObject", holder, info.GetIsolate());
3004 TestObject* impl = V8TestObject::toNative(holder);
3005 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3006 impl->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue);
3009 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3011 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3012 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8Value, info);
3013 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3016 static void activityLoggedAttrGetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3018 v8::Handle<v8::Object> holder = info.Holder();
3019 TestObject* impl = V8TestObject::toNative(holder);
3020 v8SetReturnValueInt(info, impl->activityLoggedAttrGetter1());
3023 static void activityLoggedAttrGetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3025 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3026 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
3027 if (contextData && contextData->activityLogger())
3028 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter1", 0, 0, "Getter");
3029 TestObjectV8Internal::activityLoggedAttrGetter1AttributeGetter(info);
3030 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3033 static void activityLoggedAttrGetter1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3035 v8::Handle<v8::Object> holder = info.Holder();
3036 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrGetter1", "TestObject", holder, info.GetIsolate());
3037 TestObject* impl = V8TestObject::toNative(holder);
3038 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3039 impl->setActivityLoggedAttrGetter1(cppValue);
3042 static void activityLoggedAttrGetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3044 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3045 TestObjectV8Internal::activityLoggedAttrGetter1AttributeSetter(v8Value, info);
3046 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3049 static void activityLoggedAttrGetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3051 v8::Handle<v8::Object> holder = info.Holder();
3052 TestObject* impl = V8TestObject::toNative(holder);
3053 v8SetReturnValueInt(info, impl->activityLoggedAttrGetter2());
3056 static void activityLoggedAttrGetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3058 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3059 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
3060 if (contextData && contextData->activityLogger())
3061 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2", 0, 0, "Getter");
3062 TestObjectV8Internal::activityLoggedAttrGetter2AttributeGetter(info);
3063 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3066 static void activityLoggedAttrGetter2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3068 v8::Handle<v8::Object> holder = info.Holder();
3069 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrGetter2", "TestObject", holder, info.GetIsolate());
3070 TestObject* impl = V8TestObject::toNative(holder);
3071 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3072 impl->setActivityLoggedAttrGetter2(cppValue);
3075 static void activityLoggedAttrGetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3077 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3078 TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetter(v8Value, info);
3079 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3082 static void activityLoggedAttrGetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
3084 v8::Handle<v8::Object> holder = info.Holder();
3085 TestObject* impl = V8TestObject::toNative(holder);
3086 v8SetReturnValueInt(info, impl->activityLoggedAttrGetter2());
3089 static void activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3091 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3092 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
3093 if (contextData && contextData->activityLogger())
3094 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2", 0, 0, "Getter");
3095 TestObjectV8Internal::activityLoggedAttrGetter2AttributeGetterForMainWorld(info);
3096 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3099 static void activityLoggedAttrGetter2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3101 v8::Handle<v8::Object> holder = info.Holder();
3102 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedAttrGetter2", "TestObject", holder, info.GetIsolate());
3103 TestObject* impl = V8TestObject::toNative(holder);
3104 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3105 impl->setActivityLoggedAttrGetter2(cppValue);
3108 static void activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3111 TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetterForMainWorld(v8Value, info);
3112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3115 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3117 v8::Handle<v8::Object> holder = info.Holder();
3118 TestObject* impl = V8TestObject::toNative(holder);
3119 v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrGetter());
3122 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3125 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
3126 if (contextData && contextData->activityLogger())
3127 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrGetter", 0, 0, "Getter");
3128 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(info);
3129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3132 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3134 v8::Handle<v8::Object> holder = info.Holder();
3135 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttrGetter", "TestObject", holder, info.GetIsolate());
3136 TestObject* impl = V8TestObject::toNative(holder);
3137 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3138 impl->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue);
3141 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3143 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3144 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8Value, info);
3145 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3148 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
3150 v8::Handle<v8::Object> holder = info.Holder();
3151 TestObject* impl = V8TestObject::toNative(holder);
3152 v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrGetter());
3155 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3157 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3158 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(info);
3159 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3162 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3164 v8::Handle<v8::Object> holder = info.Holder();
3165 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggedInIsolatedWorldsAttrGetter", "TestObject", holder, info.GetIsolate());
3166 TestObject* impl = V8TestObject::toNative(holder);
3167 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3168 impl->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue);
3171 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3173 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3174 TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8Value, info);
3175 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3178 static void deprecatedStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3180 v8SetReturnValueInt(info, TestObject::deprecatedStaticReadOnlyAttr());
3183 static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3185 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3186 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticReadonlyAttribute);
3187 TestObjectV8Internal::deprecatedStaticReadOnlyAttrAttributeGetter(info);
3188 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3191 static void deprecatedStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3193 v8SetReturnValueInt(info, TestObject::deprecatedStaticAttr());
3196 static void deprecatedStaticAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3198 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3199 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticAttribute);
3200 TestObjectV8Internal::deprecatedStaticAttrAttributeGetter(info);
3201 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3204 static void deprecatedStaticAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3206 ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedStaticAttr", "TestObject", holder, info.GetIsolate());
3207 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3208 TestObject::setDeprecatedStaticAttr(cppValue);
3211 static void deprecatedStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3213 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3214 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticAttribute);
3215 TestObjectV8Internal::deprecatedStaticAttrAttributeSetter(v8Value, info);
3216 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3219 static void deprecatedReadonlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3221 v8::Handle<v8::Object> holder = info.Holder();
3222 TestObject* impl = V8TestObject::toNative(holder);
3223 v8SetReturnValueInt(info, impl->deprecatedReadonlyAttr());
3226 static void deprecatedReadonlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3228 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3229 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::ReadonlyAttribute);
3230 TestObjectV8Internal::deprecatedReadonlyAttrAttributeGetter(info);
3231 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3234 static void deprecatedAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3236 v8::Handle<v8::Object> holder = info.Holder();
3237 TestObject* impl = V8TestObject::toNative(holder);
3238 v8SetReturnValueInt(info, impl->deprecatedAttr());
3241 static void deprecatedAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3243 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3244 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::Attribute);
3245 TestObjectV8Internal::deprecatedAttrAttributeGetter(info);
3246 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3249 static void deprecatedAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3251 v8::Handle<v8::Object> holder = info.Holder();
3252 ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedAttr", "TestObject", holder, info.GetIsolate());
3253 TestObject* impl = V8TestObject::toNative(holder);
3254 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3255 impl->setDeprecatedAttr(cppValue);
3258 static void deprecatedAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3260 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3261 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::Attribute);
3262 TestObjectV8Internal::deprecatedAttrAttributeSetter(v8Value, info);
3263 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3266 static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3268 v8::Handle<v8::Object> holder = info.Holder();
3269 TestObject* impl = V8TestObject::toNative(holder);
3270 v8SetReturnValueFast(info, WTF::getPtr(impl->location()), impl);
3273 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3275 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3276 TestObjectV8Internal::locationAttributeGetter(info);
3277 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3280 static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3282 v8::Handle<v8::Object> holder = info.Holder();
3283 TestObject* proxyImpl = V8TestObject::toNative(holder);
3284 RefPtr<TestNode> impl = WTF::getPtr(proxyImpl->location());
3287 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
3288 impl->setHref(cppValue);
3291 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3293 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3294 TestObjectV8Internal::locationAttributeSetter(v8Value, info);
3295 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3298 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3300 v8::Handle<v8::Object> holder = info.Holder();
3301 TestObject* impl = V8TestObject::toNative(holder);
3302 v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithException()), impl);
3305 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3307 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3308 TestObjectV8Internal::locationWithExceptionAttributeGetter(info);
3309 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3312 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3314 v8::Handle<v8::Object> holder = info.Holder();
3315 TestObject* proxyImpl = V8TestObject::toNative(holder);
3316 RefPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithException());
3319 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
3320 impl->setHrefThrows(cppValue);
3323 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3325 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3326 TestObjectV8Internal::locationWithExceptionAttributeSetter(v8Value, info);
3327 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3330 static void TestObjectConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3332 v8::Handle<v8::Value> data = info.Data();
3333 ASSERT(data->IsExternal());
3334 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
3335 if (!perContextData)
3337 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
3340 static void TestSubObjMeasuredConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info)
3342 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3343 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature);
3344 TestObjectV8Internal::TestObjectConstructorGetter(property, info);
3345 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3348 static void deprecatedConstructorConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info)
3350 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3351 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::ConstructorAttribute);
3352 TestObjectV8Internal::TestObjectConstructorGetter(property, info);
3353 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3356 static void TestObjectReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3358 info.This()->ForceSet(name, v8Value);
3361 static void TestObjectReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3363 TestObjectV8Internal::TestObjectReplaceableAttributeSetter(name, v8Value, info);
3366 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3368 TestObject* impl = V8TestObject::toNative(info.Holder());
3372 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3374 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3375 TestObjectV8Internal::voidMethodMethod(info);
3376 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3379 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3381 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodWithArgs", "TestObject", info.Holder(), info.GetIsolate());
3382 if (UNLIKELY(info.Length() < 3)) {
3383 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length()));
3384 exceptionState.throwIfNeeded();
3387 TestObject* impl = V8TestObject::toNative(info.Holder());
3388 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
3389 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
3390 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[2]));
3391 impl->voidMethodWithArgs(longArg, strArg, objArg);
3394 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3397 TestObjectV8Internal::voidMethodWithArgsMethod(info);
3398 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3401 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3403 TestObject* impl = V8TestObject::toNative(info.Holder());
3404 v8SetReturnValueInt(info, impl->longMethod());
3407 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3409 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3410 TestObjectV8Internal::longMethodMethod(info);
3411 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3414 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3416 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodWithArgs", "TestObject", info.Holder(), info.GetIsolate());
3417 if (UNLIKELY(info.Length() < 3)) {
3418 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length()));
3419 exceptionState.throwIfNeeded();
3422 TestObject* impl = V8TestObject::toNative(info.Holder());
3423 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
3424 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
3425 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[2]));
3426 v8SetReturnValueInt(info, impl->longMethodWithArgs(longArg, strArg, objArg));
3429 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3431 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3432 TestObjectV8Internal::longMethodWithArgsMethod(info);
3433 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3436 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3438 TestObject* impl = V8TestObject::toNative(info.Holder());
3439 v8SetReturnValue(info, impl->objMethod());
3442 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3444 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3445 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature);
3446 TestObjectV8Internal::objMethodMethod(info);
3447 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3450 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3452 ExceptionState exceptionState(ExceptionState::ExecutionContext, "objMethodWithArgs", "TestObject", info.Holder(), info.GetIsolate());
3453 if (UNLIKELY(info.Length() < 3)) {
3454 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length()));
3455 exceptionState.throwIfNeeded();
3458 TestObject* impl = V8TestObject::toNative(info.Holder());
3459 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
3460 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
3461 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[2]));
3462 v8SetReturnValue(info, impl->objMethodWithArgs(longArg, strArg, objArg));
3465 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3467 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3468 TestObjectV8Internal::objMethodWithArgsMethod(info);
3469 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3472 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3474 if (UNLIKELY(info.Length() < 1)) {
3475 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3478 TestObject* impl = V8TestObject::toNative(info.Holder());
3479 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNativeArray<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate())));
3480 impl->methodWithSequenceArg(sequenceArg);
3483 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3485 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3486 TestObjectV8Internal::methodWithSequenceArgMethod(info);
3487 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3490 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3492 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodReturningSequence", "TestObject", info.Holder(), info.GetIsolate());
3493 if (UNLIKELY(info.Length() < 1)) {
3494 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
3495 exceptionState.throwIfNeeded();
3498 TestObject* impl = V8TestObject::toNative(info.Holder());
3499 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
3500 v8SetReturnValue(info, v8Array(impl->methodReturningSequence(longArg), info.GetIsolate()));
3503 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3505 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3506 TestObjectV8Internal::methodReturningSequenceMethod(info);
3507 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3510 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3512 if (UNLIKELY(info.Length() < 1)) {
3513 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3516 TestObject* impl = V8TestObject::toNative(info.Holder());
3517 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]);
3518 String string = enumArg;
3519 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) {
3520 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.GetIsolate());
3523 impl->methodWithEnumArg(enumArg);
3526 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3528 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3529 TestObjectV8Internal::methodWithEnumArgMethod(info);
3530 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3533 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3535 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatRequiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate());
3536 if (UNLIKELY(info.Length() < 2)) {
3537 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
3538 exceptionState.throwIfNeeded();
3541 TestObject* impl = V8TestObject::toNative(info.Holder());
3542 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3543 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
3544 RefPtr<TestObject> result = impl->methodThatRequiresAllArgsAndThrows(strArg, objArg, exceptionState);
3545 if (exceptionState.throwIfNeeded())
3547 v8SetReturnValue(info, result.release());
3550 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3552 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3553 TestObjectV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info);
3554 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3557 static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3559 if (UNLIKELY(info.Length() < 1)) {
3560 throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListener", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3563 TestObject* impl = V8TestObject::toNative(info.Holder());
3564 V8TRYCATCH_VOID(RefPtrWillBeRawPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(ScriptValue(info[0], info.GetIsolate())));
3565 impl->methodQueryListListener(listener);
3568 static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3570 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3571 TestObjectV8Internal::methodQueryListListenerMethod(info);
3572 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3575 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3577 ExceptionState exceptionState(ExceptionState::ExecutionContext, "serializedValue", "TestObject", info.Holder(), info.GetIsolate());
3578 if (UNLIKELY(info.Length() < 1)) {
3579 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
3580 exceptionState.throwIfNeeded();
3583 TestObject* impl = V8TestObject::toNative(info.Holder());
3584 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(info[0], 0, 0, exceptionState, info.GetIsolate());
3585 if (exceptionState.throwIfNeeded())
3587 impl->serializedValue(serializedArg);
3590 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3592 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3593 TestObjectV8Internal::serializedValueMethod(info);
3594 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3597 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3599 if (UNLIKELY(info.Length() < 1)) {
3600 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3603 TestObject* impl = V8TestObject::toNative(info.Holder());
3604 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate()));
3605 if (!oo.isUndefinedOrNull() && !oo.isObject()) {
3606 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 1 ('oo') is not an object."), info.GetIsolate());
3609 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate()));
3610 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) {
3611 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 2 ('ooo') is not an object."), info.GetIsolate());
3614 impl->optionsObject(oo, ooo);
3617 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3619 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3620 TestObjectV8Internal::optionsObjectMethod(info);
3621 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3624 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3626 if (UNLIKELY(info.Length() < 1)) {
3627 throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3630 TestObject* impl = V8TestObject::toNative(info.Holder());
3631 V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0], 1, info.GetIsolate()));
3632 impl->optionsObjectList(list);
3635 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3638 TestObjectV8Internal::optionsObjectListMethod(info);
3639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3642 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3644 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithException", "TestObject", info.Holder(), info.GetIsolate());
3645 TestObject* impl = V8TestObject::toNative(info.Holder());
3646 impl->methodWithException(exceptionState);
3647 if (exceptionState.throwIfNeeded())
3651 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3653 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3654 TestObjectV8Internal::methodWithExceptionMethod(info);
3655 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3658 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3660 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3661 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::CustomTestFeature);
3662 V8TestObject::customMethodMethodCustom(info);
3663 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3666 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3668 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3669 V8TestObject::customMethodWithArgsMethodCustom(info);
3670 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3673 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3675 TestObject* impl = V8TestObject::toNative(info.Holder());
3676 ScriptState* currentState = ScriptState::current();
3679 ScriptState& state = *currentState;
3680 impl->withScriptStateVoid(&state);
3681 if (state.hadException()) {
3682 v8::Local<v8::Value> exception = state.exception();
3683 state.clearException();
3684 throwError(exception, info.GetIsolate());
3689 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3691 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3692 TestObjectV8Internal::withScriptStateVoidMethod(info);
3693 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3696 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3698 TestObject* impl = V8TestObject::toNative(info.Holder());
3699 ScriptState* currentState = ScriptState::current();
3702 ScriptState& state = *currentState;
3703 RefPtr<TestObject> result = impl->withScriptStateObj(&state);
3704 if (state.hadException()) {
3705 v8::Local<v8::Value> exception = state.exception();
3706 state.clearException();
3707 throwError(exception, info.GetIsolate());
3710 v8SetReturnValue(info, result.release());
3713 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3715 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3716 TestObjectV8Internal::withScriptStateObjMethod(info);
3717 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3720 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3722 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateVoidException", "TestObject", info.Holder(), info.GetIsolate());
3723 TestObject* impl = V8TestObject::toNative(info.Holder());
3724 ScriptState* currentState = ScriptState::current();
3727 ScriptState& state = *currentState;
3728 impl->withScriptStateVoidException(&state, exceptionState);
3729 if (exceptionState.throwIfNeeded())
3731 if (state.hadException()) {
3732 v8::Local<v8::Value> exception = state.exception();
3733 state.clearException();
3734 throwError(exception, info.GetIsolate());
3739 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3741 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3742 TestObjectV8Internal::withScriptStateVoidExceptionMethod(info);
3743 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3746 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3748 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate());
3749 TestObject* impl = V8TestObject::toNative(info.Holder());
3750 ScriptState* currentState = ScriptState::current();
3753 ScriptState& state = *currentState;
3754 RefPtr<TestObject> result = impl->withScriptStateObjException(&state, exceptionState);
3755 if (exceptionState.throwIfNeeded())
3757 if (state.hadException()) {
3758 v8::Local<v8::Value> exception = state.exception();
3759 state.clearException();
3760 throwError(exception, info.GetIsolate());
3763 v8SetReturnValue(info, result.release());
3766 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3768 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3769 TestObjectV8Internal::withScriptStateObjExceptionMethod(info);
3770 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3773 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3775 TestObject* impl = V8TestObject::toNative(info.Holder());
3776 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
3777 impl->withExecutionContext(scriptContext);
3780 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3782 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3783 TestObjectV8Internal::withExecutionContextMethod(info);
3784 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3787 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3789 TestObject* impl = V8TestObject::toNative(info.Holder());
3790 ScriptState* currentState = ScriptState::current();
3793 ScriptState& state = *currentState;
3794 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
3795 impl->withExecutionContextAndScriptState(&state, scriptContext);
3796 if (state.hadException()) {
3797 v8::Local<v8::Value> exception = state.exception();
3798 state.clearException();
3799 throwError(exception, info.GetIsolate());
3804 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3806 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3807 TestObjectV8Internal::withExecutionContextAndScriptStateMethod(info);
3808 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3811 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3813 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecutionContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate());
3814 TestObject* impl = V8TestObject::toNative(info.Holder());
3815 ScriptState* currentState = ScriptState::current();
3818 ScriptState& state = *currentState;
3819 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
3820 RefPtr<TestObject> result = impl->withExecutionContextAndScriptStateObjException(&state, scriptContext, exceptionState);
3821 if (exceptionState.throwIfNeeded())
3823 if (state.hadException()) {
3824 v8::Local<v8::Value> exception = state.exception();
3825 state.clearException();
3826 throwError(exception, info.GetIsolate());
3829 v8SetReturnValue(info, result.release());
3832 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3834 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3835 TestObjectV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info);
3836 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3839 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3841 TestObject* impl = V8TestObject::toNative(info.Holder());
3842 ScriptState* currentState = ScriptState::current();
3845 ScriptState& state = *currentState;
3846 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
3847 RefPtr<TestObject> result = impl->withExecutionContextAndScriptStateWithSpaces(&state, scriptContext);
3848 if (state.hadException()) {
3849 v8::Local<v8::Value> exception = state.exception();
3850 state.clearException();
3851 throwError(exception, info.GetIsolate());
3854 v8SetReturnValue(info, result.release());
3857 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3859 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3860 TestObjectV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info);
3861 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3864 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3866 TestObject* impl = V8TestObject::toNative(info.Holder());
3867 impl->withActiveWindowAndFirstWindow(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()));
3870 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3872 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3873 TestObjectV8Internal::withActiveWindowAndFirstWindowMethod(info);
3874 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3877 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3879 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithOptionalArg", "TestObject", info.Holder(), info.GetIsolate());
3880 TestObject* impl = V8TestObject::toNative(info.Holder());
3881 if (UNLIKELY(info.Length() <= 0)) {
3882 impl->methodWithOptionalArg();
3885 V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[0], exceptionState), exceptionState);
3886 impl->methodWithOptionalArg(opt);
3889 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3891 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3892 TestObjectV8Internal::methodWithOptionalArgMethod(info);
3893 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3896 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3898 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithNonOptionalArgAndOptionalArg", "TestObject", info.Holder(), info.GetIsolate());
3899 if (UNLIKELY(info.Length() < 1)) {
3900 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
3901 exceptionState.throwIfNeeded();
3904 TestObject* impl = V8TestObject::toNative(info.Holder());
3905 V8TRYCATCH_EXCEPTION_VOID(int, nonOpt, toInt32(info[0], exceptionState), exceptionState);
3906 if (UNLIKELY(info.Length() <= 1)) {
3907 impl->methodWithNonOptionalArgAndOptionalArg(nonOpt);
3910 V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[1], exceptionState), exceptionState);
3911 impl->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
3914 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3916 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3917 TestObjectV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info);
3918 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3921 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3923 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithNonOptionalArgAndTwoOptionalArgs", "TestObject", info.Holder(), info.GetIsolate());
3924 if (UNLIKELY(info.Length() < 1)) {
3925 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
3926 exceptionState.throwIfNeeded();
3929 TestObject* impl = V8TestObject::toNative(info.Holder());
3930 V8TRYCATCH_EXCEPTION_VOID(int, nonOpt, toInt32(info[0], exceptionState), exceptionState);
3931 if (UNLIKELY(info.Length() <= 1)) {
3932 impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
3935 V8TRYCATCH_EXCEPTION_VOID(int, opt1, toInt32(info[1], exceptionState), exceptionState);
3936 if (UNLIKELY(info.Length() <= 2)) {
3937 impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
3940 V8TRYCATCH_EXCEPTION_VOID(int, opt2, toInt32(info[2], exceptionState), exceptionState);
3941 impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
3944 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3946 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3947 TestObjectV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info);
3948 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3951 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3953 TestObject* impl = V8TestObject::toNative(info.Holder());
3954 if (UNLIKELY(info.Length() <= 0)) {
3955 impl->methodWithOptionalString();
3958 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
3959 impl->methodWithOptionalString(str);
3962 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3964 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3965 TestObjectV8Internal::methodWithOptionalStringMethod(info);
3966 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3969 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3971 TestObject* impl = V8TestObject::toNative(info.Holder());
3972 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
3973 impl->methodWithOptionalStringIsUndefined(str);
3976 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3978 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3979 TestObjectV8Internal::methodWithOptionalStringIsUndefinedMethod(info);
3980 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3983 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3985 TestObject* impl = V8TestObject::toNative(info.Holder());
3986 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull(info, 0));
3987 impl->methodWithOptionalStringIsNullString(str);
3990 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3992 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3993 TestObjectV8Internal::methodWithOptionalStringIsNullStringMethod(info);
3994 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3997 static void methodWithCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3999 if (UNLIKELY(info.Length() < 1)) {
4000 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4003 TestObject* impl = V8TestObject::toNative(info.Holder());
4004 if (info.Length() <= 0 || !info[0]->IsFunction()) {
4005 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
4008 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4009 impl->methodWithCallbackInterfaceArg(callbackInterface.release());
4012 static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4014 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4015 TestObjectV8Internal::methodWithCallbackInterfaceArgMethod(info);
4016 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4019 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4021 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithNonCallbackArgAndCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsolate());
4022 if (UNLIKELY(info.Length() < 2)) {
4023 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
4024 exceptionState.throwIfNeeded();
4027 TestObject* impl = V8TestObject::toNative(info.Holder());
4028 V8TRYCATCH_EXCEPTION_VOID(int, nonCallback, toInt32(info[0], exceptionState), exceptionState);
4029 if (info.Length() <= 1 || !info[1]->IsFunction()) {
4030 exceptionState.throwTypeError("The callback provided as parameter 2 is not a function.");
4031 exceptionState.throwIfNeeded();
4034 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[1]), currentExecutionContext(info.GetIsolate()));
4035 impl->methodWithNonCallbackArgAndCallbackInterfaceArg(nonCallback, callbackInterface.release());
4038 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4040 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4041 TestObjectV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethod(info);
4042 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4045 static void methodWithCallbackInterfaceAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4047 TestObject* impl = V8TestObject::toNative(info.Holder());
4048 OwnPtr<TestCallbackInterface> callbackInterface;
4049 if (info.Length() > 0 && !isUndefinedOrNull(info[0])) {
4050 if (!info[0]->IsFunction()) {
4051 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInterfaceAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
4054 callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4056 impl->methodWithCallbackInterfaceAndOptionalArg(callbackInterface.release());
4059 static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4061 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4062 TestObjectV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info);
4063 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4066 static void methodWithNullableCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4068 if (UNLIKELY(info.Length() < 1)) {
4069 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4072 TestObject* impl = V8TestObject::toNative(info.Holder());
4073 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) {
4074 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
4077 OwnPtr<TestCallbackInterface> callbackInterface = info[0]->IsNull() ? nullptr : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4078 impl->methodWithNullableCallbackInterfaceArg(callbackInterface.release());
4081 static void methodWithNullableCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4083 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4084 TestObjectV8Internal::methodWithNullableCallbackInterfaceArgMethod(info);
4085 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4088 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4090 OwnPtr<TestCallbackInterface> callbackInterface;
4091 if (info.Length() > 0 && !isUndefinedOrNull(info[0])) {
4092 if (!info[0]->IsFunction()) {
4093 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
4096 callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4098 TestObject::staticMethodWithCallbackAndOptionalArg(callbackInterface.release());
4101 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4103 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4104 TestObjectV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info);
4105 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4108 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4110 if (UNLIKELY(info.Length() < 1)) {
4111 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4114 if (info.Length() <= 0 || !info[0]->IsFunction()) {
4115 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
4118 OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4119 TestObject::staticMethodWithCallbackArg(callbackInterface.release());
4122 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4125 TestObjectV8Internal::staticMethodWithCallbackArgMethod(info);
4126 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4129 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4131 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeInt8", "TestObject", info.Holder(), info.GetIsolate());
4132 if (UNLIKELY(info.Length() < 1)) {
4133 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4134 exceptionState.throwIfNeeded();
4137 TestObject* impl = V8TestObject::toNative(info.Holder());
4138 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt8(info[0], EnforceRange, exceptionState), exceptionState);
4139 impl->methodWithEnforceRangeInt8(value);
4142 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4145 TestObjectV8Internal::methodWithEnforceRangeInt8Method(info);
4146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4149 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4151 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt8", "TestObject", info.Holder(), info.GetIsolate());
4152 if (UNLIKELY(info.Length() < 1)) {
4153 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4154 exceptionState.throwIfNeeded();
4157 TestObject* impl = V8TestObject::toNative(info.Holder());
4158 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt8(info[0], EnforceRange, exceptionState), exceptionState);
4159 impl->methodWithEnforceRangeUInt8(value);
4162 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4165 TestObjectV8Internal::methodWithEnforceRangeUInt8Method(info);
4166 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4169 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4171 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeInt16", "TestObject", info.Holder(), info.GetIsolate());
4172 if (UNLIKELY(info.Length() < 1)) {
4173 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4174 exceptionState.throwIfNeeded();
4177 TestObject* impl = V8TestObject::toNative(info.Holder());
4178 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt16(info[0], EnforceRange, exceptionState), exceptionState);
4179 impl->methodWithEnforceRangeInt16(value);
4182 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4184 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4185 TestObjectV8Internal::methodWithEnforceRangeInt16Method(info);
4186 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4189 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4191 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt16", "TestObject", info.Holder(), info.GetIsolate());
4192 if (UNLIKELY(info.Length() < 1)) {
4193 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4194 exceptionState.throwIfNeeded();
4197 TestObject* impl = V8TestObject::toNative(info.Holder());
4198 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt16(info[0], EnforceRange, exceptionState), exceptionState);
4199 impl->methodWithEnforceRangeUInt16(value);
4202 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4204 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4205 TestObjectV8Internal::methodWithEnforceRangeUInt16Method(info);
4206 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4209 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4211 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeInt32", "TestObject", info.Holder(), info.GetIsolate());
4212 if (UNLIKELY(info.Length() < 1)) {
4213 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4214 exceptionState.throwIfNeeded();
4217 TestObject* impl = V8TestObject::toNative(info.Holder());
4218 V8TRYCATCH_EXCEPTION_VOID(int, value, toInt32(info[0], EnforceRange, exceptionState), exceptionState);
4219 impl->methodWithEnforceRangeInt32(value);
4222 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4225 TestObjectV8Internal::methodWithEnforceRangeInt32Method(info);
4226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4229 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4231 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt32", "TestObject", info.Holder(), info.GetIsolate());
4232 if (UNLIKELY(info.Length() < 1)) {
4233 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4234 exceptionState.throwIfNeeded();
4237 TestObject* impl = V8TestObject::toNative(info.Holder());
4238 V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt32(info[0], EnforceRange, exceptionState), exceptionState);
4239 impl->methodWithEnforceRangeUInt32(value);
4242 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4244 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4245 TestObjectV8Internal::methodWithEnforceRangeUInt32Method(info);
4246 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4249 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4251 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeInt64", "TestObject", info.Holder(), info.GetIsolate());
4252 if (UNLIKELY(info.Length() < 1)) {
4253 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4254 exceptionState.throwIfNeeded();
4257 TestObject* impl = V8TestObject::toNative(info.Holder());
4258 V8TRYCATCH_EXCEPTION_VOID(long long, value, toInt64(info[0], EnforceRange, exceptionState), exceptionState);
4259 impl->methodWithEnforceRangeInt64(value);
4262 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4264 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4265 TestObjectV8Internal::methodWithEnforceRangeInt64Method(info);
4266 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4269 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4271 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithEnforceRangeUInt64", "TestObject", info.Holder(), info.GetIsolate());
4272 if (UNLIKELY(info.Length() < 1)) {
4273 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4274 exceptionState.throwIfNeeded();
4277 TestObject* impl = V8TestObject::toNative(info.Holder());
4278 V8TRYCATCH_EXCEPTION_VOID(unsigned long long, value, toUInt64(info[0], EnforceRange, exceptionState), exceptionState);
4279 impl->methodWithEnforceRangeUInt64(value);
4282 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4284 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4285 TestObjectV8Internal::methodWithEnforceRangeUInt64Method(info);
4286 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4289 #if ENABLE(Condition1)
4290 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4292 TestObject* impl = V8TestObject::toNative(info.Holder());
4293 v8SetReturnValueString(info, impl->conditionalMethod1(), info.GetIsolate());
4295 #endif // ENABLE(Condition1)
4297 #if ENABLE(Condition1)
4298 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4300 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4301 TestObjectV8Internal::conditionalMethod1Method(info);
4302 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4304 #endif // ENABLE(Condition1)
4306 #if ENABLE(Condition1) && ENABLE(Condition2)
4307 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4309 TestObject* impl = V8TestObject::toNative(info.Holder());
4310 impl->conditionalMethod2();
4312 #endif // ENABLE(Condition1) && ENABLE(Condition2)
4314 #if ENABLE(Condition1) && ENABLE(Condition2)
4315 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4317 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4318 TestObjectV8Internal::conditionalMethod2Method(info);
4319 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4321 #endif // ENABLE(Condition1) && ENABLE(Condition2)
4323 #if ENABLE(Condition1) || ENABLE(Condition2)
4324 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4326 TestObject* impl = V8TestObject::toNative(info.Holder());
4327 impl->conditionalMethod3();
4329 #endif // ENABLE(Condition1) || ENABLE(Condition2)
4331 #if ENABLE(Condition1) || ENABLE(Condition2)
4332 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4334 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4335 TestObjectV8Internal::conditionalMethod3Method(info);
4336 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4338 #endif // ENABLE(Condition1) || ENABLE(Condition2)
4340 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4342 TestObject* impl = V8TestObject::toNative(info.Holder());
4343 v8SetReturnValue(info, impl->callbackFunctionReturnValue().v8Value());
4346 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4348 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4349 TestObjectV8Internal::callbackFunctionReturnValueMethod(info);
4350 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4353 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4355 if (UNLIKELY(info.Length() < 1)) {
4356 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgument", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4359 TestObject* impl = V8TestObject::toNative(info.Holder());
4360 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate()));
4361 impl->callbackFunctionArgument(function);
4364 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4366 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4367 TestObjectV8Internal::callbackFunctionArgumentMethod(info);
4368 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4371 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4373 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethod", "TestObject", info.Holder(), info.GetIsolate());
4374 if (UNLIKELY(info.Length() < 1)) {
4375 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4376 exceptionState.throwIfNeeded();
4379 TestObject* impl = V8TestObject::toNative(info.Holder());
4380 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4381 impl->overloadedMethod(longArg);
4384 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4386 if (UNLIKELY(info.Length() < 1)) {
4387 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4390 TestObject* impl = V8TestObject::toNative(info.Holder());
4391 if (info.Length() <= 0 || !info[0]->IsFunction()) {
4392 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
4395 OwnPtr<TestCallbackInterface> callbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4396 impl->overloadedMethod(callbackInterfaceArg.release());
4399 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4401 if (UNLIKELY(info.Length() < 1)) {
4402 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4405 TestObject* impl = V8TestObject::toNative(info.Holder());
4406 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4407 impl->overloadedMethod(objArg);
4410 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4412 if (UNLIKELY(info.Length() < 1)) {
4413 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4416 TestObject* impl = V8TestObject::toNative(info.Holder());
4417 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
4418 impl->overloadedMethod(arrayArg);
4421 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4423 if (UNLIKELY(info.Length() < 1)) {
4424 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4427 TestObject* impl = V8TestObject::toNative(info.Holder());
4428 V8TRYCATCH_VOID(Vector<unsigned>, sequenceArg, toNativeArray<unsigned>(info[0], 1, info.GetIsolate()));
4429 impl->overloadedMethod(sequenceArg);
4432 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4434 if (((info.Length() == 1))) {
4435 overloadedMethod1Method(info);
4438 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction()))) {
4439 overloadedMethod2Method(info);
4442 if (((info.Length() == 1) && (V8TestObject::hasInstance(info[0], info.GetIsolate())))) {
4443 overloadedMethod3Method(info);
4446 if (((info.Length() == 1) && (info[0]->IsArray()))) {
4447 overloadedMethod4Method(info);
4450 if (((info.Length() == 1) && (info[0]->IsArray()))) {
4451 overloadedMethod5Method(info);
4454 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethod", "TestObject", info.Holder(), info.GetIsolate());
4455 if (UNLIKELY(info.Length() < 1)) {
4456 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4457 exceptionState.throwIfNeeded();
4460 exceptionState.throwTypeError("No function was found that matched the signature provided.");
4461 exceptionState.throwIfNeeded();
4464 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4466 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4467 TestObjectV8Internal::overloadedMethodMethod(info);
4468 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4471 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4473 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate());
4474 if (UNLIKELY(info.Length() < 1)) {
4475 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4476 exceptionState.throwIfNeeded();
4479 TestObject* impl = V8TestObject::toNative(info.Holder());
4480 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4481 if (UNLIKELY(info.Length() <= 1)) {
4482 impl->overloadedMethodA(objArg);
4485 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState);
4486 impl->overloadedMethodA(objArg, longArg);
4489 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4491 if (UNLIKELY(info.Length() < 2)) {
4492 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4495 TestObject* impl = V8TestObject::toNative(info.Holder());
4496 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4497 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
4498 impl->overloadedMethodA(objArg, strArg);
4501 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4503 if (((info.Length() == 1) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate()))) || ((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate())))) {
4504 overloadedMethodA1Method(info);
4507 if (((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate())))) {
4508 overloadedMethodA2Method(info);
4511 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate());
4512 if (UNLIKELY(info.Length() < 1)) {
4513 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4514 exceptionState.throwIfNeeded();
4517 exceptionState.throwTypeError("No function was found that matched the signature provided.");
4518 exceptionState.throwIfNeeded();
4521 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4523 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4524 TestObjectV8Internal::overloadedMethodAMethod(info);
4525 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4528 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4530 if (UNLIKELY(info.Length() < 1)) {
4531 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4534 TestObject* impl = V8TestObject::toNative(info.Holder());
4535 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4536 impl->overloadedMethodB(strArg);
4539 static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4541 if (UNLIKELY(info.Length() < 1)) {
4542 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4545 TestObject* impl = V8TestObject::toNative(info.Holder());
4546 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4547 impl->overloadedMethodB(strArg);
4550 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4552 if (((info.Length() == 1))) {
4553 overloadedMethodB1Method(info);
4556 if (((info.Length() == 1) && (isUndefinedOrNull(info[0]) || info[0]->IsString() || info[0]->IsObject()))) {
4557 overloadedMethodB2Method(info);
4560 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate());
4561 if (UNLIKELY(info.Length() < 1)) {
4562 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4563 exceptionState.throwIfNeeded();
4566 exceptionState.throwTypeError("No function was found that matched the signature provided.");
4567 exceptionState.throwIfNeeded();
4570 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4572 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4573 TestObjectV8Internal::overloadedMethodBMethod(info);
4574 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4577 static void overloadedMethodC1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4579 if (UNLIKELY(info.Length() < 1)) {
4580 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4583 TestObject* impl = V8TestObject::toNative(info.Holder());
4584 V8TRYCATCH_VOID(Dictionary, dictionaryArg, Dictionary(info[0], info.GetIsolate()));
4585 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) {
4586 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObject", "parameter 1 ('dictionaryArg') is not an object."), info.GetIsolate());
4589 impl->overloadedMethodC(dictionaryArg);
4592 static void overloadedMethodC2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4594 if (UNLIKELY(info.Length() < 1)) {
4595 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4598 TestObject* impl = V8TestObject::toNative(info.Holder());
4599 V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue()));
4600 impl->overloadedMethodC(doubleArg);
4603 static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4605 if (((info.Length() == 1) && (info[0]->IsObject()))) {
4606 overloadedMethodC1Method(info);
4609 if (((info.Length() == 1))) {
4610 overloadedMethodC2Method(info);
4613 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObject", info.Holder(), info.GetIsolate());
4614 if (UNLIKELY(info.Length() < 1)) {
4615 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4616 exceptionState.throwIfNeeded();
4619 exceptionState.throwTypeError("No function was found that matched the signature provided.");
4620 exceptionState.throwIfNeeded();
4623 static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4626 TestObjectV8Internal::overloadedMethodCMethod(info);
4627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4630 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4632 TestObject::classMethod();
4635 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4638 TestObjectV8Internal::classMethodMethod(info);
4639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4642 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4644 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethodWithOptional", "TestObject", info.Holder(), info.GetIsolate());
4645 if (UNLIKELY(info.Length() <= 0)) {
4646 v8SetReturnValueInt(info, TestObject::classMethodWithOptional());
4649 V8TRYCATCH_EXCEPTION_VOID(int, arg, toInt32(info[0], exceptionState), exceptionState);
4650 v8SetReturnValueInt(info, TestObject::classMethodWithOptional(arg));
4653 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4655 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4656 TestObjectV8Internal::classMethodWithOptionalMethod(info);
4657 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4660 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4663 V8TestObject::classMethod2MethodCustom(info);
4664 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4667 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4669 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethodWithClamp", "TestObject", info.Holder(), info.GetIsolate());
4670 if (UNLIKELY(info.Length() < 2)) {
4671 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
4672 exceptionState.throwIfNeeded();
4675 TestObject* impl = V8TestObject::toNative(info.Holder());
4676 unsigned objArgsShort = 0;
4677 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue());
4678 if (!std::isnan(objArgsShortNativeValue))
4679 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue);
4680 unsigned objArgsLong = 0;
4681 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue());
4682 if (!std::isnan(objArgsLongNativeValue))
4683 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue);
4684 impl->classMethodWithClamp(objArgsShort, objArgsLong);
4687 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4689 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4690 TestObjectV8Internal::classMethodWithClampMethod(info);
4691 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4694 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4696 ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledAtRuntimeMethod", "TestObject", info.Holder(), info.GetIsolate());
4697 if (UNLIKELY(info.Length() < 1)) {
4698 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4699 exceptionState.throwIfNeeded();
4702 TestObject* impl = V8TestObject::toNative(info.Holder());
4703 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4704 impl->enabledAtRuntimeMethod(longArg);
4707 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4709 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4710 TestObjectV8Internal::enabledAtRuntimeMethodMethod(info);
4711 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4714 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4716 ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledPerContextMethod", "TestObject", info.Holder(), info.GetIsolate());
4717 if (UNLIKELY(info.Length() < 1)) {
4718 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4719 exceptionState.throwIfNeeded();
4722 TestObject* impl = V8TestObject::toNative(info.Holder());
4723 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4724 impl->enabledPerContextMethod(longArg);
4727 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4729 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4730 TestObjectV8Internal::enabledPerContextMethodMethod(info);
4731 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4734 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4736 if (UNLIKELY(info.Length() < 1)) {
4737 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLongSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4740 TestObject* impl = V8TestObject::toNative(info.Holder());
4741 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsigned>(info[0], 1, info.GetIsolate()));
4742 impl->methodWithUnsignedLongSequence(unsignedLongSequence);
4745 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4747 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4748 TestObjectV8Internal::methodWithUnsignedLongSequenceMethod(info);
4749 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4752 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4754 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArrayFunction", "TestObject", info.Holder(), info.GetIsolate());
4755 if (UNLIKELY(info.Length() < 1)) {
4756 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4757 exceptionState.throwIfNeeded();
4760 TestObject* impl = V8TestObject::toNative(info.Holder());
4761 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate()));
4762 Vector<String> result = impl->stringArrayFunction(values, exceptionState);
4763 if (exceptionState.throwIfNeeded())
4765 v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
4768 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4770 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4771 TestObjectV8Internal::stringArrayFunctionMethod(info);
4772 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4775 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4777 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringListFunction", "TestObject", info.Holder(), info.GetIsolate());
4778 if (UNLIKELY(info.Length() < 1)) {
4779 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4780 exceptionState.throwIfNeeded();
4783 TestObject* impl = V8TestObject::toNative(info.Holder());
4784 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4785 RefPtr<DOMStringList> result = impl->domStringListFunction(values, exceptionState);
4786 if (exceptionState.throwIfNeeded())
4788 v8SetReturnValue(info, result.release());
4791 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4793 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4794 TestObjectV8Internal::domStringListFunctionMethod(info);
4795 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4798 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4800 if (UNLIKELY(info.Length() < 1)) {
4801 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4804 TestObject* impl = V8TestObject::toNative(info.Holder());
4805 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4806 impl->convert1(value);
4809 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4811 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4812 TestObjectV8Internal::convert1Method(info);
4813 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4816 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4818 if (UNLIKELY(info.Length() < 1)) {
4819 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4822 TestObject* impl = V8TestObject::toNative(info.Holder());
4823 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4824 impl->convert2(value);
4827 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4829 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4830 TestObjectV8Internal::convert2Method(info);
4831 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4834 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4836 TestObject* impl = V8TestObject::toNative(info.Holder());
4840 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4842 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4843 TestObjectV8Internal::orangeMethod(info);
4844 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4847 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4849 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunction", "TestObject", info.Holder(), info.GetIsolate());
4850 if (UNLIKELY(info.Length() < 3)) {
4851 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length()));
4852 exceptionState.throwIfNeeded();
4855 TestObject* impl = V8TestObject::toNative(info.Holder());
4856 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
4857 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue()));
4858 V8TRYCATCH_EXCEPTION_VOID(int, b, toInt32(info[2], exceptionState), exceptionState);
4859 bool result = impl->strictFunction(str, a, b, exceptionState);
4860 if (exceptionState.throwIfNeeded())
4862 v8SetReturnValueBool(info, result);
4865 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4867 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4868 TestObjectV8Internal::strictFunctionMethod(info);
4869 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4872 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4874 if (UNLIKELY(info.Length() < 1)) {
4875 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4878 TestObject* impl = V8TestObject::toNative(info.Holder());
4879 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]);
4880 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1));
4881 impl->variadicStringMethod(head, tail);
4884 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4886 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4887 TestObjectV8Internal::variadicStringMethodMethod(info);
4888 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4891 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4893 if (UNLIKELY(info.Length() < 1)) {
4894 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4897 TestObject* impl = V8TestObject::toNative(info.Holder());
4898 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue()));
4899 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1));
4900 impl->variadicDoubleMethod(head, tail);
4903 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4905 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4906 TestObjectV8Internal::variadicDoubleMethodMethod(info);
4907 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4910 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4912 if (UNLIKELY(info.Length() < 1)) {
4913 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4916 TestObject* impl = V8TestObject::toNative(info.Holder());
4917 V8TRYCATCH_VOID(Node*, head, V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4918 Vector<RefPtr<Node> > tail;
4919 for (int i = 1; i < info.Length(); ++i) {
4920 if (!V8Node::hasInstance(info[i], info.GetIsolate())) {
4921 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate());
4924 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i])));
4926 impl->variadicNodeMethod(head, tail);
4929 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4931 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4932 TestObjectV8Internal::variadicNodeMethodMethod(info);
4933 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4936 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4938 TestObject* impl = V8TestObject::toNative(info.Holder());
4939 impl->perWorldMethod();
4942 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4944 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4945 TestObjectV8Internal::perWorldMethodMethod(info);
4946 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4949 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4951 TestObject* impl = V8TestObject::toNative(info.Holder());
4952 impl->perWorldMethod();
4955 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4957 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4958 TestObjectV8Internal::perWorldMethodMethodForMainWorld(info);
4959 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4962 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4964 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
4965 if (UNLIKELY(info.Length() < 1)) {
4966 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4967 exceptionState.throwIfNeeded();
4970 TestObject* impl = V8TestObject::toNative(info.Holder());
4971 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4972 impl->overloadedPerWorldMethod(longArg);
4975 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4977 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
4978 if (UNLIKELY(info.Length() < 1)) {
4979 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
4980 exceptionState.throwIfNeeded();
4983 TestObject* impl = V8TestObject::toNative(info.Holder());
4984 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4985 impl->overloadedPerWorldMethod(longArg);
4988 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4990 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
4991 if (UNLIKELY(info.Length() < 2)) {
4992 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
4993 exceptionState.throwIfNeeded();
4996 TestObject* impl = V8TestObject::toNative(info.Holder());
4997 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4998 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState);
4999 impl->overloadedPerWorldMethod(strArg, longArg);
5002 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5004 if (((info.Length() == 1))) {
5005 overloadedPerWorldMethod1Method(info);
5008 if (((info.Length() == 2))) {
5009 overloadedPerWorldMethod2Method(info);
5012 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
5013 if (UNLIKELY(info.Length() < 1)) {
5014 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5015 exceptionState.throwIfNeeded();
5018 exceptionState.throwTypeError("No function was found that matched the signature provided.");
5019 exceptionState.throwIfNeeded();
5022 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5024 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5025 TestObjectV8Internal::overloadedPerWorldMethodMethod(info);
5026 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5029 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5031 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
5032 if (UNLIKELY(info.Length() < 2)) {
5033 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
5034 exceptionState.throwIfNeeded();
5037 TestObject* impl = V8TestObject::toNative(info.Holder());
5038 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
5039 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState);
5040 impl->overloadedPerWorldMethod(strArg, longArg);
5043 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5045 if (((info.Length() == 1))) {
5046 overloadedPerWorldMethod1MethodForMainWorld(info);
5049 if (((info.Length() == 2))) {
5050 overloadedPerWorldMethod2MethodForMainWorld(info);
5053 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
5054 if (UNLIKELY(info.Length() < 1)) {
5055 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5056 exceptionState.throwIfNeeded();
5059 exceptionState.throwTypeError("No function was found that matched the signature provided.");
5060 exceptionState.throwIfNeeded();
5063 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5065 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5066 TestObjectV8Internal::overloadedPerWorldMethodMethodForMainWorld(info);
5067 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5070 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
5072 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedMethod1", "TestObject", info.Holder(), info.GetIsolate());
5073 if (UNLIKELY(info.Length() < 1)) {
5074 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5075 exceptionState.throwIfNeeded();
5078 TestObject* impl = V8TestObject::toNative(info.Holder());
5079 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5080 impl->activityLoggedMethod1(longArg);
5083 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5085 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5086 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
5087 if (contextData && contextData->activityLogger()) {
5088 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
5089 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", info.Length(), loggerArgs.data(), "Method");
5091 TestObjectV8Internal::activityLoggedMethod1Method(info);
5092 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5095 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
5097 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedMethod2", "TestObject", info.Holder(), info.GetIsolate());
5098 if (UNLIKELY(info.Length() < 1)) {
5099 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5100 exceptionState.throwIfNeeded();
5103 TestObject* impl = V8TestObject::toNative(info.Holder());
5104 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5105 impl->activityLoggedMethod2(longArg);
5108 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5111 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
5112 if (contextData && contextData->activityLogger()) {
5113 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
5114 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", info.Length(), loggerArgs.data(), "Method");
5116 TestObjectV8Internal::activityLoggedMethod2Method(info);
5117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5120 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5122 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedMethod2", "TestObject", info.Holder(), info.GetIsolate());
5123 if (UNLIKELY(info.Length() < 1)) {
5124 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5125 exceptionState.throwIfNeeded();
5128 TestObject* impl = V8TestObject::toNative(info.Holder());
5129 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5130 impl->activityLoggedMethod2(longArg);
5133 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5136 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
5137 if (contextData && contextData->activityLogger()) {
5138 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
5139 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", info.Length(), loggerArgs.data(), "Method");
5141 TestObjectV8Internal::activityLoggedMethod2MethodForMainWorld(info);
5142 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5145 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5147 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
5148 if (UNLIKELY(info.Length() < 1)) {
5149 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5150 exceptionState.throwIfNeeded();
5153 TestObject* impl = V8TestObject::toNative(info.Holder());
5154 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5155 impl->activityLoggedInIsolatedWorldMethod(longArg);
5158 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5161 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
5162 if (contextData && contextData->activityLogger()) {
5163 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
5164 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldMethod", info.Length(), loggerArgs.data(), "Method");
5166 TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethod(info);
5167 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5170 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5172 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
5173 if (UNLIKELY(info.Length() < 1)) {
5174 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5175 exceptionState.throwIfNeeded();
5178 TestObject* impl = V8TestObject::toNative(info.Holder());
5179 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5180 impl->activityLoggedInIsolatedWorldMethod(longArg);
5183 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5185 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5186 TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(info);
5187 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5190 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
5192 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
5193 if (UNLIKELY(info.Length() < 1)) {
5194 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5195 exceptionState.throwIfNeeded();
5198 TestObject* impl = V8TestObject::toNative(info.Holder());
5199 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5200 impl->overloadedActivityLoggedMethod(longArg);
5203 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5205 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
5206 if (UNLIKELY(info.Length() < 1)) {
5207 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5208 exceptionState.throwIfNeeded();
5211 TestObject* impl = V8TestObject::toNative(info.Holder());
5212 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5213 impl->overloadedActivityLoggedMethod(longArg);
5216 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
5218 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
5219 if (UNLIKELY(info.Length() < 2)) {
5220 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
5221 exceptionState.throwIfNeeded();
5224 TestObject* impl = V8TestObject::toNative(info.Holder());
5225 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
5226 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState);
5227 impl->overloadedActivityLoggedMethod(strArg, longArg);
5230 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5232 if (((info.Length() == 1))) {
5233 overloadedActivityLoggedMethod1Method(info);
5236 if (((info.Length() == 2))) {
5237 overloadedActivityLoggedMethod2Method(info);
5240 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
5241 if (UNLIKELY(info.Length() < 1)) {
5242 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5243 exceptionState.throwIfNeeded();
5246 exceptionState.throwTypeError("No function was found that matched the signature provided.");
5247 exceptionState.throwIfNeeded();
5250 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5252 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5253 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
5254 if (contextData && contextData->activityLogger()) {
5255 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
5256 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedMethod", info.Length(), loggerArgs.data(), "Method");
5258 TestObjectV8Internal::overloadedActivityLoggedMethodMethod(info);
5259 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5262 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5264 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
5265 if (UNLIKELY(info.Length() < 2)) {
5266 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
5267 exceptionState.throwIfNeeded();
5270 TestObject* impl = V8TestObject::toNative(info.Holder());
5271 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
5272 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState);
5273 impl->overloadedActivityLoggedMethod(strArg, longArg);
5276 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5278 if (((info.Length() == 1))) {
5279 overloadedActivityLoggedMethod1MethodForMainWorld(info);
5282 if (((info.Length() == 2))) {
5283 overloadedActivityLoggedMethod2MethodForMainWorld(info);
5286 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
5287 if (UNLIKELY(info.Length() < 1)) {
5288 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
5289 exceptionState.throwIfNeeded();
5292 exceptionState.throwTypeError("No function was found that matched the signature provided.");
5293 exceptionState.throwIfNeeded();
5296 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5298 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5299 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
5300 if (contextData && contextData->activityLogger()) {
5301 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
5302 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedMethod", info.Length(), loggerArgs.data(), "Method");
5304 TestObjectV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info);
5305 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5308 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5310 TestObject* impl = V8TestObject::toNative(info.Holder());
5311 impl->deprecatedMethod();
5314 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5316 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5317 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::Method);
5318 TestObjectV8Internal::deprecatedMethodMethod(info);
5319 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5322 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5324 TestObject::deprecatedStaticMethod();
5327 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5329 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5330 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::StaticMethod);
5331 TestObjectV8Internal::deprecatedStaticMethodMethod(info);
5332 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5335 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
5337 TestObject* impl = V8TestObject::toNative(info.Holder());
5338 RefPtr<Node> result = impl->anonymousIndexedGetter(index);
5341 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
5344 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
5346 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
5347 TestObjectV8Internal::indexedPropertyGetter(index, info);
5348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5351 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
5353 if (info.Holder()->HasRealNamedProperty(name))
5355 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
5358 TestObject* impl = V8TestObject::toNative(info.Holder());
5359 AtomicString propertyName = toCoreAtomicString(name);
5360 String result = impl->anonymousNamedGetter(propertyName);
5361 if (result.isNull())
5363 v8SetReturnValueString(info, result, info.GetIsolate());
5366 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
5368 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5369 TestObjectV8Internal::namedPropertyGetter(name, info);
5370 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5373 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
5375 TestObject* impl = V8TestObject::toNative(info.Holder());
5376 AtomicString propertyName = toCoreAtomicString(name);
5377 v8::String::Utf8Value namedProperty(name);
5378 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestObject", info.Holder(), info.GetIsolate());
5379 bool result = impl->namedPropertyQuery(propertyName, exceptionState);
5380 if (exceptionState.throwIfNeeded())
5384 v8SetReturnValueInt(info, v8::None);
5387 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
5389 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5390 TestObjectV8Internal::namedPropertyQuery(name, info);
5391 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5394 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
5396 TestObject* impl = V8TestObject::toNative(info.Holder());
5397 v8::Isolate* isolate = info.GetIsolate();
5398 Vector<String> names;
5399 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestObject", info.Holder(), isolate);
5400 impl->namedPropertyEnumerator(names, exceptionState);
5401 if (exceptionState.throwIfNeeded())
5403 v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size());
5404 for (size_t i = 0; i < names.size(); ++i)
5405 v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i]));
5406 v8SetReturnValue(info, v8names);
5409 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
5411 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5412 TestObjectV8Internal::namedPropertyEnumerator(info);
5413 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5416 } // namespace TestObjectV8Internal
5418 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] = {
5419 {"readOnlyLongAttr", TestObjectV8Internal::readOnlyLongAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5420 {"readOnlyStringAttr", TestObjectV8Internal::readOnlyStringAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5421 {"readOnlyTestObjectAttr", TestObjectV8Internal::readOnlyTestObjectAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5422 {"TestSubObj", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5423 {"enumAttr", TestObjectV8Internal::enumAttrAttributeGetterCallback, TestObjectV8Internal::enumAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5424 {"readOnlyEnumAttr", TestObjectV8Internal::readOnlyEnumAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5425 {"byteAttr", TestObjectV8Internal::byteAttrAttributeGetterCallback, TestObjectV8Internal::byteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5426 {"octetAttr", TestObjectV8Internal::octetAttrAttributeGetterCallback, TestObjectV8Internal::octetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5427 {"shortAttr", TestObjectV8Internal::shortAttrAttributeGetterCallback, TestObjectV8Internal::shortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5428 {"unsignedShortAttr", TestObjectV8Internal::unsignedShortAttrAttributeGetterCallback, TestObjectV8Internal::unsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5429 {"longAttr", TestObjectV8Internal::longAttrAttributeGetterCallback, TestObjectV8Internal::longAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5430 {"longLongAttr", TestObjectV8Internal::longLongAttrAttributeGetterCallback, TestObjectV8Internal::longLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5431 {"unsignedLongLongAttr", TestObjectV8Internal::unsignedLongLongAttrAttributeGetterCallback, TestObjectV8Internal::unsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5432 {"stringAttr", TestObjectV8Internal::stringAttrAttributeGetterCallback, TestObjectV8Internal::stringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5433 {"treatNullAsNullStringStringAttr", TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeGetterCallback, TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5434 {"treatNullAsNullStringTreatUndefinedAsNullStringStringAttr", TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback, TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5435 {"eventHandlerAttr", TestObjectV8Internal::eventHandlerAttrAttributeGetterCallback, TestObjectV8Internal::eventHandlerAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5436 {"testObjAttr", TestObjectV8Internal::testObjAttrAttributeGetterCallback, TestObjectV8Internal::testObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5437 {"TestSubObjMeasured", TestObjectV8Internal::TestSubObjMeasuredConstructorGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5438 {"XMLObjAttr", TestObjectV8Internal::XMLObjAttrAttributeGetterCallback, TestObjectV8Internal::XMLObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5439 {"reflectedStringAttr", TestObjectV8Internal::reflectedStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5440 {"reflectedTreatNullAsNullStringStringAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5441 {"reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5442 {"reflectedIntegralAttr", TestObjectV8Internal::reflectedIntegralAttrAttributeGetterCallback, TestObjectV8Internal::reflectedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5443 {"reflectedUnsignedIntegralAttr", TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeGetterCallback, TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5444 {"reflectedBooleanAttr", TestObjectV8Internal::reflectedBooleanAttrAttributeGetterCallback, TestObjectV8Internal::reflectedBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5445 {"reflectedURLAttr", TestObjectV8Internal::reflectedURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5446 {"reflectedTreatNullAsNullStringURLAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5447 {"reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5448 {"reflectedCustomStringAttr", TestObjectV8Internal::reflectedCustomStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedCustomStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5449 {"reflectedTreatNullAsNullStringCustomStringAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5450 {"reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5451 {"reflectedCustomIntegralAttr", TestObjectV8Internal::reflectedCustomIntegralAttrAttributeGetterCallback, TestObjectV8Internal::reflectedCustomIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5452 {"reflectedCustomBooleanAttr", TestObjectV8Internal::reflectedCustomBooleanAttrAttributeGetterCallback, TestObjectV8Internal::reflectedCustomBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5453 {"reflectedCustomURLAttr", TestObjectV8Internal::reflectedCustomURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5454 {"reflectedTreatNullAsNullStringCustomURLAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5455 {"reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttr", TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetterCallback, TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5456 {"limitedToOnlyOneAttribute", TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5457 {"limitedToOnlyAttribute", TestObjectV8Internal::limitedToOnlyAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5458 {"limitedToOnlyOtherAttribute", TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5459 {"limitedWithMissingDefaultAttribute", TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5460 {"limitedWithInvalidMissingDefaultAttribute", TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5461 {"limitedWithInvalidAndMissingDefaultAttribute", TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5462 {"corsSettingAttribute", TestObjectV8Internal::corsSettingAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5463 {"limitedWithEmptyMissingInvalidAttribute", TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5464 {"typedArrayAttr", TestObjectV8Internal::typedArrayAttrAttributeGetterCallback, TestObjectV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5465 {"attrWithGetterException", TestObjectV8Internal::attrWithGetterExceptionAttributeGetterCallback, TestObjectV8Internal::attrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5466 {"attrWithSetterException", TestObjectV8Internal::attrWithSetterExceptionAttributeGetterCallback, TestObjectV8Internal::attrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5467 {"stringAttrWithGetterException", TestObjectV8Internal::stringAttrWithGetterExceptionAttributeGetterCallback, TestObjectV8Internal::stringAttrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5468 {"stringAttrWithSetterException", TestObjectV8Internal::stringAttrWithSetterExceptionAttributeGetterCallback, TestObjectV8Internal::stringAttrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5469 {"customAttr", TestObjectV8Internal::customAttrAttributeGetterCallback, TestObjectV8Internal::customAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5470 {"withExecutionContextAttribute", TestObjectV8Internal::withExecutionContextAttributeAttributeGetterCallback, TestObjectV8Internal::withExecutionContextAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5471 {"withActiveWindowAndFirstWindowAttribute", TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetterCallback, TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5472 {"withScriptStateAttributeRaises", TestObjectV8Internal::withScriptStateAttributeRaisesAttributeGetterCallback, TestObjectV8Internal::withScriptStateAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5473 {"enforcedRangeByteAttr", TestObjectV8Internal::enforcedRangeByteAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeByteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5474 {"enforcedRangeOctetAttr", TestObjectV8Internal::enforcedRangeOctetAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeOctetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5475 {"enforcedRangeShortAttr", TestObjectV8Internal::enforcedRangeShortAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5476 {"enforcedRangeUnsignedShortAttr", TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5477 {"enforcedRangeLongAttr", TestObjectV8Internal::enforcedRangeLongAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5478 {"enforcedRangeUnsignedLongAttr", TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5479 {"enforcedRangeLongLongAttr", TestObjectV8Internal::enforcedRangeLongLongAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5480 {"enforcedRangeUnsignedLongLongAttr", TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetterCallback, TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5481 #if ENABLE(Condition1)
5482 {"conditionalAttr1", TestObjectV8Internal::conditionalAttr1AttributeGetterCallback, TestObjectV8Internal::conditionalAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5483 #endif // ENABLE(Condition1)
5484 #if ENABLE(Condition1) && ENABLE(Condition2)
5485 {"conditionalAttr2", TestObjectV8Internal::conditionalAttr2AttributeGetterCallback, TestObjectV8Internal::conditionalAttr2AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5486 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5487 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
5488 {"conditionalAttr3", TestObjectV8Internal::conditionalAttr3AttributeGetterCallback, TestObjectV8Internal::conditionalAttr3AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5489 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
5490 #if ENABLE(Condition1)
5491 {"conditionalAttr4", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectA::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5492 #endif // ENABLE(Condition1)
5493 #if ENABLE(Condition1) && ENABLE(Condition2)
5494 {"conditionalAttr5", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectB::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5495 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5496 #if ENABLE(Condition1) || ENABLE(Condition2)
5497 {"conditionalAttr6", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectC::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5498 #endif // ENABLE(Condition1) || ENABLE(Condition2)
5499 {"cachedAttribute1", TestObjectV8Internal::cachedAttribute1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5500 {"cachedAttribute2", TestObjectV8Internal::cachedAttribute2AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5501 {"cachedDirtyableAttribute", TestObjectV8Internal::cachedDirtyableAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5502 {"cachedDirtyableAttributeRaises", TestObjectV8Internal::cachedDirtyableAttributeRaisesAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5503 {"anyAttribute", TestObjectV8Internal::anyAttributeAttributeGetterCallback, TestObjectV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5504 {"callbackFunctionAttribute", TestObjectV8Internal::callbackFunctionAttributeAttributeGetterCallback, TestObjectV8Internal::callbackFunctionAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5505 {"floatArray", TestObjectV8Internal::floatArrayAttributeGetterCallback, TestObjectV8Internal::floatArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5506 {"doubleArray", TestObjectV8Internal::doubleArrayAttributeGetterCallback, TestObjectV8Internal::doubleArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5507 {"messagePortArray", TestObjectV8Internal::messagePortArrayAttributeGetterCallback, TestObjectV8Internal::messagePortArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5508 {"contentDocument", TestObjectV8Internal::contentDocumentAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5509 {"strawberry", TestObjectV8Internal::strawberryAttributeGetterCallback, TestObjectV8Internal::strawberryAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5510 {"strictFloat", TestObjectV8Internal::strictFloatAttributeGetterCallback, TestObjectV8Internal::strictFloatAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5511 {"replaceableAttribute", TestObjectV8Internal::replaceableAttributeAttributeGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5512 {"nullableDoubleAttribute", TestObjectV8Internal::nullableDoubleAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5513 {"nullableLongAttribute", TestObjectV8Internal::nullableLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5514 {"nullableBooleanAttribute", TestObjectV8Internal::nullableBooleanAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5515 {"nullableStringAttribute", TestObjectV8Internal::nullableStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5516 {"nullableLongSettableAttribute", TestObjectV8Internal::nullableLongSettableAttributeAttributeGetterCallback, TestObjectV8Internal::nullableLongSettableAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5517 {"perWorldReadOnlyAttribute", TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetterCallback, 0, TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5518 {"perWorldAttribute", TestObjectV8Internal::perWorldAttributeAttributeGetterCallback, TestObjectV8Internal::perWorldAttributeAttributeSetterCallback, TestObjectV8Internal::perWorldAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::perWorldAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5519 {"activityLoggedAttr1", TestObjectV8Internal::activityLoggedAttr1AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5520 {"activityLoggedAttr2", TestObjectV8Internal::activityLoggedAttr2AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttr2AttributeSetterCallback, TestObjectV8Internal::activityLoggedAttr2AttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedAttr2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5521 {"activityLoggedInIsolatedWorldsAttr", TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5522 {"activityLoggedAttrSetter1", TestObjectV8Internal::activityLoggedAttrSetter1AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttrSetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5523 {"activityLoggedAttrSetter2", TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetterCallback, TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5524 {"activityLoggedInIsolatedWorldsAttrSetter", TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5525 {"activityLoggedAttrGetter1", TestObjectV8Internal::activityLoggedAttrGetter1AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttrGetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5526 {"activityLoggedAttrGetter2", TestObjectV8Internal::activityLoggedAttrGetter2AttributeGetterCallback, TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetterCallback, TestObjectV8Internal::activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5527 {"activityLoggedInIsolatedWorldsAttrGetter", TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5528 {"deprecatedReadonlyAttr", TestObjectV8Internal::deprecatedReadonlyAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5529 {"deprecatedAttr", TestObjectV8Internal::deprecatedAttrAttributeGetterCallback, TestObjectV8Internal::deprecatedAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5530 {"deprecatedConstructor", TestObjectV8Internal::deprecatedConstructorConstructorGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5531 {"location", TestObjectV8Internal::locationAttributeGetterCallback, TestObjectV8Internal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5532 {"locationWithException", TestObjectV8Internal::locationWithExceptionAttributeGetterCallback, TestObjectV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5535 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = {
5536 {"attrWithJSGetterAndSetter", TestObjectV8Internal::attrWithJSGetterAndSetterAttributeGetterCallback, TestObjectV8Internal::attrWithJSGetterAndSetterAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)},
5539 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
5540 {"voidMethod", TestObjectV8Internal::voidMethodMethodCallback, 0, 0},
5541 {"voidMethodWithArgs", TestObjectV8Internal::voidMethodWithArgsMethodCallback, 0, 3},
5542 {"longMethod", TestObjectV8Internal::longMethodMethodCallback, 0, 0},
5543 {"longMethodWithArgs", TestObjectV8Internal::longMethodWithArgsMethodCallback, 0, 3},
5544 {"objMethod", TestObjectV8Internal::objMethodMethodCallback, 0, 0},
5545 {"objMethodWithArgs", TestObjectV8Internal::objMethodWithArgsMethodCallback, 0, 3},
5546 {"methodWithSequenceArg", TestObjectV8Internal::methodWithSequenceArgMethodCallback, 0, 1},
5547 {"methodReturningSequence", TestObjectV8Internal::methodReturningSequenceMethodCallback, 0, 1},
5548 {"methodWithEnumArg", TestObjectV8Internal::methodWithEnumArgMethodCallback, 0, 1},
5549 {"methodThatRequiresAllArgsAndThrows", TestObjectV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, 0, 2},
5550 {"methodQueryListListener", TestObjectV8Internal::methodQueryListListenerMethodCallback, 0, 1},
5551 {"serializedValue", TestObjectV8Internal::serializedValueMethodCallback, 0, 1},
5552 {"optionsObject", TestObjectV8Internal::optionsObjectMethodCallback, 0, 1},
5553 {"optionsObjectList", TestObjectV8Internal::optionsObjectListMethodCallback, 0, 1},
5554 {"methodWithException", TestObjectV8Internal::methodWithExceptionMethodCallback, 0, 0},
5555 {"customMethod", TestObjectV8Internal::customMethodMethodCallback, 0, 0},
5556 {"customMethodWithArgs", TestObjectV8Internal::customMethodWithArgsMethodCallback, 0, 3},
5557 {"withScriptStateVoid", TestObjectV8Internal::withScriptStateVoidMethodCallback, 0, 0},
5558 {"withScriptStateObj", TestObjectV8Internal::withScriptStateObjMethodCallback, 0, 0},
5559 {"withScriptStateVoidException", TestObjectV8Internal::withScriptStateVoidExceptionMethodCallback, 0, 0},
5560 {"withScriptStateObjException", TestObjectV8Internal::withScriptStateObjExceptionMethodCallback, 0, 0},
5561 {"withExecutionContext", TestObjectV8Internal::withExecutionContextMethodCallback, 0, 0},
5562 {"withExecutionContextAndScriptState", TestObjectV8Internal::withExecutionContextAndScriptStateMethodCallback, 0, 0},
5563 {"withExecutionContextAndScriptStateObjException", TestObjectV8Internal::withExecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0},
5564 {"withExecutionContextAndScriptStateWithSpaces", TestObjectV8Internal::withExecutionContextAndScriptStateWithSpacesMethodCallback, 0, 0},
5565 {"withActiveWindowAndFirstWindow", TestObjectV8Internal::withActiveWindowAndFirstWindowMethodCallback, 0, 0},
5566 {"methodWithOptionalArg", TestObjectV8Internal::methodWithOptionalArgMethodCallback, 0, 0},
5567 {"methodWithNonOptionalArgAndOptionalArg", TestObjectV8Internal::methodWithNonOptionalArgAndOptionalArgMethodCallback, 0, 1},
5568 {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjectV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1},
5569 {"methodWithOptionalString", TestObjectV8Internal::methodWithOptionalStringMethodCallback, 0, 0},
5570 {"methodWithOptionalStringIsUndefined", TestObjectV8Internal::methodWithOptionalStringIsUndefinedMethodCallback, 0, 0},
5571 {"methodWithOptionalStringIsNullString", TestObjectV8Internal::methodWithOptionalStringIsNullStringMethodCallback, 0, 0},
5572 {"methodWithCallbackInterfaceArg", TestObjectV8Internal::methodWithCallbackInterfaceArgMethodCallback, 0, 1},
5573 {"methodWithNonCallbackArgAndCallbackInterfaceArg", TestObjectV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback, 0, 2},
5574 {"methodWithCallbackInterfaceAndOptionalArg", TestObjectV8Internal::methodWithCallbackInterfaceAndOptionalArgMethodCallback, 0, 0},
5575 {"methodWithNullableCallbackInterfaceArg", TestObjectV8Internal::methodWithNullableCallbackInterfaceArgMethodCallback, 0, 1},
5576 {"methodWithEnforceRangeInt8", TestObjectV8Internal::methodWithEnforceRangeInt8MethodCallback, 0, 1},
5577 {"methodWithEnforceRangeUInt8", TestObjectV8Internal::methodWithEnforceRangeUInt8MethodCallback, 0, 1},
5578 {"methodWithEnforceRangeInt16", TestObjectV8Internal::methodWithEnforceRangeInt16MethodCallback, 0, 1},
5579 {"methodWithEnforceRangeUInt16", TestObjectV8Internal::methodWithEnforceRangeUInt16MethodCallback, 0, 1},
5580 {"methodWithEnforceRangeInt32", TestObjectV8Internal::methodWithEnforceRangeInt32MethodCallback, 0, 1},
5581 {"methodWithEnforceRangeUInt32", TestObjectV8Internal::methodWithEnforceRangeUInt32MethodCallback, 0, 1},
5582 {"methodWithEnforceRangeInt64", TestObjectV8Internal::methodWithEnforceRangeInt64MethodCallback, 0, 1},
5583 {"methodWithEnforceRangeUInt64", TestObjectV8Internal::methodWithEnforceRangeUInt64MethodCallback, 0, 1},
5584 #if ENABLE(Condition1)
5585 {"conditionalMethod1", TestObjectV8Internal::conditionalMethod1MethodCallback, 0, 0},
5586 #endif // ENABLE(Condition1)
5587 #if ENABLE(Condition1) && ENABLE(Condition2)
5588 {"conditionalMethod2", TestObjectV8Internal::conditionalMethod2MethodCallback, 0, 0},
5589 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5590 #if ENABLE(Condition1) || ENABLE(Condition2)
5591 {"conditionalMethod3", TestObjectV8Internal::conditionalMethod3MethodCallback, 0, 0},
5592 #endif // ENABLE(Condition1) || ENABLE(Condition2)
5593 {"callbackFunctionReturnValue", TestObjectV8Internal::callbackFunctionReturnValueMethodCallback, 0, 0},
5594 {"callbackFunctionArgument", TestObjectV8Internal::callbackFunctionArgumentMethodCallback, 0, 1},
5595 {"overloadedMethod", TestObjectV8Internal::overloadedMethodMethodCallback, 0, 1},
5596 {"overloadedMethodA", TestObjectV8Internal::overloadedMethodAMethodCallback, 0, 1},
5597 {"overloadedMethodB", TestObjectV8Internal::overloadedMethodBMethodCallback, 0, 1},
5598 {"overloadedMethodC", TestObjectV8Internal::overloadedMethodCMethodCallback, 0, 1},
5599 {"classMethodWithClamp", TestObjectV8Internal::classMethodWithClampMethodCallback, 0, 2},
5600 {"methodWithUnsignedLongSequence", TestObjectV8Internal::methodWithUnsignedLongSequenceMethodCallback, 0, 1},
5601 {"stringArrayFunction", TestObjectV8Internal::stringArrayFunctionMethodCallback, 0, 1},
5602 {"domStringListFunction", TestObjectV8Internal::domStringListFunctionMethodCallback, 0, 1},
5603 {"convert1", TestObjectV8Internal::convert1MethodCallback, 0, 1},
5604 {"convert2", TestObjectV8Internal::convert2MethodCallback, 0, 1},
5605 {"orange", TestObjectV8Internal::orangeMethodCallback, 0, 0},
5606 {"strictFunction", TestObjectV8Internal::strictFunctionMethodCallback, 0, 3},
5607 {"variadicStringMethod", TestObjectV8Internal::variadicStringMethodMethodCallback, 0, 2},
5608 {"variadicDoubleMethod", TestObjectV8Internal::variadicDoubleMethodMethodCallback, 0, 2},
5609 {"variadicNodeMethod", TestObjectV8Internal::variadicNodeMethodMethodCallback, 0, 2},
5610 {"perWorldMethod", TestObjectV8Internal::perWorldMethodMethodCallback, TestObjectV8Internal::perWorldMethodMethodCallbackForMainWorld, 0},
5611 {"overloadedPerWorldMethod", TestObjectV8Internal::overloadedPerWorldMethodMethodCallback, TestObjectV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorld, 1},
5612 {"activityLoggedMethod1", TestObjectV8Internal::activityLoggedMethod1MethodCallback, 0, 1},
5613 {"activityLoggedMethod2", TestObjectV8Internal::activityLoggedMethod2MethodCallback, TestObjectV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1},
5614 {"activityLoggedInIsolatedWorldMethod", TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethodCallback, TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld, 1},
5615 {"overloadedActivityLoggedMethod", TestObjectV8Internal::overloadedActivityLoggedMethodMethodCallback, TestObjectV8Internal::overloadedActivityLoggedMethodMethodCallbackForMainWorld, 1},
5616 {"deprecatedMethod", TestObjectV8Internal::deprecatedMethodMethodCallback, 0, 0},
5619 static void configureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
5621 functionTemplate->ReadOnlyPrototype();
5623 v8::Local<v8::Signature> defaultSignature;
5624 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestObject", V8EventTarget::domTemplate(isolate), V8TestObject::internalFieldCount,
5625 V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes),
5626 V8TestObjectAccessors, WTF_ARRAY_LENGTH(V8TestObjectAccessors),
5627 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods),
5629 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
5630 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
5631 if (RuntimeEnabledFeatures::featureNameEnabled()) {
5632 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
5633 {"enabledAtRuntimeAttr", TestObjectV8Internal::enabledAtRuntimeAttrAttributeGetterCallback, TestObjectV8Internal::enabledAtRuntimeAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
5634 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
5636 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = {
5637 {"DEPRECATED_CONSTANT", 1},
5639 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate);
5640 COMPILE_ASSERT(1 == TestObject::DEPRECATED_CONSTANT, TheValueOfTestObject_DEPRECATED_CONSTANTDoesntMatchWithImplementation);
5641 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestObjectV8Internal::indexedPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObject>);
5642 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestObjectV8Internal::namedPropertyGetterCallback, 0, TestObjectV8Internal::namedPropertyQueryCallback, 0, TestObjectV8Internal::namedPropertyEnumeratorCallback);
5643 functionTemplate->Set(v8AtomicString(isolate, "staticMethodWithCallbackAndOptionalArg"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5644 functionTemplate->Set(v8AtomicString(isolate, "staticMethodWithCallbackArg"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5645 functionTemplate->Set(v8AtomicString(isolate, "classMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5646 functionTemplate->Set(v8AtomicString(isolate, "classMethodWithOptional"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5647 functionTemplate->Set(v8AtomicString(isolate, "classMethod2"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5648 if (RuntimeEnabledFeatures::featureNameEnabled())
5649 prototypeTemplate->Set(v8AtomicString(isolate, "enabledAtRuntimeMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSignature, 1));
5650 functionTemplate->Set(v8AtomicString(isolate, "deprecatedStaticMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5651 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticReadOnlyLongAttr"), TestObjectV8Internal::staticReadOnlyLongAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5652 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStringAttr"), TestObjectV8Internal::staticStringAttrAttributeGetterCallback, TestObjectV8Internal::staticStringAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5653 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "deprecatedStaticReadOnlyAttr"), TestObjectV8Internal::deprecatedStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5654 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "deprecatedStaticAttr"), TestObjectV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjectV8Internal::deprecatedStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5656 // Custom toString template
5657 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
5660 v8::Handle<v8::FunctionTemplate> V8TestObject::domTemplate(v8::Isolate* isolate)
5662 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
5663 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo));
5664 if (!result.IsEmpty())
5667 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
5668 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
5669 configureV8TestObjectTemplate(result, isolate);
5670 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result);
5674 bool V8TestObject::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
5676 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
5679 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
5681 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
5684 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
5686 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0;
5689 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, TestObject* impl, v8::Isolate* isolate)
5691 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instanceTemplate->GetPrototype());
5692 if (ContextFeatures::featureNameEnabled(impl->document())) {
5693 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
5694 {"enabledPerContextAttr", TestObjectV8Internal::enabledPerContextAttrAttributeGetterCallback, TestObjectV8Internal::enabledPerContextAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
5695 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
5699 void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate)
5701 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate));
5703 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext());
5704 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context)))
5705 prototypeTemplate->Set(v8AtomicString(isolate, "enabledPerContextMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::enabledPerContextMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction());
5708 EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object)
5710 return toNative(object);
5713 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
5716 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate));
5717 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
5718 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
5719 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
5720 // the same object de-ref functions, though, so use that as the basis of the check.
5721 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
5724 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
5725 if (UNLIKELY(wrapper.IsEmpty()))
5728 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
5729 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
5733 void V8TestObject::derefObject(void* object)
5735 fromInternalPointer(object)->deref();
5739 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
5741 return toV8(impl, creationContext, isolate);
5744 } // namespace WebCore