7e06ede8767f4d7c0f3749e6dfbe759468110119
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestObject.cpp
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.
4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6
7 #include "config.h"
8 #include "V8TestObject.h"
9
10 #include "HTMLNames.h"
11 #include "RuntimeEnabledFeatures.h"
12 #include "V8DOMStringList.h"
13 #include "V8Document.h"
14 #include "V8MessagePort.h"
15 #include "V8Node.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"
44
45 namespace WebCore {
46
47 static void initializeScriptWrappableForInterface(TestObject* object)
48 {
49     if (ScriptWrappable::wrapperCanBeStoredInObject(object))
50         ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeInfo);
51     else
52         ASSERT_NOT_REACHED();
53 }
54
55 } // namespace WebCore
56
57 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObject* object)
58 {
59     WebCore::initializeScriptWrappableForInterface(object);
60 }
61
62 namespace WebCore {
63 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::domTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype, false };
64
65 namespace TestObjectV8Internal {
66
67 template <typename T> void V8_USE(T) { }
68
69 static void readOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
70 {
71     v8::Handle<v8::Object> holder = info.Holder();
72     TestObject* impl = V8TestObject::toNative(holder);
73     v8SetReturnValueInt(info, impl->readOnlyLongAttr());
74 }
75
76 static void readOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
77 {
78     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
79     TestObjectV8Internal::readOnlyLongAttrAttributeGetter(info);
80     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
81 }
82
83 static void readOnlyStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
84 {
85     v8::Handle<v8::Object> holder = info.Holder();
86     TestObject* impl = V8TestObject::toNative(holder);
87     v8SetReturnValueString(info, impl->readOnlyStringAttr(), info.GetIsolate());
88 }
89
90 static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
91 {
92     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
93     TestObjectV8Internal::readOnlyStringAttrAttributeGetter(info);
94     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
95 }
96
97 static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
98 {
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()))
103         return;
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);
108     }
109 }
110
111 static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
112 {
113     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
114     TestObjectV8Internal::readOnlyTestObjectAttrAttributeGetter(info);
115     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
116 }
117
118 static void staticReadOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
119 {
120     v8SetReturnValueInt(info, TestObject::staticReadOnlyLongAttr());
121 }
122
123 static void staticReadOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
124 {
125     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
126     TestObjectV8Internal::staticReadOnlyLongAttrAttributeGetter(info);
127     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
128 }
129
130 static void staticStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
131 {
132     v8SetReturnValueString(info, TestObject::staticStringAttr(), info.GetIsolate());
133 }
134
135 static void staticStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
136 {
137     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
138     TestObjectV8Internal::staticStringAttrAttributeGetter(info);
139     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
140 }
141
142 static void staticStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
143 {
144     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
145     TestObject::setStaticStringAttr(cppValue);
146 }
147
148 static void staticStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
149 {
150     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
151     TestObjectV8Internal::staticStringAttrAttributeSetter(v8Value, info);
152     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
153 }
154
155 static void enumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
156 {
157     v8::Handle<v8::Object> holder = info.Holder();
158     TestObject* impl = V8TestObject::toNative(holder);
159     v8SetReturnValueString(info, impl->enumAttr(), info.GetIsolate());
160 }
161
162 static void enumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
163 {
164     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
165     TestObjectV8Internal::enumAttrAttributeGetter(info);
166     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
167 }
168
169 static void enumAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
170 {
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"))
176         return;
177     impl->setEnumAttr(cppValue);
178 }
179
180 static void enumAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
181 {
182     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
183     TestObjectV8Internal::enumAttrAttributeSetter(v8Value, info);
184     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
185 }
186
187 static void readOnlyEnumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
188 {
189     v8::Handle<v8::Object> holder = info.Holder();
190     TestObject* impl = V8TestObject::toNative(holder);
191     v8SetReturnValueString(info, impl->readOnlyEnumAttr(), info.GetIsolate());
192 }
193
194 static void readOnlyEnumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
195 {
196     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
197     TestObjectV8Internal::readOnlyEnumAttrAttributeGetter(info);
198     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
199 }
200
201 static void byteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
202 {
203     v8::Handle<v8::Object> holder = info.Holder();
204     TestObject* impl = V8TestObject::toNative(holder);
205     v8SetReturnValueInt(info, impl->byteAttr());
206 }
207
208 static void byteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
209 {
210     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
211     TestObjectV8Internal::byteAttrAttributeGetter(info);
212     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
213 }
214
215 static void byteAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
216 {
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);
222 }
223
224 static void byteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
225 {
226     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
227     TestObjectV8Internal::byteAttrAttributeSetter(v8Value, info);
228     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
229 }
230
231 static void octetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
232 {
233     v8::Handle<v8::Object> holder = info.Holder();
234     TestObject* impl = V8TestObject::toNative(holder);
235     v8SetReturnValueUnsigned(info, impl->octetAttr());
236 }
237
238 static void octetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
239 {
240     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
241     TestObjectV8Internal::octetAttrAttributeGetter(info);
242     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
243 }
244
245 static void octetAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
246 {
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);
252 }
253
254 static void octetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
255 {
256     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
257     TestObjectV8Internal::octetAttrAttributeSetter(v8Value, info);
258     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
259 }
260
261 static void shortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
262 {
263     v8::Handle<v8::Object> holder = info.Holder();
264     TestObject* impl = V8TestObject::toNative(holder);
265     v8SetReturnValueInt(info, impl->shortAttr());
266 }
267
268 static void shortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
269 {
270     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
271     TestObjectV8Internal::shortAttrAttributeGetter(info);
272     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
273 }
274
275 static void shortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
276 {
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);
282 }
283
284 static void shortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
285 {
286     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
287     TestObjectV8Internal::shortAttrAttributeSetter(v8Value, info);
288     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
289 }
290
291 static void unsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
292 {
293     v8::Handle<v8::Object> holder = info.Holder();
294     TestObject* impl = V8TestObject::toNative(holder);
295     v8SetReturnValueUnsigned(info, impl->unsignedShortAttr());
296 }
297
298 static void unsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
299 {
300     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
301     TestObjectV8Internal::unsignedShortAttrAttributeGetter(info);
302     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
303 }
304
305 static void unsignedShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
306 {
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);
312 }
313
314 static void unsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
315 {
316     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
317     TestObjectV8Internal::unsignedShortAttrAttributeSetter(v8Value, info);
318     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
319 }
320
321 static void longAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
322 {
323     v8::Handle<v8::Object> holder = info.Holder();
324     TestObject* impl = V8TestObject::toNative(holder);
325     v8SetReturnValueInt(info, impl->longAttr());
326 }
327
328 static void longAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
329 {
330     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
331     TestObjectV8Internal::longAttrAttributeGetter(info);
332     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
333 }
334
335 static void longAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
336 {
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);
342 }
343
344 static void longAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
345 {
346     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
347     TestObjectV8Internal::longAttrAttributeSetter(v8Value, info);
348     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
349 }
350
351 static void longLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
352 {
353     v8::Handle<v8::Object> holder = info.Holder();
354     TestObject* impl = V8TestObject::toNative(holder);
355     v8SetReturnValue(info, static_cast<double>(impl->longLongAttr()));
356 }
357
358 static void longLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
359 {
360     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
361     TestObjectV8Internal::longLongAttrAttributeGetter(info);
362     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
363 }
364
365 static void longLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
366 {
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);
372 }
373
374 static void longLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
375 {
376     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
377     TestObjectV8Internal::longLongAttrAttributeSetter(v8Value, info);
378     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
379 }
380
381 static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
382 {
383     v8::Handle<v8::Object> holder = info.Holder();
384     TestObject* impl = V8TestObject::toNative(holder);
385     v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongAttr()));
386 }
387
388 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
389 {
390     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
391     TestObjectV8Internal::unsignedLongLongAttrAttributeGetter(info);
392     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
393 }
394
395 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
396 {
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);
402 }
403
404 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
405 {
406     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
407     TestObjectV8Internal::unsignedLongLongAttrAttributeSetter(v8Value, info);
408     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
409 }
410
411 static void stringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
412 {
413     v8::Handle<v8::Object> holder = info.Holder();
414     TestObject* impl = V8TestObject::toNative(holder);
415     v8SetReturnValueString(info, impl->stringAttr(), info.GetIsolate());
416 }
417
418 static void stringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
419 {
420     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
421     TestObjectV8Internal::stringAttrAttributeGetter(info);
422     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
423 }
424
425 static void stringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
426 {
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);
431 }
432
433 static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
434 {
435     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
436     TestObjectV8Internal::stringAttrAttributeSetter(v8Value, info);
437     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
438 }
439
440 static void treatNullAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
441 {
442     v8::Handle<v8::Object> holder = info.Holder();
443     TestObject* impl = V8TestObject::toNative(holder);
444     v8SetReturnValueString(info, impl->treatNullAsNullStringStringAttr(), info.GetIsolate());
445 }
446
447 static void treatNullAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
448 {
449     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
450     TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeGetter(info);
451     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
452 }
453
454 static void treatNullAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
455 {
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);
460 }
461
462 static void treatNullAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
463 {
464     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
465     TestObjectV8Internal::treatNullAsNullStringStringAttrAttributeSetter(v8Value, info);
466     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
467 }
468
469 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
470 {
471     v8::Handle<v8::Object> holder = info.Holder();
472     TestObject* impl = V8TestObject::toNative(holder);
473     v8SetReturnValueString(info, impl->treatNullAsNullStringTreatUndefinedAsNullStringStringAttr(), info.GetIsolate());
474 }
475
476 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
477 {
478     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
479     TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(info);
480     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
481 }
482
483 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
484 {
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);
489 }
490
491 static void treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
492 {
493     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
494     TestObjectV8Internal::treatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8Value, info);
495     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
496 }
497
498 static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
499 {
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())));
504 }
505
506 static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
507 {
508     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
509     TestObjectV8Internal::eventHandlerAttrAttributeGetter(info);
510     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
511 }
512
513 static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
514 {
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));
519 }
520
521 static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
522 {
523     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
524     TestObjectV8Internal::eventHandlerAttrAttributeSetter(v8Value, info);
525     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
526 }
527
528 static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
529 {
530     v8::Handle<v8::Object> holder = info.Holder();
531     TestObject* impl = V8TestObject::toNative(holder);
532     v8SetReturnValueFast(info, WTF::getPtr(impl->testObjAttr()), impl);
533 }
534
535 static void testObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
536 {
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");
541 }
542
543 static void testObjAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
544 {
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));
549 }
550
551 static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
552 {
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");
557 }
558
559 static void attrWithJSGetterAndSetterAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
560 {
561     v8::Handle<v8::Object> holder = info.Holder();
562     TestObject* impl = V8TestObject::toNative(holder);
563     v8SetReturnValueString(info, impl->attrWithJSGetterAndSetter(), info.GetIsolate());
564 }
565
566 static void attrWithJSGetterAndSetterAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
567 {
568     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
569     TestObjectV8Internal::attrWithJSGetterAndSetterAttributeGetter(info);
570     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
571 }
572
573 static void attrWithJSGetterAndSetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
574 {
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);
579 }
580
581 static void attrWithJSGetterAndSetterAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
582 {
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");
587 }
588
589 static void XMLObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
590 {
591     v8::Handle<v8::Object> holder = info.Holder();
592     TestObject* impl = V8TestObject::toNative(holder);
593     v8SetReturnValueFast(info, WTF::getPtr(impl->xmlObjAttr()), impl);
594 }
595
596 static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
597 {
598     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
599     TestObjectV8Internal::XMLObjAttrAttributeGetter(info);
600     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
601 }
602
603 static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
604 {
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));
609 }
610
611 static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
612 {
613     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
614     TestObjectV8Internal::XMLObjAttrAttributeSetter(v8Value, info);
615     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
616 }
617
618 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
619 {
620     v8::Handle<v8::Object> holder = info.Holder();
621     TestObject* impl = V8TestObject::toNative(holder);
622     v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedstringattrAttr), info.GetIsolate());
623 }
624
625 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
626 {
627     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
628     TestObjectV8Internal::reflectedStringAttrAttributeGetter(info);
629     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
630 }
631
632 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
633 {
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);
639 }
640
641 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
642 {
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");
647 }
648
649 static void reflectedTreatNullAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
650 {
651     v8::Handle<v8::Object> holder = info.Holder();
652     TestObject* impl = V8TestObject::toNative(holder);
653     v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedtreatnullasnullstringstringattrAttr), info.GetIsolate());
654 }
655
656 static void reflectedTreatNullAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
657 {
658     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
659     TestObjectV8Internal::reflectedTreatNullAsNullStringStringAttrAttributeGetter(info);
660     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
661 }
662
663 static void reflectedTreatNullAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
664 {
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);
670 }
671
672 static void reflectedTreatNullAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
673 {
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");
678 }
679
680 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
681 {
682     v8::Handle<v8::Object> holder = info.Holder();
683     TestObject* impl = V8TestObject::toNative(holder);
684     v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringstringattrAttr), info.GetIsolate());
685 }
686
687 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
688 {
689     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
690     TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeGetter(info);
691     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
692 }
693
694 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
695 {
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);
701 }
702
703 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
704 {
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");
709 }
710
711 static void reflectedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
712 {
713     v8::Handle<v8::Object> holder = info.Holder();
714     TestObject* impl = V8TestObject::toNative(holder);
715     v8SetReturnValueInt(info, impl->getIntegralAttribute(HTMLNames::reflectedintegralattrAttr));
716 }
717
718 static void reflectedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
719 {
720     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
721     TestObjectV8Internal::reflectedIntegralAttrAttributeGetter(info);
722     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
723 }
724
725 static void reflectedIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
726 {
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);
733 }
734
735 static void reflectedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
736 {
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");
741 }
742
743 static void reflectedUnsignedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
744 {
745     v8::Handle<v8::Object> holder = info.Holder();
746     TestObject* impl = V8TestObject::toNative(holder);
747     v8SetReturnValueUnsigned(info, std::max(0, impl->getIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr)));
748 }
749
750 static void reflectedUnsignedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
751 {
752     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
753     TestObjectV8Internal::reflectedUnsignedIntegralAttrAttributeGetter(info);
754     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
755 }
756
757 static void reflectedUnsignedIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
758 {
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);
765 }
766
767 static void reflectedUnsignedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
768 {
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");
773 }
774
775 static void reflectedBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
776 {
777     v8::Handle<v8::Object> holder = info.Holder();
778     TestObject* impl = V8TestObject::toNative(holder);
779     v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::reflectedbooleanattrAttr));
780 }
781
782 static void reflectedBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
783 {
784     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
785     TestObjectV8Internal::reflectedBooleanAttrAttributeGetter(info);
786     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
787 }
788
789 static void reflectedBooleanAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
790 {
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);
796 }
797
798 static void reflectedBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
799 {
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");
804 }
805
806 static void reflectedURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
807 {
808     v8::Handle<v8::Object> holder = info.Holder();
809     TestObject* impl = V8TestObject::toNative(holder);
810     v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedurlattrAttr), info.GetIsolate());
811 }
812
813 static void reflectedURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
814 {
815     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
816     TestObjectV8Internal::reflectedURLAttrAttributeGetter(info);
817     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
818 }
819
820 static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
821 {
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);
827 }
828
829 static void reflectedURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
830 {
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");
835 }
836
837 static void reflectedTreatNullAsNullStringURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
838 {
839     v8::Handle<v8::Object> holder = info.Holder();
840     TestObject* impl = V8TestObject::toNative(holder);
841     v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedtreatnullasnullstringurlattrAttr), info.GetIsolate());
842 }
843
844 static void reflectedTreatNullAsNullStringURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
845 {
846     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
847     TestObjectV8Internal::reflectedTreatNullAsNullStringURLAttrAttributeGetter(info);
848     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
849 }
850
851 static void reflectedTreatNullAsNullStringURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
852 {
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);
858 }
859
860 static void reflectedTreatNullAsNullStringURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
861 {
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");
866 }
867
868 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
869 {
870     v8::Handle<v8::Object> holder = info.Holder();
871     TestObject* impl = V8TestObject::toNative(holder);
872     v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectedtreatnullasnullstringtreatundefinedasnullstringurlattrAttr), info.GetIsolate());
873 }
874
875 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
876 {
877     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
878     TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeGetter(info);
879     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
880 }
881
882 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
883 {
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);
889 }
890
891 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
892 {
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");
897 }
898
899 static void reflectedCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
900 {
901     v8::Handle<v8::Object> holder = info.Holder();
902     TestObject* impl = V8TestObject::toNative(holder);
903     v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate());
904 }
905
906 static void reflectedCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
907 {
908     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
909     TestObjectV8Internal::reflectedCustomStringAttrAttributeGetter(info);
910     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
911 }
912
913 static void reflectedCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
914 {
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);
920 }
921
922 static void reflectedCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
923 {
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");
928 }
929
930 static void reflectedTreatNullAsNullStringCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
931 {
932     v8::Handle<v8::Object> holder = info.Holder();
933     TestObject* impl = V8TestObject::toNative(holder);
934     v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate());
935 }
936
937 static void reflectedTreatNullAsNullStringCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
938 {
939     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
940     TestObjectV8Internal::reflectedTreatNullAsNullStringCustomStringAttrAttributeGetter(info);
941     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
942 }
943
944 static void reflectedTreatNullAsNullStringCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
945 {
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);
951 }
952
953 static void reflectedTreatNullAsNullStringCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
954 {
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");
959 }
960
961 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
962 {
963     v8::Handle<v8::Object> holder = info.Holder();
964     TestObject* impl = V8TestObject::toNative(holder);
965     v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate());
966 }
967
968 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
969 {
970     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
971     TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeGetter(info);
972     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
973 }
974
975 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
976 {
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);
982 }
983
984 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
985 {
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");
990 }
991
992 static void reflectedCustomIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
993 {
994     v8::Handle<v8::Object> holder = info.Holder();
995     TestObject* impl = V8TestObject::toNative(holder);
996     v8SetReturnValueInt(info, impl->getIntegralAttribute(HTMLNames::customContentIntegralAttrAttr));
997 }
998
999 static void reflectedCustomIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1000 {
1001     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1002     TestObjectV8Internal::reflectedCustomIntegralAttrAttributeGetter(info);
1003     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1004 }
1005
1006 static void reflectedCustomIntegralAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1007 {
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);
1014 }
1015
1016 static void reflectedCustomIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1017 {
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");
1022 }
1023
1024 static void reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1025 {
1026     v8::Handle<v8::Object> holder = info.Holder();
1027     TestObject* impl = V8TestObject::toNative(holder);
1028     v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::customContentBooleanAttrAttr));
1029 }
1030
1031 static void reflectedCustomBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1032 {
1033     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1034     TestObjectV8Internal::reflectedCustomBooleanAttrAttributeGetter(info);
1035     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1036 }
1037
1038 static void reflectedCustomBooleanAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1039 {
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);
1045 }
1046
1047 static void reflectedCustomBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1048 {
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");
1053 }
1054
1055 static void reflectedCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1056 {
1057     v8::Handle<v8::Object> holder = info.Holder();
1058     TestObject* impl = V8TestObject::toNative(holder);
1059     v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate());
1060 }
1061
1062 static void reflectedCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1063 {
1064     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1065     TestObjectV8Internal::reflectedCustomURLAttrAttributeGetter(info);
1066     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1067 }
1068
1069 static void reflectedCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1070 {
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);
1076 }
1077
1078 static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1079 {
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");
1084 }
1085
1086 static void reflectedTreatNullAsNullStringCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1087 {
1088     v8::Handle<v8::Object> holder = info.Holder();
1089     TestObject* impl = V8TestObject::toNative(holder);
1090     v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate());
1091 }
1092
1093 static void reflectedTreatNullAsNullStringCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1094 {
1095     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1096     TestObjectV8Internal::reflectedTreatNullAsNullStringCustomURLAttrAttributeGetter(info);
1097     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1098 }
1099
1100 static void reflectedTreatNullAsNullStringCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1101 {
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);
1107 }
1108
1109 static void reflectedTreatNullAsNullStringCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1110 {
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");
1115 }
1116
1117 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1118 {
1119     v8::Handle<v8::Object> holder = info.Holder();
1120     TestObject* impl = V8TestObject::toNative(holder);
1121     v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate());
1122 }
1123
1124 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1125 {
1126     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1127     TestObjectV8Internal::reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeGetter(info);
1128     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1129 }
1130
1131 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1132 {
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);
1138 }
1139
1140 static void reflectedTreatNullAsNullStringTreatUndefinedAsNullStringCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1141 {
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");
1146 }
1147
1148 static void limitedToOnlyOneAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1149 {
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()) {
1154         ;
1155     } else if (equalIgnoringCase(v8Value, "unique")) {
1156         v8Value = "unique";
1157     } else {
1158         v8Value = "";
1159     }
1160     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1161 }
1162
1163 static void limitedToOnlyOneAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1164 {
1165     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1166     TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetter(info);
1167     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1168 }
1169
1170 static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1171 {
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);
1177 }
1178
1179 static void limitedToOnlyOneAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1180 {
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");
1185 }
1186
1187 static void limitedToOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1188 {
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()) {
1193         ;
1194     } else if (equalIgnoringCase(v8Value, "Per")) {
1195         v8Value = "Per";
1196     } else if (equalIgnoringCase(v8Value, "Paal")) {
1197         v8Value = "Paal";
1198     } else if (equalIgnoringCase(v8Value, "Espen")) {
1199         v8Value = "Espen";
1200     } else {
1201         v8Value = "";
1202     }
1203     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1204 }
1205
1206 static void limitedToOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1207 {
1208     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1209     TestObjectV8Internal::limitedToOnlyAttributeAttributeGetter(info);
1210     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1211 }
1212
1213 static void limitedToOnlyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1214 {
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);
1220 }
1221
1222 static void limitedToOnlyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1223 {
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");
1228 }
1229
1230 static void limitedToOnlyOtherAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1231 {
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()) {
1236         ;
1237     } else if (equalIgnoringCase(v8Value, "Value1")) {
1238         v8Value = "Value1";
1239     } else if (equalIgnoringCase(v8Value, "Value2")) {
1240         v8Value = "Value2";
1241     } else {
1242         v8Value = "";
1243     }
1244     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1245 }
1246
1247 static void limitedToOnlyOtherAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1248 {
1249     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1250     TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetter(info);
1251     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1252 }
1253
1254 static void limitedToOnlyOtherAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1255 {
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);
1261 }
1262
1263 static void limitedToOnlyOtherAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1264 {
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");
1269 }
1270
1271 static void limitedWithMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1272 {
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()) {
1277         v8Value = "rsa";
1278     } else if (equalIgnoringCase(v8Value, "rsa")) {
1279         v8Value = "rsa";
1280     } else if (equalIgnoringCase(v8Value, "dsa")) {
1281         v8Value = "dsa";
1282     } else {
1283         v8Value = "";
1284     }
1285     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1286 }
1287
1288 static void limitedWithMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1289 {
1290     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1291     TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetter(info);
1292     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1293 }
1294
1295 static void limitedWithMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1296 {
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);
1302 }
1303
1304 static void limitedWithMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1305 {
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");
1310 }
1311
1312 static void limitedWithInvalidMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1313 {
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()) {
1318         v8Value = "auto";
1319     } else if (equalIgnoringCase(v8Value, "ltr")) {
1320         v8Value = "ltr";
1321     } else if (equalIgnoringCase(v8Value, "rtl")) {
1322         v8Value = "rtl";
1323     } else if (equalIgnoringCase(v8Value, "auto")) {
1324         v8Value = "auto";
1325     } else {
1326         v8Value = "ltr";
1327     }
1328     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1329 }
1330
1331 static void limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1332 {
1333     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1334     TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetter(info);
1335     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1336 }
1337
1338 static void limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1339 {
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);
1345 }
1346
1347 static void limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1348 {
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");
1353 }
1354
1355 static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1356 {
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()) {
1361         v8Value = "left";
1362     } else if (equalIgnoringCase(v8Value, "left")) {
1363         v8Value = "left";
1364     } else if (equalIgnoringCase(v8Value, "right")) {
1365         v8Value = "right";
1366     } else {
1367         v8Value = "left";
1368     }
1369     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1370 }
1371
1372 static void limitedWithInvalidAndMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1373 {
1374     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1375     TestObjectV8Internal::limitedWithInvalidAndMissingDefaultAttributeAttributeGetter(info);
1376     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1377 }
1378
1379 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1380 {
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);
1386 }
1387
1388 static void limitedWithInvalidAndMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1389 {
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");
1394 }
1395
1396 static void corsSettingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1397 {
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()) {
1402         ;
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";
1409     } else {
1410         v8Value = "anonymous";
1411     }
1412     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1413 }
1414
1415 static void corsSettingAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1416 {
1417     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1418     TestObjectV8Internal::corsSettingAttributeAttributeGetter(info);
1419     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1420 }
1421
1422 static void limitedWithEmptyMissingInvalidAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1423 {
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()) {
1430         v8Value = "empty";
1431     } else if (equalIgnoringCase(v8Value, "empty")) {
1432         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";
1439     } else {
1440         v8Value = "invalid";
1441     }
1442     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1443 }
1444
1445 static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1446 {
1447     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1448     TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(info);
1449     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1450 }
1451
1452 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1453 {
1454     v8::Handle<v8::Object> holder = info.Holder();
1455     TestObject* impl = V8TestObject::toNative(holder);
1456     v8SetReturnValueFast(info, WTF::getPtr(impl->typedArrayAttr()), impl);
1457 }
1458
1459 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1460 {
1461     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1462     TestObjectV8Internal::typedArrayAttrAttributeGetter(info);
1463     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1464 }
1465
1466 static void typedArrayAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1467 {
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));
1472 }
1473
1474 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1475 {
1476     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1477     TestObjectV8Internal::typedArrayAttrAttributeSetter(v8Value, info);
1478     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1479 }
1480
1481 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1482 {
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()))
1488         return;
1489     v8SetReturnValueInt(info, v8Value);
1490 }
1491
1492 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1493 {
1494     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1495     TestObjectV8Internal::attrWithGetterExceptionAttributeGetter(info);
1496     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1497 }
1498
1499 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1500 {
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);
1506 }
1507
1508 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1509 {
1510     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1511     TestObjectV8Internal::attrWithGetterExceptionAttributeSetter(v8Value, info);
1512     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1513 }
1514
1515 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1516 {
1517     v8::Handle<v8::Object> holder = info.Holder();
1518     TestObject* impl = V8TestObject::toNative(holder);
1519     v8SetReturnValueInt(info, impl->attrWithSetterException());
1520 }
1521
1522 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1523 {
1524     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1525     TestObjectV8Internal::attrWithSetterExceptionAttributeGetter(info);
1526     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1527 }
1528
1529 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1530 {
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();
1537 }
1538
1539 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1540 {
1541     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1542     TestObjectV8Internal::attrWithSetterExceptionAttributeSetter(v8Value, info);
1543     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1544 }
1545
1546 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1547 {
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()))
1553         return;
1554     v8SetReturnValueString(info, v8Value, info.GetIsolate());
1555 }
1556
1557 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1558 {
1559     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1560     TestObjectV8Internal::stringAttrWithGetterExceptionAttributeGetter(info);
1561     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1562 }
1563
1564 static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1565 {
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);
1570 }
1571
1572 static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1573 {
1574     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1575     TestObjectV8Internal::stringAttrWithGetterExceptionAttributeSetter(v8Value, info);
1576     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1577 }
1578
1579 static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1580 {
1581     v8::Handle<v8::Object> holder = info.Holder();
1582     TestObject* impl = V8TestObject::toNative(holder);
1583     v8SetReturnValueString(info, impl->stringAttrWithSetterException(), info.GetIsolate());
1584 }
1585
1586 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1587 {
1588     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1589     TestObjectV8Internal::stringAttrWithSetterExceptionAttributeGetter(info);
1590     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1591 }
1592
1593 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1594 {
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();
1601 }
1602
1603 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1604 {
1605     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1606     TestObjectV8Internal::stringAttrWithSetterExceptionAttributeSetter(v8Value, info);
1607     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1608 }
1609
1610 static void customAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1611 {
1612     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1613     V8TestObject::customAttrAttributeGetterCustom(info);
1614     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1615 }
1616
1617 static void customAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1618 {
1619     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1620     V8TestObject::customAttrAttributeSetterCustom(v8Value, info);
1621     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1622 }
1623
1624 static void withExecutionContextAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1625 {
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);
1630 }
1631
1632 static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1633 {
1634     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1635     TestObjectV8Internal::withExecutionContextAttributeAttributeGetter(info);
1636     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1637 }
1638
1639 static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1640 {
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));
1646 }
1647
1648 static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1649 {
1650     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1651     TestObjectV8Internal::withExecutionContextAttributeAttributeSetter(v8Value, info);
1652     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1653 }
1654
1655 static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1656 {
1657     v8::Handle<v8::Object> holder = info.Holder();
1658     TestObject* impl = V8TestObject::toNative(holder);
1659     v8SetReturnValueFast(info, WTF::getPtr(impl->withActiveWindowAndFirstWindowAttribute()), impl);
1660 }
1661
1662 static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1663 {
1664     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1665     TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(info);
1666     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1667 }
1668
1669 static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1670 {
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));
1675 }
1676
1677 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1678 {
1679     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1680     TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(v8Value, info);
1681     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1682 }
1683
1684 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1685 {
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()))
1691         return;
1692     v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl);
1693 }
1694
1695 static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1696 {
1697     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1698     TestObjectV8Internal::withScriptStateAttributeRaisesAttributeGetter(info);
1699     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1700 }
1701
1702 static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1703 {
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));
1708 }
1709
1710 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1711 {
1712     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1713     TestObjectV8Internal::withScriptStateAttributeRaisesAttributeSetter(v8Value, info);
1714     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1715 }
1716
1717 static void enforcedRangeByteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1718 {
1719     v8::Handle<v8::Object> holder = info.Holder();
1720     TestObject* impl = V8TestObject::toNative(holder);
1721     v8SetReturnValueInt(info, impl->enforcedRangeByteAttr());
1722 }
1723
1724 static void enforcedRangeByteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1725 {
1726     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1727     TestObjectV8Internal::enforcedRangeByteAttrAttributeGetter(info);
1728     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1729 }
1730
1731 static void enforcedRangeByteAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1732 {
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);
1738 }
1739
1740 static void enforcedRangeByteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1741 {
1742     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1743     TestObjectV8Internal::enforcedRangeByteAttrAttributeSetter(v8Value, info);
1744     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1745 }
1746
1747 static void enforcedRangeOctetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1748 {
1749     v8::Handle<v8::Object> holder = info.Holder();
1750     TestObject* impl = V8TestObject::toNative(holder);
1751     v8SetReturnValueUnsigned(info, impl->enforcedRangeOctetAttr());
1752 }
1753
1754 static void enforcedRangeOctetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1755 {
1756     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1757     TestObjectV8Internal::enforcedRangeOctetAttrAttributeGetter(info);
1758     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1759 }
1760
1761 static void enforcedRangeOctetAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1762 {
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);
1768 }
1769
1770 static void enforcedRangeOctetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1771 {
1772     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1773     TestObjectV8Internal::enforcedRangeOctetAttrAttributeSetter(v8Value, info);
1774     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1775 }
1776
1777 static void enforcedRangeShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1778 {
1779     v8::Handle<v8::Object> holder = info.Holder();
1780     TestObject* impl = V8TestObject::toNative(holder);
1781     v8SetReturnValueInt(info, impl->enforcedRangeShortAttr());
1782 }
1783
1784 static void enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1785 {
1786     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1787     TestObjectV8Internal::enforcedRangeShortAttrAttributeGetter(info);
1788     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1789 }
1790
1791 static void enforcedRangeShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1792 {
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);
1798 }
1799
1800 static void enforcedRangeShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1801 {
1802     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1803     TestObjectV8Internal::enforcedRangeShortAttrAttributeSetter(v8Value, info);
1804     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1805 }
1806
1807 static void enforcedRangeUnsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1808 {
1809     v8::Handle<v8::Object> holder = info.Holder();
1810     TestObject* impl = V8TestObject::toNative(holder);
1811     v8SetReturnValueUnsigned(info, impl->enforcedRangeUnsignedShortAttr());
1812 }
1813
1814 static void enforcedRangeUnsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1815 {
1816     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1817     TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeGetter(info);
1818     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1819 }
1820
1821 static void enforcedRangeUnsignedShortAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1822 {
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);
1828 }
1829
1830 static void enforcedRangeUnsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1831 {
1832     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1833     TestObjectV8Internal::enforcedRangeUnsignedShortAttrAttributeSetter(v8Value, info);
1834     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1835 }
1836
1837 static void enforcedRangeLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1838 {
1839     v8::Handle<v8::Object> holder = info.Holder();
1840     TestObject* impl = V8TestObject::toNative(holder);
1841     v8SetReturnValueInt(info, impl->enforcedRangeLongAttr());
1842 }
1843
1844 static void enforcedRangeLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1845 {
1846     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1847     TestObjectV8Internal::enforcedRangeLongAttrAttributeGetter(info);
1848     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1849 }
1850
1851 static void enforcedRangeLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1852 {
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);
1858 }
1859
1860 static void enforcedRangeLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1861 {
1862     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1863     TestObjectV8Internal::enforcedRangeLongAttrAttributeSetter(v8Value, info);
1864     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1865 }
1866
1867 static void enforcedRangeUnsignedLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1868 {
1869     v8::Handle<v8::Object> holder = info.Holder();
1870     TestObject* impl = V8TestObject::toNative(holder);
1871     v8SetReturnValueUnsigned(info, impl->enforcedRangeUnsignedLongAttr());
1872 }
1873
1874 static void enforcedRangeUnsignedLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1875 {
1876     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1877     TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeGetter(info);
1878     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1879 }
1880
1881 static void enforcedRangeUnsignedLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1882 {
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);
1888 }
1889
1890 static void enforcedRangeUnsignedLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1891 {
1892     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1893     TestObjectV8Internal::enforcedRangeUnsignedLongAttrAttributeSetter(v8Value, info);
1894     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1895 }
1896
1897 static void enforcedRangeLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1898 {
1899     v8::Handle<v8::Object> holder = info.Holder();
1900     TestObject* impl = V8TestObject::toNative(holder);
1901     v8SetReturnValue(info, static_cast<double>(impl->enforcedRangeLongLongAttr()));
1902 }
1903
1904 static void enforcedRangeLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1905 {
1906     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1907     TestObjectV8Internal::enforcedRangeLongLongAttrAttributeGetter(info);
1908     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1909 }
1910
1911 static void enforcedRangeLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1912 {
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);
1918 }
1919
1920 static void enforcedRangeLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1921 {
1922     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1923     TestObjectV8Internal::enforcedRangeLongLongAttrAttributeSetter(v8Value, info);
1924     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1925 }
1926
1927 static void enforcedRangeUnsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1928 {
1929     v8::Handle<v8::Object> holder = info.Holder();
1930     TestObject* impl = V8TestObject::toNative(holder);
1931     v8SetReturnValue(info, static_cast<double>(impl->enforcedRangeUnsignedLongLongAttr()));
1932 }
1933
1934 static void enforcedRangeUnsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1935 {
1936     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1937     TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetter(info);
1938     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1939 }
1940
1941 static void enforcedRangeUnsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1942 {
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);
1948 }
1949
1950 static void enforcedRangeUnsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1951 {
1952     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1953     TestObjectV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetter(v8Value, info);
1954     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1955 }
1956
1957 #if ENABLE(Condition1)
1958 static void conditionalAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1959 {
1960     v8::Handle<v8::Object> holder = info.Holder();
1961     TestObject* impl = V8TestObject::toNative(holder);
1962     v8SetReturnValueInt(info, impl->conditionalAttr1());
1963 }
1964 #endif // ENABLE(Condition1)
1965
1966 #if ENABLE(Condition1)
1967 static void conditionalAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1968 {
1969     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1970     TestObjectV8Internal::conditionalAttr1AttributeGetter(info);
1971     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1972 }
1973 #endif // ENABLE(Condition1)
1974
1975 #if ENABLE(Condition1)
1976 static void conditionalAttr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1977 {
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);
1983 }
1984 #endif // ENABLE(Condition1)
1985
1986 #if ENABLE(Condition1)
1987 static void conditionalAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
1988 {
1989     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1990     TestObjectV8Internal::conditionalAttr1AttributeSetter(v8Value, info);
1991     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1992 }
1993 #endif // ENABLE(Condition1)
1994
1995 #if ENABLE(Condition1) && ENABLE(Condition2)
1996 static void conditionalAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1997 {
1998     v8::Handle<v8::Object> holder = info.Holder();
1999     TestObject* impl = V8TestObject::toNative(holder);
2000     v8SetReturnValueInt(info, impl->conditionalAttr2());
2001 }
2002 #endif // ENABLE(Condition1) && ENABLE(Condition2)
2003
2004 #if ENABLE(Condition1) && ENABLE(Condition2)
2005 static void conditionalAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2006 {
2007     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2008     TestObjectV8Internal::conditionalAttr2AttributeGetter(info);
2009     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2010 }
2011 #endif // ENABLE(Condition1) && ENABLE(Condition2)
2012
2013 #if ENABLE(Condition1) && ENABLE(Condition2)
2014 static void conditionalAttr2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2015 {
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);
2021 }
2022 #endif // ENABLE(Condition1) && ENABLE(Condition2)
2023
2024 #if ENABLE(Condition1) && ENABLE(Condition2)
2025 static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2026 {
2027     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2028     TestObjectV8Internal::conditionalAttr2AttributeSetter(v8Value, info);
2029     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2030 }
2031 #endif // ENABLE(Condition1) && ENABLE(Condition2)
2032
2033 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2034 static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2035 {
2036     v8::Handle<v8::Object> holder = info.Holder();
2037     TestObject* impl = V8TestObject::toNative(holder);
2038     v8SetReturnValueInt(info, impl->conditionalAttr3());
2039 }
2040 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2041
2042 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2043 static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2044 {
2045     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2046     TestObjectV8Internal::conditionalAttr3AttributeGetter(info);
2047     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2048 }
2049 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2050
2051 #if ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2052 static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2053 {
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);
2059 }
2060 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2061
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)
2064 {
2065     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2066     TestObjectV8Internal::conditionalAttr3AttributeSetter(v8Value, info);
2067     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2068 }
2069 #endif // ENABLE(Condition1) || ENABLE(Condition2) || ENABLE(Condition3)
2070
2071 static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2072 {
2073     v8::Handle<v8::Object> holder = info.Holder();
2074     TestObject* impl = V8TestObject::toNative(holder);
2075     v8SetReturnValue(info, impl->cachedAttribute1().v8Value());
2076 }
2077
2078 static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2079 {
2080     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2081     TestObjectV8Internal::cachedAttribute1AttributeGetter(info);
2082     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2083 }
2084
2085 static void cachedAttribute2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2086 {
2087     v8::Handle<v8::Object> holder = info.Holder();
2088     TestObject* impl = V8TestObject::toNative(holder);
2089     v8SetReturnValue(info, impl->cachedAttribute2().v8Value());
2090 }
2091
2092 static void cachedAttribute2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2093 {
2094     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2095     TestObjectV8Internal::cachedAttribute2AttributeGetter(info);
2096     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2097 }
2098
2099 static void cachedDirtyableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2100 {
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);
2108             return;
2109         }
2110     }
2111     ScriptValue v8Value = impl->cachedDirtyableAttribute();
2112     V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value.v8Value());
2113     v8SetReturnValue(info, v8Value.v8Value());
2114 }
2115
2116 static void cachedDirtyableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2117 {
2118     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2119     TestObjectV8Internal::cachedDirtyableAttributeAttributeGetter(info);
2120     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2121 }
2122
2123 static void cachedDirtyableAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2124 {
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);
2132             return;
2133         }
2134     }
2135     ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyableAttributeRaises", "TestObject", holder, info.GetIsolate());
2136     ScriptValue v8Value = impl->cachedDirtyableAttributeRaises(exceptionState);
2137     if (UNLIKELY(exceptionState.throwIfNeeded()))
2138         return;
2139     V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value.v8Value());
2140     v8SetReturnValue(info, v8Value.v8Value());
2141 }
2142
2143 static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2144 {
2145     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2146     TestObjectV8Internal::cachedDirtyableAttributeRaisesAttributeGetter(info);
2147     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2148 }
2149
2150 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2151 {
2152     v8::Handle<v8::Object> holder = info.Holder();
2153     TestObject* impl = V8TestObject::toNative(holder);
2154     v8SetReturnValue(info, impl->anyAttribute().v8Value());
2155 }
2156
2157 static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2158 {
2159     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2160     TestObjectV8Internal::anyAttributeAttributeGetter(info);
2161     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2162 }
2163
2164 static void anyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2165 {
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);
2170 }
2171
2172 static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2173 {
2174     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2175     TestObjectV8Internal::anyAttributeAttributeSetter(v8Value, info);
2176     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2177 }
2178
2179 static void callbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2180 {
2181     v8::Handle<v8::Object> holder = info.Holder();
2182     TestObject* impl = V8TestObject::toNative(holder);
2183     v8SetReturnValue(info, impl->callbackFunctionAttribute().v8Value());
2184 }
2185
2186 static void callbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2187 {
2188     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2189     TestObjectV8Internal::callbackFunctionAttributeAttributeGetter(info);
2190     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2191 }
2192
2193 static void callbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2194 {
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);
2199 }
2200
2201 static void callbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2202 {
2203     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2204     TestObjectV8Internal::callbackFunctionAttributeAttributeSetter(v8Value, info);
2205     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2206 }
2207
2208 static void enabledAtRuntimeAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2209 {
2210     v8::Handle<v8::Object> holder = info.Holder();
2211     TestObject* impl = V8TestObject::toNative(holder);
2212     v8SetReturnValueInt(info, impl->enabledAtRuntimeAttr());
2213 }
2214
2215 static void enabledAtRuntimeAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2216 {
2217     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2218     TestObjectV8Internal::enabledAtRuntimeAttrAttributeGetter(info);
2219     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2220 }
2221
2222 static void enabledAtRuntimeAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2223 {
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);
2229 }
2230
2231 static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2232 {
2233     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2234     TestObjectV8Internal::enabledAtRuntimeAttrAttributeSetter(v8Value, info);
2235     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2236 }
2237
2238 static void enabledPerContextAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2239 {
2240     v8::Handle<v8::Object> holder = info.Holder();
2241     TestObject* impl = V8TestObject::toNative(holder);
2242     v8SetReturnValueInt(info, impl->enabledPerContextAttr());
2243 }
2244
2245 static void enabledPerContextAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2246 {
2247     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2248     TestObjectV8Internal::enabledPerContextAttrAttributeGetter(info);
2249     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2250 }
2251
2252 static void enabledPerContextAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2253 {
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);
2259 }
2260
2261 static void enabledPerContextAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2262 {
2263     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2264     TestObjectV8Internal::enabledPerContextAttrAttributeSetter(v8Value, info);
2265     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2266 }
2267
2268 static void floatArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2269 {
2270     v8::Handle<v8::Object> holder = info.Holder();
2271     TestObject* impl = V8TestObject::toNative(holder);
2272     v8SetReturnValue(info, v8Array(impl->floatArray(), info.GetIsolate()));
2273 }
2274
2275 static void floatArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2276 {
2277     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2278     TestObjectV8Internal::floatArrayAttributeGetter(info);
2279     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2280 }
2281
2282 static void floatArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2283 {
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);
2288 }
2289
2290 static void floatArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2291 {
2292     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2293     TestObjectV8Internal::floatArrayAttributeSetter(v8Value, info);
2294     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2295 }
2296
2297 static void doubleArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2298 {
2299     v8::Handle<v8::Object> holder = info.Holder();
2300     TestObject* impl = V8TestObject::toNative(holder);
2301     v8SetReturnValue(info, v8Array(impl->doubleArray(), info.GetIsolate()));
2302 }
2303
2304 static void doubleArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2305 {
2306     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2307     TestObjectV8Internal::doubleArrayAttributeGetter(info);
2308     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2309 }
2310
2311 static void doubleArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2312 {
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);
2317 }
2318
2319 static void doubleArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2320 {
2321     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2322     TestObjectV8Internal::doubleArrayAttributeSetter(v8Value, info);
2323     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2324 }
2325
2326 static void messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2327 {
2328     v8::Handle<v8::Object> holder = info.Holder();
2329     TestObject* impl = V8TestObject::toNative(holder);
2330     v8SetReturnValue(info, v8Array(impl->messagePortArray(), info.GetIsolate()));
2331 }
2332
2333 static void messagePortArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2334 {
2335     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2336     TestObjectV8Internal::messagePortArrayAttributeGetter(info);
2337     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2338 }
2339
2340 static void messagePortArrayAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2341 {
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);
2346 }
2347
2348 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2349 {
2350     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2351     TestObjectV8Internal::messagePortArrayAttributeSetter(v8Value, info);
2352     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2353 }
2354
2355 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2356 {
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();
2363         return;
2364     }
2365     v8SetReturnValueFast(info, WTF::getPtr(impl->contentDocument()), impl);
2366 }
2367
2368 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2369 {
2370     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2371     TestObjectV8Internal::contentDocumentAttributeGetter(info);
2372     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2373 }
2374
2375 static void strawberryAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2376 {
2377     v8::Handle<v8::Object> holder = info.Holder();
2378     TestObject* impl = V8TestObject::toNative(holder);
2379     v8SetReturnValueInt(info, impl->blueberry());
2380 }
2381
2382 static void strawberryAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2383 {
2384     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2385     TestObjectV8Internal::strawberryAttributeGetter(info);
2386     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2387 }
2388
2389 static void strawberryAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2390 {
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);
2396 }
2397
2398 static void strawberryAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2399 {
2400     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2401     TestObjectV8Internal::strawberryAttributeSetter(v8Value, info);
2402     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2403 }
2404
2405 static void strictFloatAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2406 {
2407     v8::Handle<v8::Object> holder = info.Holder();
2408     TestObject* impl = V8TestObject::toNative(holder);
2409     v8SetReturnValue(info, impl->strictFloat());
2410 }
2411
2412 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2413 {
2414     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2415     TestObjectV8Internal::strictFloatAttributeGetter(info);
2416     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2417 }
2418
2419 static void strictFloatAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2420 {
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);
2425 }
2426
2427 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2428 {
2429     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2430     TestObjectV8Internal::strictFloatAttributeSetter(v8Value, info);
2431     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2432 }
2433
2434 static void replaceableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2435 {
2436     v8::Handle<v8::Object> holder = info.Holder();
2437     TestObject* impl = V8TestObject::toNative(holder);
2438     v8SetReturnValueInt(info, impl->replaceableAttribute());
2439 }
2440
2441 static void replaceableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2442 {
2443     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2444     TestObjectV8Internal::replaceableAttributeAttributeGetter(info);
2445     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2446 }
2447
2448 static void nullableDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2449 {
2450     v8::Handle<v8::Object> holder = info.Holder();
2451     TestObject* impl = V8TestObject::toNative(holder);
2452     bool isNull = false;
2453     double v8Value = impl->nullableDoubleAttribute(isNull);
2454     if (isNull) {
2455         v8SetReturnValueNull(info);
2456         return;
2457     }
2458     v8SetReturnValue(info, v8Value);
2459 }
2460
2461 static void nullableDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2462 {
2463     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2464     TestObjectV8Internal::nullableDoubleAttributeAttributeGetter(info);
2465     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2466 }
2467
2468 static void nullableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2469 {
2470     v8::Handle<v8::Object> holder = info.Holder();
2471     TestObject* impl = V8TestObject::toNative(holder);
2472     bool isNull = false;
2473     int v8Value = impl->nullableLongAttribute(isNull);
2474     if (isNull) {
2475         v8SetReturnValueNull(info);
2476         return;
2477     }
2478     v8SetReturnValueInt(info, v8Value);
2479 }
2480
2481 static void nullableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2482 {
2483     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2484     TestObjectV8Internal::nullableLongAttributeAttributeGetter(info);
2485     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2486 }
2487
2488 static void nullableBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2489 {
2490     v8::Handle<v8::Object> holder = info.Holder();
2491     TestObject* impl = V8TestObject::toNative(holder);
2492     bool isNull = false;
2493     bool v8Value = impl->nullableBooleanAttribute(isNull);
2494     if (isNull) {
2495         v8SetReturnValueNull(info);
2496         return;
2497     }
2498     v8SetReturnValueBool(info, v8Value);
2499 }
2500
2501 static void nullableBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2502 {
2503     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2504     TestObjectV8Internal::nullableBooleanAttributeAttributeGetter(info);
2505     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2506 }
2507
2508 static void nullableStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2509 {
2510     v8::Handle<v8::Object> holder = info.Holder();
2511     TestObject* impl = V8TestObject::toNative(holder);
2512     bool isNull = false;
2513     String v8Value = impl->nullableStringAttribute(isNull);
2514     if (isNull) {
2515         v8SetReturnValueNull(info);
2516         return;
2517     }
2518     v8SetReturnValueString(info, v8Value, info.GetIsolate());
2519 }
2520
2521 static void nullableStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2522 {
2523     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2524     TestObjectV8Internal::nullableStringAttributeAttributeGetter(info);
2525     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2526 }
2527
2528 static void nullableLongSettableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2529 {
2530     v8::Handle<v8::Object> holder = info.Holder();
2531     TestObject* impl = V8TestObject::toNative(holder);
2532     bool isNull = false;
2533     int v8Value = impl->nullableLongSettableAttribute(isNull);
2534     if (isNull) {
2535         v8SetReturnValueNull(info);
2536         return;
2537     }
2538     v8SetReturnValueInt(info, v8Value);
2539 }
2540
2541 static void nullableLongSettableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2542 {
2543     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2544     TestObjectV8Internal::nullableLongSettableAttributeAttributeGetter(info);
2545     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2546 }
2547
2548 static void nullableLongSettableAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2549 {
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);
2555 }
2556
2557 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2558 {
2559     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2560     TestObjectV8Internal::nullableLongSettableAttributeAttributeSetter(v8Value, info);
2561     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2562 }
2563
2564 static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2565 {
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()))
2570         return;
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);
2575     }
2576 }
2577
2578 static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2579 {
2580     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2581     TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetter(info);
2582     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2583 }
2584
2585 static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2586 {
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()))
2591         return;
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);
2596     }
2597 }
2598
2599 static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2600 {
2601     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2602     TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetterForMainWorld(info);
2603     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2604 }
2605
2606 static void perWorldAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2607 {
2608     v8::Handle<v8::Object> holder = info.Holder();
2609     TestObject* impl = V8TestObject::toNative(holder);
2610     v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldAttribute()), impl);
2611 }
2612
2613 static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2614 {
2615     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2616     TestObjectV8Internal::perWorldAttributeAttributeGetter(info);
2617     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2618 }
2619
2620 static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2621 {
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));
2626 }
2627
2628 static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2629 {
2630     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2631     TestObjectV8Internal::perWorldAttributeAttributeSetter(v8Value, info);
2632     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2633 }
2634
2635 static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2636 {
2637     v8::Handle<v8::Object> holder = info.Holder();
2638     TestObject* impl = V8TestObject::toNative(holder);
2639     v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldAttribute()));
2640 }
2641
2642 static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2643 {
2644     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2645     TestObjectV8Internal::perWorldAttributeAttributeGetterForMainWorld(info);
2646     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2647 }
2648
2649 static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2650 {
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));
2655 }
2656
2657 static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2658 {
2659     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2660     TestObjectV8Internal::perWorldAttributeAttributeSetterForMainWorld(v8Value, info);
2661     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2662 }
2663
2664 static void activityLoggedAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2665 {
2666     v8::Handle<v8::Object> holder = info.Holder();
2667     TestObject* impl = V8TestObject::toNative(holder);
2668     v8SetReturnValueInt(info, impl->activityLoggedAttr1());
2669 }
2670
2671 static void activityLoggedAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2672 {
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");
2679 }
2680
2681 static void activityLoggedAttr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2682 {
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);
2688 }
2689
2690 static void activityLoggedAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2691 {
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");
2697     }
2698     TestObjectV8Internal::activityLoggedAttr1AttributeSetter(v8Value, info);
2699     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2700 }
2701
2702 static void activityLoggedAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2703 {
2704     v8::Handle<v8::Object> holder = info.Holder();
2705     TestObject* impl = V8TestObject::toNative(holder);
2706     v8SetReturnValueInt(info, impl->activityLoggedAttr2());
2707 }
2708
2709 static void activityLoggedAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2710 {
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");
2717 }
2718
2719 static void activityLoggedAttr2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2720 {
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);
2726 }
2727
2728 static void activityLoggedAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2729 {
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");
2735     }
2736     TestObjectV8Internal::activityLoggedAttr2AttributeSetter(v8Value, info);
2737     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2738 }
2739
2740 static void activityLoggedAttr2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2741 {
2742     v8::Handle<v8::Object> holder = info.Holder();
2743     TestObject* impl = V8TestObject::toNative(holder);
2744     v8SetReturnValueInt(info, impl->activityLoggedAttr2());
2745 }
2746
2747 static void activityLoggedAttr2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2748 {
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");
2755 }
2756
2757 static void activityLoggedAttr2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2758 {
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);
2764 }
2765
2766 static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2767 {
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");
2773     }
2774     TestObjectV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(v8Value, info);
2775     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2776 }
2777
2778 static void activityLoggedInIsolatedWorldsAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2779 {
2780     v8::Handle<v8::Object> holder = info.Holder();
2781     TestObject* impl = V8TestObject::toNative(holder);
2782     v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttr());
2783 }
2784
2785 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2786 {
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");
2793 }
2794
2795 static void activityLoggedInIsolatedWorldsAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2796 {
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);
2802 }
2803
2804 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2805 {
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");
2811     }
2812     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetter(v8Value, info);
2813     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2814 }
2815
2816 static void activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2817 {
2818     v8::Handle<v8::Object> holder = info.Holder();
2819     TestObject* impl = V8TestObject::toNative(holder);
2820     v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttr());
2821 }
2822
2823 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2824 {
2825     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2826     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(info);
2827     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2828 }
2829
2830 static void activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2831 {
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);
2837 }
2838
2839 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2840 {
2841     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2842     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8Value, info);
2843     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2844 }
2845
2846 static void activityLoggedAttrSetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2847 {
2848     v8::Handle<v8::Object> holder = info.Holder();
2849     TestObject* impl = V8TestObject::toNative(holder);
2850     v8SetReturnValueInt(info, impl->activityLoggedAttrSetter1());
2851 }
2852
2853 static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2854 {
2855     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2856     TestObjectV8Internal::activityLoggedAttrSetter1AttributeGetter(info);
2857     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2858 }
2859
2860 static void activityLoggedAttrSetter1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2861 {
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);
2867 }
2868
2869 static void activityLoggedAttrSetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2870 {
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");
2876     }
2877     TestObjectV8Internal::activityLoggedAttrSetter1AttributeSetter(v8Value, info);
2878     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2879 }
2880
2881 static void activityLoggedAttrSetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2882 {
2883     v8::Handle<v8::Object> holder = info.Holder();
2884     TestObject* impl = V8TestObject::toNative(holder);
2885     v8SetReturnValueInt(info, impl->activityLoggedAttrSetter2());
2886 }
2887
2888 static void activityLoggedAttrSetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2889 {
2890     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2891     TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetter(info);
2892     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2893 }
2894
2895 static void activityLoggedAttrSetter2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2896 {
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);
2902 }
2903
2904 static void activityLoggedAttrSetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2905 {
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");
2911     }
2912     TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetter(v8Value, info);
2913     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2914 }
2915
2916 static void activityLoggedAttrSetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2917 {
2918     v8::Handle<v8::Object> holder = info.Holder();
2919     TestObject* impl = V8TestObject::toNative(holder);
2920     v8SetReturnValueInt(info, impl->activityLoggedAttrSetter2());
2921 }
2922
2923 static void activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2924 {
2925     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2926     TestObjectV8Internal::activityLoggedAttrSetter2AttributeGetterForMainWorld(info);
2927     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2928 }
2929
2930 static void activityLoggedAttrSetter2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2931 {
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);
2937 }
2938
2939 static void activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2940 {
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");
2946     }
2947     TestObjectV8Internal::activityLoggedAttrSetter2AttributeSetterForMainWorld(v8Value, info);
2948     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2949 }
2950
2951 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2952 {
2953     v8::Handle<v8::Object> holder = info.Holder();
2954     TestObject* impl = V8TestObject::toNative(holder);
2955     v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrSetter());
2956 }
2957
2958 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2959 {
2960     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2961     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(info);
2962     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2963 }
2964
2965 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2966 {
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);
2972 }
2973
2974 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
2975 {
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");
2981     }
2982     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8Value, info);
2983     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2984 }
2985
2986 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2987 {
2988     v8::Handle<v8::Object> holder = info.Holder();
2989     TestObject* impl = V8TestObject::toNative(holder);
2990     v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrSetter());
2991 }
2992
2993 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2994 {
2995     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2996     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(info);
2997     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
2998 }
2999
3000 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3001 {
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);
3007 }
3008
3009 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3010 {
3011     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3012     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8Value, info);
3013     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3014 }
3015
3016 static void activityLoggedAttrGetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3017 {
3018     v8::Handle<v8::Object> holder = info.Holder();
3019     TestObject* impl = V8TestObject::toNative(holder);
3020     v8SetReturnValueInt(info, impl->activityLoggedAttrGetter1());
3021 }
3022
3023 static void activityLoggedAttrGetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3024 {
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");
3031 }
3032
3033 static void activityLoggedAttrGetter1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3034 {
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);
3040 }
3041
3042 static void activityLoggedAttrGetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3043 {
3044     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3045     TestObjectV8Internal::activityLoggedAttrGetter1AttributeSetter(v8Value, info);
3046     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3047 }
3048
3049 static void activityLoggedAttrGetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3050 {
3051     v8::Handle<v8::Object> holder = info.Holder();
3052     TestObject* impl = V8TestObject::toNative(holder);
3053     v8SetReturnValueInt(info, impl->activityLoggedAttrGetter2());
3054 }
3055
3056 static void activityLoggedAttrGetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3057 {
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");
3064 }
3065
3066 static void activityLoggedAttrGetter2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3067 {
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);
3073 }
3074
3075 static void activityLoggedAttrGetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3076 {
3077     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3078     TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetter(v8Value, info);
3079     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3080 }
3081
3082 static void activityLoggedAttrGetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
3083 {
3084     v8::Handle<v8::Object> holder = info.Holder();
3085     TestObject* impl = V8TestObject::toNative(holder);
3086     v8SetReturnValueInt(info, impl->activityLoggedAttrGetter2());
3087 }
3088
3089 static void activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3090 {
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");
3097 }
3098
3099 static void activityLoggedAttrGetter2AttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3100 {
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);
3106 }
3107
3108 static void activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3109 {
3110     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3111     TestObjectV8Internal::activityLoggedAttrGetter2AttributeSetterForMainWorld(v8Value, info);
3112     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3113 }
3114
3115 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3116 {
3117     v8::Handle<v8::Object> holder = info.Holder();
3118     TestObject* impl = V8TestObject::toNative(holder);
3119     v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrGetter());
3120 }
3121
3122 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3123 {
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");
3130 }
3131
3132 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3133 {
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);
3139 }
3140
3141 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3142 {
3143     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3144     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8Value, info);
3145     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3146 }
3147
3148 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
3149 {
3150     v8::Handle<v8::Object> holder = info.Holder();
3151     TestObject* impl = V8TestObject::toNative(holder);
3152     v8SetReturnValueInt(info, impl->activityLoggedInIsolatedWorldsAttrGetter());
3153 }
3154
3155 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3156 {
3157     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3158     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(info);
3159     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3160 }
3161
3162 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3163 {
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);
3169 }
3170
3171 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3172 {
3173     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3174     TestObjectV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8Value, info);
3175     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3176 }
3177
3178 static void deprecatedStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3179 {
3180     v8SetReturnValueInt(info, TestObject::deprecatedStaticReadOnlyAttr());
3181 }
3182
3183 static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3184 {
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");
3189 }
3190
3191 static void deprecatedStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3192 {
3193     v8SetReturnValueInt(info, TestObject::deprecatedStaticAttr());
3194 }
3195
3196 static void deprecatedStaticAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3197 {
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");
3202 }
3203
3204 static void deprecatedStaticAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3205 {
3206     ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedStaticAttr", "TestObject", holder, info.GetIsolate());
3207     V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
3208     TestObject::setDeprecatedStaticAttr(cppValue);
3209 }
3210
3211 static void deprecatedStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3212 {
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");
3217 }
3218
3219 static void deprecatedReadonlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3220 {
3221     v8::Handle<v8::Object> holder = info.Holder();
3222     TestObject* impl = V8TestObject::toNative(holder);
3223     v8SetReturnValueInt(info, impl->deprecatedReadonlyAttr());
3224 }
3225
3226 static void deprecatedReadonlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3227 {
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");
3232 }
3233
3234 static void deprecatedAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3235 {
3236     v8::Handle<v8::Object> holder = info.Holder();
3237     TestObject* impl = V8TestObject::toNative(holder);
3238     v8SetReturnValueInt(info, impl->deprecatedAttr());
3239 }
3240
3241 static void deprecatedAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3242 {
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");
3247 }
3248
3249 static void deprecatedAttrAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3250 {
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);
3256 }
3257
3258 static void deprecatedAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3259 {
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");
3264 }
3265
3266 static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3267 {
3268     v8::Handle<v8::Object> holder = info.Holder();
3269     TestObject* impl = V8TestObject::toNative(holder);
3270     v8SetReturnValueFast(info, WTF::getPtr(impl->location()), impl);
3271 }
3272
3273 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3274 {
3275     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3276     TestObjectV8Internal::locationAttributeGetter(info);
3277     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3278 }
3279
3280 static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3281 {
3282     v8::Handle<v8::Object> holder = info.Holder();
3283     TestObject* proxyImpl = V8TestObject::toNative(holder);
3284     RefPtr<TestNode> impl = WTF::getPtr(proxyImpl->location());
3285     if (!impl)
3286         return;
3287     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
3288     impl->setHref(cppValue);
3289 }
3290
3291 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3292 {
3293     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3294     TestObjectV8Internal::locationAttributeSetter(v8Value, info);
3295     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3296 }
3297
3298 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
3299 {
3300     v8::Handle<v8::Object> holder = info.Holder();
3301     TestObject* impl = V8TestObject::toNative(holder);
3302     v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithException()), impl);
3303 }
3304
3305 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3306 {
3307     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
3308     TestObjectV8Internal::locationWithExceptionAttributeGetter(info);
3309     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3310 }
3311
3312 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3313 {
3314     v8::Handle<v8::Object> holder = info.Holder();
3315     TestObject* proxyImpl = V8TestObject::toNative(holder);
3316     RefPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithException());
3317     if (!impl)
3318         return;
3319     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
3320     impl->setHrefThrows(cppValue);
3321 }
3322
3323 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3324 {
3325     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
3326     TestObjectV8Internal::locationWithExceptionAttributeSetter(v8Value, info);
3327     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3328 }
3329
3330 static void TestObjectConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
3331 {
3332     v8::Handle<v8::Value> data = info.Data();
3333     ASSERT(data->IsExternal());
3334     V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
3335     if (!perContextData)
3336         return;
3337     v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
3338 }
3339
3340 static void TestSubObjMeasuredConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info)
3341 {
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");
3346 }
3347
3348 static void deprecatedConstructorConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info)
3349 {
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");
3354 }
3355
3356 static void TestObjectReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3357 {
3358     info.This()->ForceSet(name, v8Value);
3359 }
3360
3361 static void TestObjectReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
3362 {
3363     TestObjectV8Internal::TestObjectReplaceableAttributeSetter(name, v8Value, info);
3364 }
3365
3366 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3367 {
3368     TestObject* impl = V8TestObject::toNative(info.Holder());
3369     impl->voidMethod();
3370 }
3371
3372 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3373 {
3374     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3375     TestObjectV8Internal::voidMethodMethod(info);
3376     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3377 }
3378
3379 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3380 {
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();
3385         return;
3386     }
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);
3392 }
3393
3394 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3395 {
3396     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3397     TestObjectV8Internal::voidMethodWithArgsMethod(info);
3398     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3399 }
3400
3401 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3402 {
3403     TestObject* impl = V8TestObject::toNative(info.Holder());
3404     v8SetReturnValueInt(info, impl->longMethod());
3405 }
3406
3407 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3408 {
3409     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3410     TestObjectV8Internal::longMethodMethod(info);
3411     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3412 }
3413
3414 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3415 {
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();
3420         return;
3421     }
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));
3427 }
3428
3429 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3430 {
3431     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3432     TestObjectV8Internal::longMethodWithArgsMethod(info);
3433     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3434 }
3435
3436 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3437 {
3438     TestObject* impl = V8TestObject::toNative(info.Holder());
3439     v8SetReturnValue(info, impl->objMethod());
3440 }
3441
3442 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3443 {
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");
3448 }
3449
3450 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3451 {
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();
3456         return;
3457     }
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));
3463 }
3464
3465 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3466 {
3467     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3468     TestObjectV8Internal::objMethodWithArgsMethod(info);
3469     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3470 }
3471
3472 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3473 {
3474     if (UNLIKELY(info.Length() < 1)) {
3475         throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3476         return;
3477     }
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);
3481 }
3482
3483 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3484 {
3485     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3486     TestObjectV8Internal::methodWithSequenceArgMethod(info);
3487     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3488 }
3489
3490 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3491 {
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();
3496         return;
3497     }
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()));
3501 }
3502
3503 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3504 {
3505     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3506     TestObjectV8Internal::methodReturningSequenceMethod(info);
3507     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3508 }
3509
3510 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3511 {
3512     if (UNLIKELY(info.Length() < 1)) {
3513         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3514         return;
3515     }
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());
3521         return;
3522     }
3523     impl->methodWithEnumArg(enumArg);
3524 }
3525
3526 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3527 {
3528     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3529     TestObjectV8Internal::methodWithEnumArgMethod(info);
3530     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3531 }
3532
3533 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3534 {
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();
3539         return;
3540     }
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())
3546         return;
3547     v8SetReturnValue(info, result.release());
3548 }
3549
3550 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3551 {
3552     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3553     TestObjectV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info);
3554     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3555 }
3556
3557 static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3558 {
3559     if (UNLIKELY(info.Length() < 1)) {
3560         throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListener", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3561         return;
3562     }
3563     TestObject* impl = V8TestObject::toNative(info.Holder());
3564     V8TRYCATCH_VOID(RefPtrWillBeRawPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(ScriptValue(info[0], info.GetIsolate())));
3565     impl->methodQueryListListener(listener);
3566 }
3567
3568 static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3569 {
3570     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3571     TestObjectV8Internal::methodQueryListListenerMethod(info);
3572     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3573 }
3574
3575 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3576 {
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();
3581         return;
3582     }
3583     TestObject* impl = V8TestObject::toNative(info.Holder());
3584     RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(info[0], 0, 0, exceptionState, info.GetIsolate());
3585     if (exceptionState.throwIfNeeded())
3586         return;
3587     impl->serializedValue(serializedArg);
3588 }
3589
3590 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3591 {
3592     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3593     TestObjectV8Internal::serializedValueMethod(info);
3594     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3595 }
3596
3597 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3598 {
3599     if (UNLIKELY(info.Length() < 1)) {
3600         throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3601         return;
3602     }
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());
3607         return;
3608     }
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());
3612         return;
3613     }
3614     impl->optionsObject(oo, ooo);
3615 }
3616
3617 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3618 {
3619     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3620     TestObjectV8Internal::optionsObjectMethod(info);
3621     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3622 }
3623
3624 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3625 {
3626     if (UNLIKELY(info.Length() < 1)) {
3627         throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3628         return;
3629     }
3630     TestObject* impl = V8TestObject::toNative(info.Holder());
3631     V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0], 1, info.GetIsolate()));
3632     impl->optionsObjectList(list);
3633 }
3634
3635 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3636 {
3637     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3638     TestObjectV8Internal::optionsObjectListMethod(info);
3639     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3640 }
3641
3642 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3643 {
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())
3648         return;
3649 }
3650
3651 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3652 {
3653     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3654     TestObjectV8Internal::methodWithExceptionMethod(info);
3655     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3656 }
3657
3658 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3659 {
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");
3664 }
3665
3666 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3667 {
3668     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3669     V8TestObject::customMethodWithArgsMethodCustom(info);
3670     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3671 }
3672
3673 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3674 {
3675     TestObject* impl = V8TestObject::toNative(info.Holder());
3676     ScriptState* currentState = ScriptState::current();
3677     if (!currentState)
3678         return;
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());
3685         return;
3686     }
3687 }
3688
3689 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3690 {
3691     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3692     TestObjectV8Internal::withScriptStateVoidMethod(info);
3693     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3694 }
3695
3696 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3697 {
3698     TestObject* impl = V8TestObject::toNative(info.Holder());
3699     ScriptState* currentState = ScriptState::current();
3700     if (!currentState)
3701         return;
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());
3708         return;
3709     }
3710     v8SetReturnValue(info, result.release());
3711 }
3712
3713 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3714 {
3715     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3716     TestObjectV8Internal::withScriptStateObjMethod(info);
3717     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3718 }
3719
3720 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3721 {
3722     ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateVoidException", "TestObject", info.Holder(), info.GetIsolate());
3723     TestObject* impl = V8TestObject::toNative(info.Holder());
3724     ScriptState* currentState = ScriptState::current();
3725     if (!currentState)
3726         return;
3727     ScriptState& state = *currentState;
3728     impl->withScriptStateVoidException(&state, exceptionState);
3729     if (exceptionState.throwIfNeeded())
3730         return;
3731     if (state.hadException()) {
3732         v8::Local<v8::Value> exception = state.exception();
3733         state.clearException();
3734         throwError(exception, info.GetIsolate());
3735         return;
3736     }
3737 }
3738
3739 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3740 {
3741     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3742     TestObjectV8Internal::withScriptStateVoidExceptionMethod(info);
3743     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3744 }
3745
3746 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3747 {
3748     ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate());
3749     TestObject* impl = V8TestObject::toNative(info.Holder());
3750     ScriptState* currentState = ScriptState::current();
3751     if (!currentState)
3752         return;
3753     ScriptState& state = *currentState;
3754     RefPtr<TestObject> result = impl->withScriptStateObjException(&state, exceptionState);
3755     if (exceptionState.throwIfNeeded())
3756         return;
3757     if (state.hadException()) {
3758         v8::Local<v8::Value> exception = state.exception();
3759         state.clearException();
3760         throwError(exception, info.GetIsolate());
3761         return;
3762     }
3763     v8SetReturnValue(info, result.release());
3764 }
3765
3766 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3767 {
3768     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3769     TestObjectV8Internal::withScriptStateObjExceptionMethod(info);
3770     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3771 }
3772
3773 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3774 {
3775     TestObject* impl = V8TestObject::toNative(info.Holder());
3776     ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
3777     impl->withExecutionContext(scriptContext);
3778 }
3779
3780 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3781 {
3782     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3783     TestObjectV8Internal::withExecutionContextMethod(info);
3784     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3785 }
3786
3787 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3788 {
3789     TestObject* impl = V8TestObject::toNative(info.Holder());
3790     ScriptState* currentState = ScriptState::current();
3791     if (!currentState)
3792         return;
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());
3800         return;
3801     }
3802 }
3803
3804 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3805 {
3806     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3807     TestObjectV8Internal::withExecutionContextAndScriptStateMethod(info);
3808     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3809 }
3810
3811 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3812 {
3813     ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecutionContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate());
3814     TestObject* impl = V8TestObject::toNative(info.Holder());
3815     ScriptState* currentState = ScriptState::current();
3816     if (!currentState)
3817         return;
3818     ScriptState& state = *currentState;
3819     ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
3820     RefPtr<TestObject> result = impl->withExecutionContextAndScriptStateObjException(&state, scriptContext, exceptionState);
3821     if (exceptionState.throwIfNeeded())
3822         return;
3823     if (state.hadException()) {
3824         v8::Local<v8::Value> exception = state.exception();
3825         state.clearException();
3826         throwError(exception, info.GetIsolate());
3827         return;
3828     }
3829     v8SetReturnValue(info, result.release());
3830 }
3831
3832 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3833 {
3834     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3835     TestObjectV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info);
3836     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3837 }
3838
3839 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3840 {
3841     TestObject* impl = V8TestObject::toNative(info.Holder());
3842     ScriptState* currentState = ScriptState::current();
3843     if (!currentState)
3844         return;
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());
3852         return;
3853     }
3854     v8SetReturnValue(info, result.release());
3855 }
3856
3857 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3858 {
3859     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3860     TestObjectV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info);
3861     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3862 }
3863
3864 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3865 {
3866     TestObject* impl = V8TestObject::toNative(info.Holder());
3867     impl->withActiveWindowAndFirstWindow(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()));
3868 }
3869
3870 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3871 {
3872     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3873     TestObjectV8Internal::withActiveWindowAndFirstWindowMethod(info);
3874     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3875 }
3876
3877 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3878 {
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();
3883         return;
3884     }
3885     V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[0], exceptionState), exceptionState);
3886     impl->methodWithOptionalArg(opt);
3887 }
3888
3889 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3890 {
3891     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3892     TestObjectV8Internal::methodWithOptionalArgMethod(info);
3893     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3894 }
3895
3896 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3897 {
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();
3902         return;
3903     }
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);
3908         return;
3909     }
3910     V8TRYCATCH_EXCEPTION_VOID(int, opt, toInt32(info[1], exceptionState), exceptionState);
3911     impl->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
3912 }
3913
3914 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3915 {
3916     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3917     TestObjectV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info);
3918     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3919 }
3920
3921 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3922 {
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();
3927         return;
3928     }
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);
3933         return;
3934     }
3935     V8TRYCATCH_EXCEPTION_VOID(int, opt1, toInt32(info[1], exceptionState), exceptionState);
3936     if (UNLIKELY(info.Length() <= 2)) {
3937         impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
3938         return;
3939     }
3940     V8TRYCATCH_EXCEPTION_VOID(int, opt2, toInt32(info[2], exceptionState), exceptionState);
3941     impl->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
3942 }
3943
3944 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3945 {
3946     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3947     TestObjectV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info);
3948     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3949 }
3950
3951 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3952 {
3953     TestObject* impl = V8TestObject::toNative(info.Holder());
3954     if (UNLIKELY(info.Length() <= 0)) {
3955         impl->methodWithOptionalString();
3956         return;
3957     }
3958     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
3959     impl->methodWithOptionalString(str);
3960 }
3961
3962 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3963 {
3964     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3965     TestObjectV8Internal::methodWithOptionalStringMethod(info);
3966     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3967 }
3968
3969 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3970 {
3971     TestObject* impl = V8TestObject::toNative(info.Holder());
3972     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
3973     impl->methodWithOptionalStringIsUndefined(str);
3974 }
3975
3976 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3977 {
3978     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3979     TestObjectV8Internal::methodWithOptionalStringIsUndefinedMethod(info);
3980     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3981 }
3982
3983 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3984 {
3985     TestObject* impl = V8TestObject::toNative(info.Holder());
3986     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull(info, 0));
3987     impl->methodWithOptionalStringIsNullString(str);
3988 }
3989
3990 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3991 {
3992     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3993     TestObjectV8Internal::methodWithOptionalStringIsNullStringMethod(info);
3994     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
3995 }
3996
3997 static void methodWithCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3998 {
3999     if (UNLIKELY(info.Length() < 1)) {
4000         throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4001         return;
4002     }
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());
4006         return;
4007     }
4008     OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4009     impl->methodWithCallbackInterfaceArg(callbackInterface.release());
4010 }
4011
4012 static void methodWithCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4013 {
4014     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4015     TestObjectV8Internal::methodWithCallbackInterfaceArgMethod(info);
4016     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4017 }
4018
4019 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4020 {
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();
4025         return;
4026     }
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();
4032         return;
4033     }
4034     OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[1]), currentExecutionContext(info.GetIsolate()));
4035     impl->methodWithNonCallbackArgAndCallbackInterfaceArg(nonCallback, callbackInterface.release());
4036 }
4037
4038 static void methodWithNonCallbackArgAndCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4039 {
4040     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4041     TestObjectV8Internal::methodWithNonCallbackArgAndCallbackInterfaceArgMethod(info);
4042     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4043 }
4044
4045 static void methodWithCallbackInterfaceAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4046 {
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());
4052             return;
4053         }
4054         callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4055     }
4056     impl->methodWithCallbackInterfaceAndOptionalArg(callbackInterface.release());
4057 }
4058
4059 static void methodWithCallbackInterfaceAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4060 {
4061     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4062     TestObjectV8Internal::methodWithCallbackInterfaceAndOptionalArgMethod(info);
4063     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4064 }
4065
4066 static void methodWithNullableCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4067 {
4068     if (UNLIKELY(info.Length() < 1)) {
4069         throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackInterfaceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4070         return;
4071     }
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());
4075         return;
4076     }
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());
4079 }
4080
4081 static void methodWithNullableCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4082 {
4083     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4084     TestObjectV8Internal::methodWithNullableCallbackInterfaceArgMethod(info);
4085     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4086 }
4087
4088 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4089 {
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());
4094             return;
4095         }
4096         callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4097     }
4098     TestObject::staticMethodWithCallbackAndOptionalArg(callbackInterface.release());
4099 }
4100
4101 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4102 {
4103     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4104     TestObjectV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info);
4105     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4106 }
4107
4108 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4109 {
4110     if (UNLIKELY(info.Length() < 1)) {
4111         throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4112         return;
4113     }
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());
4116         return;
4117     }
4118     OwnPtr<TestCallbackInterface> callbackInterface = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4119     TestObject::staticMethodWithCallbackArg(callbackInterface.release());
4120 }
4121
4122 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4123 {
4124     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4125     TestObjectV8Internal::staticMethodWithCallbackArgMethod(info);
4126     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4127 }
4128
4129 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4130 {
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();
4135         return;
4136     }
4137     TestObject* impl = V8TestObject::toNative(info.Holder());
4138     V8TRYCATCH_EXCEPTION_VOID(int, value, toInt8(info[0], EnforceRange, exceptionState), exceptionState);
4139     impl->methodWithEnforceRangeInt8(value);
4140 }
4141
4142 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4143 {
4144     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4145     TestObjectV8Internal::methodWithEnforceRangeInt8Method(info);
4146     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4147 }
4148
4149 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4150 {
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();
4155         return;
4156     }
4157     TestObject* impl = V8TestObject::toNative(info.Holder());
4158     V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt8(info[0], EnforceRange, exceptionState), exceptionState);
4159     impl->methodWithEnforceRangeUInt8(value);
4160 }
4161
4162 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4163 {
4164     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4165     TestObjectV8Internal::methodWithEnforceRangeUInt8Method(info);
4166     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4167 }
4168
4169 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4170 {
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();
4175         return;
4176     }
4177     TestObject* impl = V8TestObject::toNative(info.Holder());
4178     V8TRYCATCH_EXCEPTION_VOID(int, value, toInt16(info[0], EnforceRange, exceptionState), exceptionState);
4179     impl->methodWithEnforceRangeInt16(value);
4180 }
4181
4182 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4183 {
4184     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4185     TestObjectV8Internal::methodWithEnforceRangeInt16Method(info);
4186     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4187 }
4188
4189 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4190 {
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();
4195         return;
4196     }
4197     TestObject* impl = V8TestObject::toNative(info.Holder());
4198     V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt16(info[0], EnforceRange, exceptionState), exceptionState);
4199     impl->methodWithEnforceRangeUInt16(value);
4200 }
4201
4202 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4203 {
4204     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4205     TestObjectV8Internal::methodWithEnforceRangeUInt16Method(info);
4206     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4207 }
4208
4209 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4210 {
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();
4215         return;
4216     }
4217     TestObject* impl = V8TestObject::toNative(info.Holder());
4218     V8TRYCATCH_EXCEPTION_VOID(int, value, toInt32(info[0], EnforceRange, exceptionState), exceptionState);
4219     impl->methodWithEnforceRangeInt32(value);
4220 }
4221
4222 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4223 {
4224     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4225     TestObjectV8Internal::methodWithEnforceRangeInt32Method(info);
4226     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4227 }
4228
4229 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4230 {
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();
4235         return;
4236     }
4237     TestObject* impl = V8TestObject::toNative(info.Holder());
4238     V8TRYCATCH_EXCEPTION_VOID(unsigned, value, toUInt32(info[0], EnforceRange, exceptionState), exceptionState);
4239     impl->methodWithEnforceRangeUInt32(value);
4240 }
4241
4242 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4243 {
4244     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4245     TestObjectV8Internal::methodWithEnforceRangeUInt32Method(info);
4246     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4247 }
4248
4249 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4250 {
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();
4255         return;
4256     }
4257     TestObject* impl = V8TestObject::toNative(info.Holder());
4258     V8TRYCATCH_EXCEPTION_VOID(long long, value, toInt64(info[0], EnforceRange, exceptionState), exceptionState);
4259     impl->methodWithEnforceRangeInt64(value);
4260 }
4261
4262 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4263 {
4264     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4265     TestObjectV8Internal::methodWithEnforceRangeInt64Method(info);
4266     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4267 }
4268
4269 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4270 {
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();
4275         return;
4276     }
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);
4280 }
4281
4282 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4283 {
4284     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4285     TestObjectV8Internal::methodWithEnforceRangeUInt64Method(info);
4286     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4287 }
4288
4289 #if ENABLE(Condition1)
4290 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4291 {
4292     TestObject* impl = V8TestObject::toNative(info.Holder());
4293     v8SetReturnValueString(info, impl->conditionalMethod1(), info.GetIsolate());
4294 }
4295 #endif // ENABLE(Condition1)
4296
4297 #if ENABLE(Condition1)
4298 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4299 {
4300     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4301     TestObjectV8Internal::conditionalMethod1Method(info);
4302     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4303 }
4304 #endif // ENABLE(Condition1)
4305
4306 #if ENABLE(Condition1) && ENABLE(Condition2)
4307 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4308 {
4309     TestObject* impl = V8TestObject::toNative(info.Holder());
4310     impl->conditionalMethod2();
4311 }
4312 #endif // ENABLE(Condition1) && ENABLE(Condition2)
4313
4314 #if ENABLE(Condition1) && ENABLE(Condition2)
4315 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4316 {
4317     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4318     TestObjectV8Internal::conditionalMethod2Method(info);
4319     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4320 }
4321 #endif // ENABLE(Condition1) && ENABLE(Condition2)
4322
4323 #if ENABLE(Condition1) || ENABLE(Condition2)
4324 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4325 {
4326     TestObject* impl = V8TestObject::toNative(info.Holder());
4327     impl->conditionalMethod3();
4328 }
4329 #endif // ENABLE(Condition1) || ENABLE(Condition2)
4330
4331 #if ENABLE(Condition1) || ENABLE(Condition2)
4332 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4333 {
4334     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4335     TestObjectV8Internal::conditionalMethod3Method(info);
4336     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4337 }
4338 #endif // ENABLE(Condition1) || ENABLE(Condition2)
4339
4340 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4341 {
4342     TestObject* impl = V8TestObject::toNative(info.Holder());
4343     v8SetReturnValue(info, impl->callbackFunctionReturnValue().v8Value());
4344 }
4345
4346 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4347 {
4348     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4349     TestObjectV8Internal::callbackFunctionReturnValueMethod(info);
4350     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4351 }
4352
4353 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4354 {
4355     if (UNLIKELY(info.Length() < 1)) {
4356         throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgument", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4357         return;
4358     }
4359     TestObject* impl = V8TestObject::toNative(info.Holder());
4360     V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate()));
4361     impl->callbackFunctionArgument(function);
4362 }
4363
4364 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4365 {
4366     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4367     TestObjectV8Internal::callbackFunctionArgumentMethod(info);
4368     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4369 }
4370
4371 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4372 {
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();
4377         return;
4378     }
4379     TestObject* impl = V8TestObject::toNative(info.Holder());
4380     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4381     impl->overloadedMethod(longArg);
4382 }
4383
4384 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4385 {
4386     if (UNLIKELY(info.Length() < 1)) {
4387         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4388         return;
4389     }
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());
4393         return;
4394     }
4395     OwnPtr<TestCallbackInterface> callbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContext(info.GetIsolate()));
4396     impl->overloadedMethod(callbackInterfaceArg.release());
4397 }
4398
4399 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4400 {
4401     if (UNLIKELY(info.Length() < 1)) {
4402         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4403         return;
4404     }
4405     TestObject* impl = V8TestObject::toNative(info.Holder());
4406     V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4407     impl->overloadedMethod(objArg);
4408 }
4409
4410 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4411 {
4412     if (UNLIKELY(info.Length() < 1)) {
4413         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4414         return;
4415     }
4416     TestObject* impl = V8TestObject::toNative(info.Holder());
4417     V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
4418     impl->overloadedMethod(arrayArg);
4419 }
4420
4421 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4422 {
4423     if (UNLIKELY(info.Length() < 1)) {
4424         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4425         return;
4426     }
4427     TestObject* impl = V8TestObject::toNative(info.Holder());
4428     V8TRYCATCH_VOID(Vector<unsigned>, sequenceArg, toNativeArray<unsigned>(info[0], 1, info.GetIsolate()));
4429     impl->overloadedMethod(sequenceArg);
4430 }
4431
4432 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4433 {
4434     if (((info.Length() == 1))) {
4435         overloadedMethod1Method(info);
4436         return;
4437     }
4438     if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsFunction()))) {
4439         overloadedMethod2Method(info);
4440         return;
4441     }
4442     if (((info.Length() == 1) && (V8TestObject::hasInstance(info[0], info.GetIsolate())))) {
4443         overloadedMethod3Method(info);
4444         return;
4445     }
4446     if (((info.Length() == 1) && (info[0]->IsArray()))) {
4447         overloadedMethod4Method(info);
4448         return;
4449     }
4450     if (((info.Length() == 1) && (info[0]->IsArray()))) {
4451         overloadedMethod5Method(info);
4452         return;
4453     }
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();
4458         return;
4459     }
4460     exceptionState.throwTypeError("No function was found that matched the signature provided.");
4461     exceptionState.throwIfNeeded();
4462 }
4463
4464 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4465 {
4466     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4467     TestObjectV8Internal::overloadedMethodMethod(info);
4468     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4469 }
4470
4471 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4472 {
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();
4477         return;
4478     }
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);
4483         return;
4484     }
4485     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), exceptionState);
4486     impl->overloadedMethodA(objArg, longArg);
4487 }
4488
4489 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4490 {
4491     if (UNLIKELY(info.Length() < 2)) {
4492         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4493         return;
4494     }
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);
4499 }
4500
4501 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4502 {
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);
4505         return;
4506     }
4507     if (((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate())))) {
4508         overloadedMethodA2Method(info);
4509         return;
4510     }
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();
4515         return;
4516     }
4517     exceptionState.throwTypeError("No function was found that matched the signature provided.");
4518     exceptionState.throwIfNeeded();
4519 }
4520
4521 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4522 {
4523     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4524     TestObjectV8Internal::overloadedMethodAMethod(info);
4525     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4526 }
4527
4528 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4529 {
4530     if (UNLIKELY(info.Length() < 1)) {
4531         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4532         return;
4533     }
4534     TestObject* impl = V8TestObject::toNative(info.Holder());
4535     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4536     impl->overloadedMethodB(strArg);
4537 }
4538
4539 static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4540 {
4541     if (UNLIKELY(info.Length() < 1)) {
4542         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4543         return;
4544     }
4545     TestObject* impl = V8TestObject::toNative(info.Holder());
4546     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4547     impl->overloadedMethodB(strArg);
4548 }
4549
4550 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4551 {
4552     if (((info.Length() == 1))) {
4553         overloadedMethodB1Method(info);
4554         return;
4555     }
4556     if (((info.Length() == 1) && (isUndefinedOrNull(info[0]) || info[0]->IsString() || info[0]->IsObject()))) {
4557         overloadedMethodB2Method(info);
4558         return;
4559     }
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();
4564         return;
4565     }
4566     exceptionState.throwTypeError("No function was found that matched the signature provided.");
4567     exceptionState.throwIfNeeded();
4568 }
4569
4570 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4571 {
4572     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4573     TestObjectV8Internal::overloadedMethodBMethod(info);
4574     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4575 }
4576
4577 static void overloadedMethodC1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4578 {
4579     if (UNLIKELY(info.Length() < 1)) {
4580         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4581         return;
4582     }
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());
4587         return;
4588     }
4589     impl->overloadedMethodC(dictionaryArg);
4590 }
4591
4592 static void overloadedMethodC2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4593 {
4594     if (UNLIKELY(info.Length() < 1)) {
4595         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4596         return;
4597     }
4598     TestObject* impl = V8TestObject::toNative(info.Holder());
4599     V8TRYCATCH_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue()));
4600     impl->overloadedMethodC(doubleArg);
4601 }
4602
4603 static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4604 {
4605     if (((info.Length() == 1) && (info[0]->IsObject()))) {
4606         overloadedMethodC1Method(info);
4607         return;
4608     }
4609     if (((info.Length() == 1))) {
4610         overloadedMethodC2Method(info);
4611         return;
4612     }
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();
4617         return;
4618     }
4619     exceptionState.throwTypeError("No function was found that matched the signature provided.");
4620     exceptionState.throwIfNeeded();
4621 }
4622
4623 static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4624 {
4625     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4626     TestObjectV8Internal::overloadedMethodCMethod(info);
4627     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4628 }
4629
4630 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4631 {
4632     TestObject::classMethod();
4633 }
4634
4635 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4636 {
4637     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4638     TestObjectV8Internal::classMethodMethod(info);
4639     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4640 }
4641
4642 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4643 {
4644     ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethodWithOptional", "TestObject", info.Holder(), info.GetIsolate());
4645     if (UNLIKELY(info.Length() <= 0)) {
4646         v8SetReturnValueInt(info, TestObject::classMethodWithOptional());
4647         return;
4648     }
4649     V8TRYCATCH_EXCEPTION_VOID(int, arg, toInt32(info[0], exceptionState), exceptionState);
4650     v8SetReturnValueInt(info, TestObject::classMethodWithOptional(arg));
4651 }
4652
4653 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4654 {
4655     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4656     TestObjectV8Internal::classMethodWithOptionalMethod(info);
4657     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4658 }
4659
4660 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4661 {
4662     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4663     V8TestObject::classMethod2MethodCustom(info);
4664     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4665 }
4666
4667 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4668 {
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();
4673         return;
4674     }
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);
4685 }
4686
4687 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4688 {
4689     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4690     TestObjectV8Internal::classMethodWithClampMethod(info);
4691     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4692 }
4693
4694 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4695 {
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();
4700         return;
4701     }
4702     TestObject* impl = V8TestObject::toNative(info.Holder());
4703     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4704     impl->enabledAtRuntimeMethod(longArg);
4705 }
4706
4707 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4708 {
4709     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4710     TestObjectV8Internal::enabledAtRuntimeMethodMethod(info);
4711     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4712 }
4713
4714 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4715 {
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();
4720         return;
4721     }
4722     TestObject* impl = V8TestObject::toNative(info.Holder());
4723     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4724     impl->enabledPerContextMethod(longArg);
4725 }
4726
4727 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4728 {
4729     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4730     TestObjectV8Internal::enabledPerContextMethodMethod(info);
4731     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4732 }
4733
4734 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4735 {
4736     if (UNLIKELY(info.Length() < 1)) {
4737         throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLongSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4738         return;
4739     }
4740     TestObject* impl = V8TestObject::toNative(info.Holder());
4741     V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsigned>(info[0], 1, info.GetIsolate()));
4742     impl->methodWithUnsignedLongSequence(unsignedLongSequence);
4743 }
4744
4745 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4746 {
4747     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4748     TestObjectV8Internal::methodWithUnsignedLongSequenceMethod(info);
4749     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4750 }
4751
4752 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4753 {
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();
4758         return;
4759     }
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())
4764         return;
4765     v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
4766 }
4767
4768 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4769 {
4770     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4771     TestObjectV8Internal::stringArrayFunctionMethod(info);
4772     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4773 }
4774
4775 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4776 {
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();
4781         return;
4782     }
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())
4787         return;
4788     v8SetReturnValue(info, result.release());
4789 }
4790
4791 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4792 {
4793     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4794     TestObjectV8Internal::domStringListFunctionMethod(info);
4795     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4796 }
4797
4798 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4799 {
4800     if (UNLIKELY(info.Length() < 1)) {
4801         throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4802         return;
4803     }
4804     TestObject* impl = V8TestObject::toNative(info.Holder());
4805     V8TRYCATCH_VOID(TestNode*, value, V8TestNode::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4806     impl->convert1(value);
4807 }
4808
4809 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4810 {
4811     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4812     TestObjectV8Internal::convert1Method(info);
4813     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4814 }
4815
4816 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4817 {
4818     if (UNLIKELY(info.Length() < 1)) {
4819         throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4820         return;
4821     }
4822     TestObject* impl = V8TestObject::toNative(info.Holder());
4823     V8TRYCATCH_VOID(TestNode*, value, V8TestNode::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
4824     impl->convert2(value);
4825 }
4826
4827 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4828 {
4829     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4830     TestObjectV8Internal::convert2Method(info);
4831     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4832 }
4833
4834 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4835 {
4836     TestObject* impl = V8TestObject::toNative(info.Holder());
4837     impl->banana();
4838 }
4839
4840 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4841 {
4842     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4843     TestObjectV8Internal::orangeMethod(info);
4844     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4845 }
4846
4847 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4848 {
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();
4853         return;
4854     }
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())
4861         return;
4862     v8SetReturnValueBool(info, result);
4863 }
4864
4865 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4866 {
4867     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4868     TestObjectV8Internal::strictFunctionMethod(info);
4869     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4870 }
4871
4872 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4873 {
4874     if (UNLIKELY(info.Length() < 1)) {
4875         throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4876         return;
4877     }
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);
4882 }
4883
4884 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4885 {
4886     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4887     TestObjectV8Internal::variadicStringMethodMethod(info);
4888     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4889 }
4890
4891 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4892 {
4893     if (UNLIKELY(info.Length() < 1)) {
4894         throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4895         return;
4896     }
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);
4901 }
4902
4903 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4904 {
4905     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4906     TestObjectV8Internal::variadicDoubleMethodMethod(info);
4907     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4908 }
4909
4910 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4911 {
4912     if (UNLIKELY(info.Length() < 1)) {
4913         throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4914         return;
4915     }
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());
4922             return;
4923         }
4924         tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i])));
4925     }
4926     impl->variadicNodeMethod(head, tail);
4927 }
4928
4929 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4930 {
4931     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4932     TestObjectV8Internal::variadicNodeMethodMethod(info);
4933     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4934 }
4935
4936 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4937 {
4938     TestObject* impl = V8TestObject::toNative(info.Holder());
4939     impl->perWorldMethod();
4940 }
4941
4942 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4943 {
4944     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4945     TestObjectV8Internal::perWorldMethodMethod(info);
4946     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4947 }
4948
4949 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4950 {
4951     TestObject* impl = V8TestObject::toNative(info.Holder());
4952     impl->perWorldMethod();
4953 }
4954
4955 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4956 {
4957     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4958     TestObjectV8Internal::perWorldMethodMethodForMainWorld(info);
4959     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
4960 }
4961
4962 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4963 {
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();
4968         return;
4969     }
4970     TestObject* impl = V8TestObject::toNative(info.Holder());
4971     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4972     impl->overloadedPerWorldMethod(longArg);
4973 }
4974
4975 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4976 {
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();
4981         return;
4982     }
4983     TestObject* impl = V8TestObject::toNative(info.Holder());
4984     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
4985     impl->overloadedPerWorldMethod(longArg);
4986 }
4987
4988 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4989 {
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();
4994         return;
4995     }
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);
5000 }
5001
5002 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5003 {
5004     if (((info.Length() == 1))) {
5005         overloadedPerWorldMethod1Method(info);
5006         return;
5007     }
5008     if (((info.Length() == 2))) {
5009         overloadedPerWorldMethod2Method(info);
5010         return;
5011     }
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();
5016         return;
5017     }
5018     exceptionState.throwTypeError("No function was found that matched the signature provided.");
5019     exceptionState.throwIfNeeded();
5020 }
5021
5022 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5023 {
5024     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5025     TestObjectV8Internal::overloadedPerWorldMethodMethod(info);
5026     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5027 }
5028
5029 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5030 {
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();
5035         return;
5036     }
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);
5041 }
5042
5043 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5044 {
5045     if (((info.Length() == 1))) {
5046         overloadedPerWorldMethod1MethodForMainWorld(info);
5047         return;
5048     }
5049     if (((info.Length() == 2))) {
5050         overloadedPerWorldMethod2MethodForMainWorld(info);
5051         return;
5052     }
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();
5057         return;
5058     }
5059     exceptionState.throwTypeError("No function was found that matched the signature provided.");
5060     exceptionState.throwIfNeeded();
5061 }
5062
5063 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5064 {
5065     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5066     TestObjectV8Internal::overloadedPerWorldMethodMethodForMainWorld(info);
5067     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5068 }
5069
5070 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
5071 {
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();
5076         return;
5077     }
5078     TestObject* impl = V8TestObject::toNative(info.Holder());
5079     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5080     impl->activityLoggedMethod1(longArg);
5081 }
5082
5083 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5084 {
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");
5090     }
5091     TestObjectV8Internal::activityLoggedMethod1Method(info);
5092     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5093 }
5094
5095 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
5096 {
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();
5101         return;
5102     }
5103     TestObject* impl = V8TestObject::toNative(info.Holder());
5104     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5105     impl->activityLoggedMethod2(longArg);
5106 }
5107
5108 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5109 {
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");
5115     }
5116     TestObjectV8Internal::activityLoggedMethod2Method(info);
5117     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5118 }
5119
5120 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5121 {
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();
5126         return;
5127     }
5128     TestObject* impl = V8TestObject::toNative(info.Holder());
5129     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5130     impl->activityLoggedMethod2(longArg);
5131 }
5132
5133 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5134 {
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");
5140     }
5141     TestObjectV8Internal::activityLoggedMethod2MethodForMainWorld(info);
5142     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5143 }
5144
5145 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5146 {
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();
5151         return;
5152     }
5153     TestObject* impl = V8TestObject::toNative(info.Holder());
5154     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5155     impl->activityLoggedInIsolatedWorldMethod(longArg);
5156 }
5157
5158 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5159 {
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");
5165     }
5166     TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethod(info);
5167     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5168 }
5169
5170 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5171 {
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();
5176         return;
5177     }
5178     TestObject* impl = V8TestObject::toNative(info.Holder());
5179     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5180     impl->activityLoggedInIsolatedWorldMethod(longArg);
5181 }
5182
5183 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5184 {
5185     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5186     TestObjectV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(info);
5187     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5188 }
5189
5190 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
5191 {
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();
5196         return;
5197     }
5198     TestObject* impl = V8TestObject::toNative(info.Holder());
5199     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5200     impl->overloadedActivityLoggedMethod(longArg);
5201 }
5202
5203 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5204 {
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();
5209         return;
5210     }
5211     TestObject* impl = V8TestObject::toNative(info.Holder());
5212     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
5213     impl->overloadedActivityLoggedMethod(longArg);
5214 }
5215
5216 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
5217 {
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();
5222         return;
5223     }
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);
5228 }
5229
5230 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5231 {
5232     if (((info.Length() == 1))) {
5233         overloadedActivityLoggedMethod1Method(info);
5234         return;
5235     }
5236     if (((info.Length() == 2))) {
5237         overloadedActivityLoggedMethod2Method(info);
5238         return;
5239     }
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();
5244         return;
5245     }
5246     exceptionState.throwTypeError("No function was found that matched the signature provided.");
5247     exceptionState.throwIfNeeded();
5248 }
5249
5250 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5251 {
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");
5257     }
5258     TestObjectV8Internal::overloadedActivityLoggedMethodMethod(info);
5259     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5260 }
5261
5262 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5263 {
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();
5268         return;
5269     }
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);
5274 }
5275
5276 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5277 {
5278     if (((info.Length() == 1))) {
5279         overloadedActivityLoggedMethod1MethodForMainWorld(info);
5280         return;
5281     }
5282     if (((info.Length() == 2))) {
5283         overloadedActivityLoggedMethod2MethodForMainWorld(info);
5284         return;
5285     }
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();
5290         return;
5291     }
5292     exceptionState.throwTypeError("No function was found that matched the signature provided.");
5293     exceptionState.throwIfNeeded();
5294 }
5295
5296 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
5297 {
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");
5303     }
5304     TestObjectV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info);
5305     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5306 }
5307
5308 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5309 {
5310     TestObject* impl = V8TestObject::toNative(info.Holder());
5311     impl->deprecatedMethod();
5312 }
5313
5314 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5315 {
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");
5320 }
5321
5322 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
5323 {
5324     TestObject::deprecatedStaticMethod();
5325 }
5326
5327 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5328 {
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");
5333 }
5334
5335 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
5336 {
5337     TestObject* impl = V8TestObject::toNative(info.Holder());
5338     RefPtr<Node> result = impl->anonymousIndexedGetter(index);
5339     if (!result)
5340         return;
5341     v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl);
5342 }
5343
5344 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
5345 {
5346     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
5347     TestObjectV8Internal::indexedPropertyGetter(index, info);
5348     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5349 }
5350
5351 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
5352 {
5353     if (info.Holder()->HasRealNamedProperty(name))
5354         return;
5355     if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
5356         return;
5357
5358     TestObject* impl = V8TestObject::toNative(info.Holder());
5359     AtomicString propertyName = toCoreAtomicString(name);
5360     String result = impl->anonymousNamedGetter(propertyName);
5361     if (result.isNull())
5362         return;
5363     v8SetReturnValueString(info, result, info.GetIsolate());
5364 }
5365
5366 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
5367 {
5368     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5369     TestObjectV8Internal::namedPropertyGetter(name, info);
5370     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5371 }
5372
5373 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
5374 {
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())
5381         return;
5382     if (!result)
5383         return;
5384     v8SetReturnValueInt(info, v8::None);
5385 }
5386
5387 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
5388 {
5389     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5390     TestObjectV8Internal::namedPropertyQuery(name, info);
5391     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5392 }
5393
5394 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
5395 {
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())
5402         return;
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);
5407 }
5408
5409 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
5410 {
5411     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5412     TestObjectV8Internal::namedPropertyEnumerator(info);
5413     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5414 }
5415
5416 } // namespace TestObjectV8Internal
5417
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 */},
5533 };
5534
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)},
5537 };
5538
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},
5617 };
5618
5619 static void configureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
5620 {
5621     functionTemplate->ReadOnlyPrototype();
5622
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),
5628         isolate);
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);
5635     }
5636     static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = {
5637         {"DEPRECATED_CONSTANT", 1},
5638     };
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));
5655
5656     // Custom toString template
5657     functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
5658 }
5659
5660 v8::Handle<v8::FunctionTemplate> V8TestObject::domTemplate(v8::Isolate* isolate)
5661 {
5662     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
5663     v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo));
5664     if (!result.IsEmpty())
5665         return result;
5666
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);
5671     return result;
5672 }
5673
5674 bool V8TestObject::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
5675 {
5676     return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
5677 }
5678
5679 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
5680 {
5681     return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
5682 }
5683
5684 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
5685 {
5686     return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0;
5687 }
5688
5689 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, TestObject* impl, v8::Isolate* isolate)
5690 {
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);
5696     }
5697 }
5698
5699 void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate)
5700 {
5701     v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate));
5702
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());
5706 }
5707
5708 EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object)
5709 {
5710     return toNative(object);
5711 }
5712
5713 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
5714 {
5715     ASSERT(impl);
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);
5722     }
5723
5724     v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
5725     if (UNLIKELY(wrapper.IsEmpty()))
5726         return wrapper;
5727
5728     installPerContextEnabledProperties(wrapper, impl.get(), isolate);
5729     V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
5730     return wrapper;
5731 }
5732
5733 void V8TestObject::derefObject(void* object)
5734 {
5735     fromInternalPointer(object)->deref();
5736 }
5737
5738 template<>
5739 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
5740 {
5741     return toV8(impl, creationContext, isolate);
5742 }
5743
5744 } // namespace WebCore