2 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
34 #include "V8TestObject.h"
36 #include "HTMLNames.h"
37 #include "RuntimeEnabledFeatures.h"
38 #include "V8DOMStringList.h"
39 #include "V8Document.h"
40 #include "V8EventTarget.h"
41 #include "V8MessagePort.h"
43 #include "V8SVGDocument.h"
44 #include "V8SVGPoint.h"
45 #include "V8TestCallback.h"
46 #include "V8TestInterface.h"
47 #include "V8TestNode.h"
48 #include "V8TestObjectectA.h"
49 #include "V8TestObjectectB.h"
50 #include "V8TestObjectectC.h"
51 #include "V8TestSubObj.h"
52 #include "bindings/v8/BindingSecurity.h"
53 #include "bindings/v8/Dictionary.h"
54 #include "bindings/v8/ExceptionMessages.h"
55 #include "bindings/v8/ExceptionState.h"
56 #include "bindings/v8/ScriptController.h"
57 #include "bindings/v8/ScriptValue.h"
58 #include "bindings/v8/SerializedScriptValue.h"
59 #include "bindings/v8/V8AbstractEventListener.h"
60 #include "bindings/v8/V8Binding.h"
61 #include "bindings/v8/V8DOMActivityLogger.h"
62 #include "bindings/v8/V8DOMConfiguration.h"
63 #include "bindings/v8/V8DOMWrapper.h"
64 #include "bindings/v8/V8EventListenerList.h"
65 #include "bindings/v8/V8HiddenPropertyName.h"
66 #include "bindings/v8/V8ObjectConstructor.h"
67 #include "bindings/v8/custom/V8Float32ArrayCustom.h"
68 #include "core/dom/ContextFeatures.h"
69 #include "core/dom/Document.h"
70 #include "core/dom/ExceptionCode.h"
71 #include "core/dom/custom/CustomElementCallbackDispatcher.h"
72 #include "core/frame/DOMWindow.h"
73 #include "core/page/UseCounter.h"
74 #include "core/svg/properties/SVGPropertyTearOff.h"
75 #include "core/svg/properties/SVGStaticPropertyTearOff.h"
76 #include "platform/TraceEvent.h"
77 #include "wtf/GetPtr.h"
78 #include "wtf/RefPtr.h"
79 #include "wtf/UnusedParam.h"
83 static void initializeScriptWrappableForInterface(TestObj* object)
85 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
86 ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeInfo);
91 } // namespace WebCore
93 // In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
94 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
95 // in the global namespace.
96 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
97 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* object)
99 WebCore::initializeScriptWrappableForInterface(object);
103 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { V8TestObject::GetTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextEnabledPrototypeProperties, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype };
105 namespace TestObjV8Internal {
107 template <typename T> void V8_USE(T) { }
109 static void readOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
111 TestObj* imp = V8TestObject::toNative(info.Holder());
112 v8SetReturnValueInt(info, imp->readOnlyLongAttr());
115 static void readOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
118 TestObjV8Internal::readOnlyLongAttrAttributeGetter(info);
119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
122 static void readOnlyStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
124 TestObj* imp = V8TestObject::toNative(info.Holder());
125 v8SetReturnValueString(info, imp->readOnlyStringAttr(), info.GetIsolate());
128 static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
130 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
131 TestObjV8Internal::readOnlyStringAttrAttributeGetter(info);
132 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
135 static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
137 TestObj* imp = V8TestObject::toNative(info.Holder());
138 RefPtr<TestObj> result = imp->readOnlyTestObjectAttr();
139 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get()))
141 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
142 if (!wrapper.IsEmpty()) {
143 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOnlyTestObjectAttr", wrapper);
144 v8SetReturnValue(info, wrapper);
148 static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
151 TestObjV8Internal::readOnlyTestObjectAttrAttributeGetter(info);
152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
155 static void staticReadOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
157 v8SetReturnValueInt(info, TestObj::staticReadOnlyLongAttr());
160 static void staticReadOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
162 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
163 TestObjV8Internal::staticReadOnlyLongAttrAttributeGetter(info);
164 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
167 static void staticStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
169 v8SetReturnValueString(info, TestObj::staticStringAttr(), info.GetIsolate());
172 static void staticStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
175 TestObjV8Internal::staticStringAttrAttributeGetter(info);
176 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
179 static void staticStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
181 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
182 TestObj::setStaticStringAttr(cppValue);
185 static void staticStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
187 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
188 TestObjV8Internal::staticStringAttrAttributeSetter(jsValue, info);
189 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
192 static void enumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
194 TestObj* imp = V8TestObject::toNative(info.Holder());
195 v8SetReturnValueString(info, imp->enumAttr(), info.GetIsolate());
198 static void enumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
200 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
201 TestObjV8Internal::enumAttrAttributeGetter(info);
202 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
205 static void enumAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
207 TestObj* imp = V8TestObject::toNative(info.Holder());
208 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
209 String string = cppValue;
210 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3"))
212 imp->setEnumAttr(cppValue);
215 static void enumAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
217 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
218 TestObjV8Internal::enumAttrAttributeSetter(jsValue, info);
219 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
222 static void readOnlyEnumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
224 TestObj* imp = V8TestObject::toNative(info.Holder());
225 v8SetReturnValueString(info, imp->readOnlyEnumAttr(), info.GetIsolate());
228 static void readOnlyEnumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
230 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
231 TestObjV8Internal::readOnlyEnumAttrAttributeGetter(info);
232 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
235 static void byteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
237 TestObj* imp = V8TestObject::toNative(info.Holder());
238 v8SetReturnValueInt(info, imp->byteAttr());
241 static void byteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
243 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
244 TestObjV8Internal::byteAttrAttributeGetter(info);
245 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
248 static void byteAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
250 TestObj* imp = V8TestObject::toNative(info.Holder());
251 V8TRYCATCH_VOID(int, cppValue, toInt8(jsValue));
252 imp->setByteAttr(cppValue);
255 static void byteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
257 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
258 TestObjV8Internal::byteAttrAttributeSetter(jsValue, info);
259 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
262 static void octetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
264 TestObj* imp = V8TestObject::toNative(info.Holder());
265 v8SetReturnValueUnsigned(info, imp->octetAttr());
268 static void octetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
270 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
271 TestObjV8Internal::octetAttrAttributeGetter(info);
272 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
275 static void octetAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
277 TestObj* imp = V8TestObject::toNative(info.Holder());
278 V8TRYCATCH_VOID(unsigned, cppValue, toUInt8(jsValue));
279 imp->setOctetAttr(cppValue);
282 static void octetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
284 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
285 TestObjV8Internal::octetAttrAttributeSetter(jsValue, info);
286 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
289 static void shortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
291 TestObj* imp = V8TestObject::toNative(info.Holder());
292 v8SetReturnValueInt(info, imp->shortAttr());
295 static void shortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
297 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
298 TestObjV8Internal::shortAttrAttributeGetter(info);
299 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
302 static void shortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
304 TestObj* imp = V8TestObject::toNative(info.Holder());
305 V8TRYCATCH_VOID(int, cppValue, toInt16(jsValue));
306 imp->setShortAttr(cppValue);
309 static void shortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
311 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
312 TestObjV8Internal::shortAttrAttributeSetter(jsValue, info);
313 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
316 static void unsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
318 TestObj* imp = V8TestObject::toNative(info.Holder());
319 v8SetReturnValueUnsigned(info, imp->unsignedShortAttr());
322 static void unsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
324 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
325 TestObjV8Internal::unsignedShortAttrAttributeGetter(info);
326 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
329 static void unsignedShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
331 TestObj* imp = V8TestObject::toNative(info.Holder());
332 V8TRYCATCH_VOID(unsigned, cppValue, toUInt16(jsValue));
333 imp->setUnsignedShortAttr(cppValue);
336 static void unsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
338 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
339 TestObjV8Internal::unsignedShortAttrAttributeSetter(jsValue, info);
340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
343 static void longAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
345 TestObj* imp = V8TestObject::toNative(info.Holder());
346 v8SetReturnValueInt(info, imp->longAttr());
349 static void longAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
351 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
352 TestObjV8Internal::longAttrAttributeGetter(info);
353 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
356 static void longAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
358 TestObj* imp = V8TestObject::toNative(info.Holder());
359 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
360 imp->setLongAttr(cppValue);
363 static void longAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
365 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
366 TestObjV8Internal::longAttrAttributeSetter(jsValue, info);
367 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
370 static void longLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
372 TestObj* imp = V8TestObject::toNative(info.Holder());
373 v8SetReturnValue(info, static_cast<double>(imp->longLongAttr()));
376 static void longLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
378 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
379 TestObjV8Internal::longLongAttrAttributeGetter(info);
380 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
383 static void longLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
385 TestObj* imp = V8TestObject::toNative(info.Holder());
386 V8TRYCATCH_VOID(long long, cppValue, toInt64(jsValue));
387 imp->setLongLongAttr(cppValue);
390 static void longLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
392 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
393 TestObjV8Internal::longLongAttrAttributeSetter(jsValue, info);
394 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
397 static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
399 TestObj* imp = V8TestObject::toNative(info.Holder());
400 v8SetReturnValue(info, static_cast<double>(imp->unsignedLongLongAttr()));
403 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
405 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
406 TestObjV8Internal::unsignedLongLongAttrAttributeGetter(info);
407 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
410 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
412 TestObj* imp = V8TestObject::toNative(info.Holder());
413 V8TRYCATCH_VOID(unsigned long long, cppValue, toUInt64(jsValue));
414 imp->setUnsignedLongLongAttr(cppValue);
417 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
419 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
420 TestObjV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info);
421 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
424 static void stringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
426 TestObj* imp = V8TestObject::toNative(info.Holder());
427 v8SetReturnValueString(info, imp->stringAttr(), info.GetIsolate());
430 static void stringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
432 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
433 TestObjV8Internal::stringAttrAttributeGetter(info);
434 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
437 static void stringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
439 TestObj* imp = V8TestObject::toNative(info.Holder());
440 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
441 imp->setStringAttr(cppValue);
444 static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
446 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
447 TestObjV8Internal::stringAttrAttributeSetter(jsValue, info);
448 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
451 static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
453 TestObj* imp = V8TestObject::toNative(info.Holder());
454 EventListener* jsValue = imp->eventHandlerAttr(isolatedWorldForIsolate(info.GetIsolate()));
455 v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
458 static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
460 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
461 TestObjV8Internal::eventHandlerAttrAttributeGetter(info);
462 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
465 static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
467 TestObj* imp = V8TestObject::toNative(info.Holder());
468 transferHiddenDependency(info.Holder(), imp->eventHandlerAttr(isolatedWorldForIsolate(info.GetIsolate())), jsValue, V8TestObject::eventListenerCacheIndex, info.GetIsolate());
469 imp->setEventHandlerAttr(V8EventListenerList::getEventListener(jsValue, true, ListenerFindOrCreate), isolatedWorldForIsolate(info.GetIsolate()));
472 static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
474 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
475 TestObjV8Internal::eventHandlerAttrAttributeSetter(jsValue, info);
476 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
479 static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
481 TestObj* imp = V8TestObject::toNative(info.Holder());
482 v8SetReturnValueFast(info, imp->testObjAttr(), imp);
485 static void testObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
487 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
488 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature);
489 TestObjV8Internal::testObjAttrAttributeGetter(info);
490 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
493 static void testObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
495 TestObj* imp = V8TestObject::toNative(info.Holder());
496 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
497 imp->setTestObjAttr(WTF::getPtr(cppValue));
500 static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
502 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
503 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature);
504 TestObjV8Internal::testObjAttrAttributeSetter(jsValue, info);
505 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
508 static void XMLObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
510 TestObj* imp = V8TestObject::toNative(info.Holder());
511 v8SetReturnValueFast(info, imp->xmlObjAttr(), imp);
514 static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
516 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
517 TestObjV8Internal::XMLObjAttrAttributeGetter(info);
518 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
521 static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
523 TestObj* imp = V8TestObject::toNative(info.Holder());
524 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
525 imp->setXMLObjAttr(WTF::getPtr(cppValue));
528 static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
530 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
531 TestObjV8Internal::XMLObjAttrAttributeSetter(jsValue, info);
532 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
535 static void createAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
537 TestObj* imp = V8TestObject::toNative(info.Holder());
538 v8SetReturnValueBool(info, imp->isCreate());
541 static void createAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
543 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
544 TestObjV8Internal::createAttributeGetter(info);
545 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
548 static void createAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
550 TestObj* imp = V8TestObject::toNative(info.Holder());
551 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue());
552 imp->setCreate(cppValue);
555 static void createAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
557 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
558 TestObjV8Internal::createAttributeSetter(jsValue, info);
559 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
562 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
564 TestObj* imp = V8TestObject::toNative(info.Holder());
565 v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::reflectedstringattrAttr), info.GetIsolate());
568 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
570 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
571 TestObjV8Internal::reflectedStringAttrAttributeGetter(info);
572 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
575 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
577 TestObj* imp = V8TestObject::toNative(info.Holder());
578 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue);
579 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
580 imp->setAttribute(HTMLNames::reflectedstringattrAttr, cppValue);
583 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
585 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
586 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
587 TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info);
588 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
591 static void reflectedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
593 TestObj* imp = V8TestObject::toNative(info.Holder());
594 v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::reflectedintegralattrAttr));
597 static void reflectedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
599 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
600 TestObjV8Internal::reflectedIntegralAttrAttributeGetter(info);
601 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
604 static void reflectedIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
606 TestObj* imp = V8TestObject::toNative(info.Holder());
607 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
608 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
609 imp->setIntegralAttribute(HTMLNames::reflectedintegralattrAttr, cppValue);
612 static void reflectedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
614 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
615 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
616 TestObjV8Internal::reflectedIntegralAttrAttributeSetter(jsValue, info);
617 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
620 static void reflectedUnsignedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
622 TestObj* imp = V8TestObject::toNative(info.Holder());
623 v8SetReturnValueUnsigned(info, std::max(0, imp->getIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr)));
626 static void reflectedUnsignedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
628 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
629 TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeGetter(info);
630 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
633 static void reflectedUnsignedIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
635 TestObj* imp = V8TestObject::toNative(info.Holder());
636 V8TRYCATCH_VOID(unsigned, cppValue, toUInt32(jsValue));
637 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
638 imp->setUnsignedIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr, cppValue);
641 static void reflectedUnsignedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
643 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
644 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
645 TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeSetter(jsValue, info);
646 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
649 static void reflectedBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
651 TestObj* imp = V8TestObject::toNative(info.Holder());
652 v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::reflectedbooleanattrAttr));
655 static void reflectedBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
657 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
658 TestObjV8Internal::reflectedBooleanAttrAttributeGetter(info);
659 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
662 static void reflectedBooleanAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
664 TestObj* imp = V8TestObject::toNative(info.Holder());
665 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue());
666 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
667 imp->setBooleanAttribute(HTMLNames::reflectedbooleanattrAttr, cppValue);
670 static void reflectedBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
672 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
673 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
674 TestObjV8Internal::reflectedBooleanAttrAttributeSetter(jsValue, info);
675 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
678 static void reflectedURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
680 TestObj* imp = V8TestObject::toNative(info.Holder());
681 v8SetReturnValueString(info, imp->getURLAttribute(HTMLNames::reflectedurlattrAttr), info.GetIsolate());
684 static void reflectedURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
686 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
687 TestObjV8Internal::reflectedURLAttrAttributeGetter(info);
688 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
691 static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
693 TestObj* imp = V8TestObject::toNative(info.Holder());
694 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue);
695 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
696 imp->setAttribute(HTMLNames::reflectedurlattrAttr, cppValue);
699 static void reflectedURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
701 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
702 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
703 TestObjV8Internal::reflectedURLAttrAttributeSetter(jsValue, info);
704 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
707 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
709 TestObj* imp = V8TestObject::toNative(info.Holder());
710 v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate());
713 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
715 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
716 TestObjV8Internal::reflectedStringAttrAttributeGetter(info);
717 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
720 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
722 TestObj* imp = V8TestObject::toNative(info.Holder());
723 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue);
724 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
725 imp->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue);
728 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
730 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
731 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
732 TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info);
733 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
736 static void reflectedCustomIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
738 TestObj* imp = V8TestObject::toNative(info.Holder());
739 v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::customContentIntegralAttrAttr));
742 static void reflectedCustomIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
744 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
745 TestObjV8Internal::reflectedCustomIntegralAttrAttributeGetter(info);
746 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
749 static void reflectedCustomIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
751 TestObj* imp = V8TestObject::toNative(info.Holder());
752 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
753 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
754 imp->setIntegralAttribute(HTMLNames::customContentIntegralAttrAttr, cppValue);
757 static void reflectedCustomIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
759 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
760 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
761 TestObjV8Internal::reflectedCustomIntegralAttrAttributeSetter(jsValue, info);
762 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
765 static void reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
767 TestObj* imp = V8TestObject::toNative(info.Holder());
768 v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::customContentBooleanAttrAttr));
771 static void reflectedCustomBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
773 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
774 TestObjV8Internal::reflectedCustomBooleanAttrAttributeGetter(info);
775 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
778 static void reflectedCustomBooleanAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
780 TestObj* imp = V8TestObject::toNative(info.Holder());
781 V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue());
782 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
783 imp->setBooleanAttribute(HTMLNames::customContentBooleanAttrAttr, cppValue);
786 static void reflectedCustomBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
788 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
789 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
790 TestObjV8Internal::reflectedCustomBooleanAttrAttributeSetter(jsValue, info);
791 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
794 static void reflectedCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
796 TestObj* imp = V8TestObject::toNative(info.Holder());
797 v8SetReturnValueString(info, imp->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate());
800 static void reflectedCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
802 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
803 TestObjV8Internal::reflectedCustomURLAttrAttributeGetter(info);
804 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
807 static void reflectedCustomURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
809 TestObj* imp = V8TestObject::toNative(info.Holder());
810 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue);
811 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
812 imp->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue);
815 static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
817 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
818 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
819 TestObjV8Internal::reflectedCustomURLAttrAttributeSetter(jsValue, info);
820 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
823 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
825 TestObj* imp = V8TestObject::toNative(info.Holder());
826 v8SetReturnValueFast(info, imp->typedArrayAttr(), imp);
829 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
831 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
832 TestObjV8Internal::typedArrayAttrAttributeGetter(info);
833 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
836 static void typedArrayAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
838 TestObj* imp = V8TestObject::toNative(info.Holder());
839 V8TRYCATCH_VOID(Float32Array*, cppValue, jsValue->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(jsValue)) : 0);
840 imp->setTypedArrayAttr(WTF::getPtr(cppValue));
843 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
845 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
846 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info);
847 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
850 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
852 TestObj* imp = V8TestObject::toNative(info.Holder());
853 ExceptionState es(info.GetIsolate());
854 int jsValue = imp->attrWithGetterException(es);
855 if (UNLIKELY(es.throwIfNeeded()))
857 v8SetReturnValueInt(info, jsValue);
860 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
862 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
863 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info);
864 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
867 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
869 TestObj* imp = V8TestObject::toNative(info.Holder());
870 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
871 imp->setAttrWithGetterException(cppValue);
874 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
876 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
877 TestObjV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info);
878 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
881 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
883 TestObj* imp = V8TestObject::toNative(info.Holder());
884 v8SetReturnValueInt(info, imp->attrWithSetterException());
887 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
889 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
890 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info);
891 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
894 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
896 TestObj* imp = V8TestObject::toNative(info.Holder());
897 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
898 ExceptionState es(info.GetIsolate());
899 imp->setAttrWithSetterException(cppValue, es);
903 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
905 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
906 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info);
907 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
910 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
912 TestObj* imp = V8TestObject::toNative(info.Holder());
913 ExceptionState es(info.GetIsolate());
914 String jsValue = imp->stringAttrWithGetterException(es);
915 if (UNLIKELY(es.throwIfNeeded()))
917 v8SetReturnValueString(info, jsValue, info.GetIsolate());
920 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
922 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
923 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info);
924 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
927 static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
929 TestObj* imp = V8TestObject::toNative(info.Holder());
930 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
931 imp->setStringAttrWithGetterException(cppValue);
934 static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
936 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
937 TestObjV8Internal::stringAttrWithGetterExceptionAttributeSetter(jsValue, info);
938 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
941 static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
943 TestObj* imp = V8TestObject::toNative(info.Holder());
944 v8SetReturnValueString(info, imp->stringAttrWithSetterException(), info.GetIsolate());
947 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
949 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
950 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info);
951 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
954 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
956 TestObj* imp = V8TestObject::toNative(info.Holder());
957 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
958 ExceptionState es(info.GetIsolate());
959 imp->setStringAttrWithSetterException(cppValue, es);
963 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
965 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
966 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, info);
967 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
970 static void customAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
972 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
973 V8TestObject::customAttrAttributeGetterCustom(info);
974 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
977 static void customAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
979 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
980 V8TestObject::customAttrAttributeSetterCustom(jsValue, info);
981 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
984 static void withScriptStateAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
986 TestObj* imp = V8TestObject::toNative(info.Holder());
987 ScriptState* currentState = ScriptState::current();
989 return v8Undefined();
990 ScriptState& state = *currentState;
991 v8SetReturnValueInt(info, imp->withScriptStateAttribute(&state));
994 static void withScriptStateAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
996 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
997 TestObjV8Internal::withScriptStateAttributeAttributeGetter(info);
998 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1001 static void withScriptStateAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1003 TestObj* imp = V8TestObject::toNative(info.Holder());
1004 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1005 ScriptState* currentState = ScriptState::current();
1008 ScriptState& state = *currentState;
1009 imp->setWithScriptStateAttribute(&state, cppValue);
1010 if (state.hadException())
1011 throwError(state.exception(), info.GetIsolate());
1014 static void withScriptStateAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1016 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1017 TestObjV8Internal::withScriptStateAttributeAttributeSetter(jsValue, info);
1018 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1021 static void withExecutionContextAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1023 TestObj* imp = V8TestObject::toNative(info.Holder());
1024 ExecutionContext* scriptContext = getExecutionContext();
1025 v8SetReturnValueFast(info, imp->withExecutionContextAttribute(scriptContext), imp);
1028 static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1030 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1031 TestObjV8Internal::withExecutionContextAttributeAttributeGetter(info);
1032 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1035 static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1037 TestObj* imp = V8TestObject::toNative(info.Holder());
1038 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1039 ExecutionContext* scriptContext = getExecutionContext();
1040 imp->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue));
1043 static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1045 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1046 TestObjV8Internal::withExecutionContextAttributeAttributeSetter(jsValue, info);
1047 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1050 static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1052 TestObj* imp = V8TestObject::toNative(info.Holder());
1053 v8SetReturnValueFast(info, imp->withActiveWindowAndFirstWindowAttribute(), imp);
1056 static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1058 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1059 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(info);
1060 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1063 static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1065 TestObj* imp = V8TestObject::toNative(info.Holder());
1066 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1067 imp->setWithActiveWindowAndFirstWindowAttribute(activeDOMWindow(), firstDOMWindow(), WTF::getPtr(cppValue));
1070 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1072 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1073 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(jsValue, info);
1074 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1077 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1079 TestObj* imp = V8TestObject::toNative(info.Holder());
1080 ExceptionState es(info.GetIsolate());
1081 ScriptState* currentState = ScriptState::current();
1083 return v8Undefined();
1084 ScriptState& state = *currentState;
1085 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, es);
1086 if (UNLIKELY(es.throwIfNeeded()))
1088 if (state.hadException()) {
1089 throwError(state.exception(), info.GetIsolate());
1092 v8SetReturnValueFast(info, jsValue.release(), imp);
1095 static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1097 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1098 TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetter(info);
1099 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1102 static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1104 TestObj* imp = V8TestObject::toNative(info.Holder());
1105 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1106 ScriptState* currentState = ScriptState::current();
1109 ScriptState& state = *currentState;
1110 imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(cppValue));
1111 if (state.hadException())
1112 throwError(state.exception(), info.GetIsolate());
1115 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1118 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, info);
1119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1122 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1124 TestObj* imp = V8TestObject::toNative(info.Holder());
1125 ExceptionState es(info.GetIsolate());
1126 ExecutionContext* scriptContext = getExecutionContext();
1127 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptContext, es);
1128 if (UNLIKELY(es.throwIfNeeded()))
1130 v8SetReturnValueFast(info, jsValue.release(), imp);
1133 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1136 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetter(info);
1137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1140 static void withExecutionContextAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1142 TestObj* imp = V8TestObject::toNative(info.Holder());
1143 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1144 ExecutionContext* scriptContext = getExecutionContext();
1145 imp->setWithExecutionContextAttributeRaises(scriptContext, WTF::getPtr(cppValue));
1148 static void withExecutionContextAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1151 TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetter(jsValue, info);
1152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1155 static void withExecutionContextAndScriptStateAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1157 TestObj* imp = V8TestObject::toNative(info.Holder());
1158 ScriptState* currentState = ScriptState::current();
1160 return v8Undefined();
1161 ScriptState& state = *currentState;
1162 ExecutionContext* scriptContext = getExecutionContext();
1163 v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateAttribute(&state, scriptContext), imp);
1166 static void withExecutionContextAndScriptStateAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1168 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1169 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGetter(info);
1170 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1173 static void withExecutionContextAndScriptStateAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1175 TestObj* imp = V8TestObject::toNative(info.Holder());
1176 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1177 ScriptState* currentState = ScriptState::current();
1180 ScriptState& state = *currentState;
1181 ExecutionContext* scriptContext = getExecutionContext();
1182 imp->setWithExecutionContextAndScriptStateAttribute(&state, scriptContext, WTF::getPtr(cppValue));
1183 if (state.hadException())
1184 throwError(state.exception(), info.GetIsolate());
1187 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1189 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1190 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSetter(jsValue, info);
1191 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1194 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1196 TestObj* imp = V8TestObject::toNative(info.Holder());
1197 ExceptionState es(info.GetIsolate());
1198 ScriptState* currentState = ScriptState::current();
1200 return v8Undefined();
1201 ScriptState& state = *currentState;
1202 ExecutionContext* scriptContext = getExecutionContext();
1203 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRaises(&state, scriptContext, es);
1204 if (UNLIKELY(es.throwIfNeeded()))
1206 if (state.hadException()) {
1207 throwError(state.exception(), info.GetIsolate());
1210 v8SetReturnValueFast(info, jsValue.release(), imp);
1213 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1215 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1216 TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(info);
1217 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1220 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1222 TestObj* imp = V8TestObject::toNative(info.Holder());
1223 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1224 ScriptState* currentState = ScriptState::current();
1227 ScriptState& state = *currentState;
1228 ExecutionContext* scriptContext = getExecutionContext();
1229 imp->setWithExecutionContextAndScriptStateAttributeRaises(&state, scriptContext, WTF::getPtr(cppValue));
1230 if (state.hadException())
1231 throwError(state.exception(), info.GetIsolate());
1234 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1236 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1237 TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(jsValue, info);
1238 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1241 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1243 TestObj* imp = V8TestObject::toNative(info.Holder());
1244 ScriptState* currentState = ScriptState::current();
1246 return v8Undefined();
1247 ScriptState& state = *currentState;
1248 ExecutionContext* scriptContext = getExecutionContext();
1249 v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateWithSpacesAttribute(&state, scriptContext), imp);
1252 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1254 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1255 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter(info);
1256 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1259 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1261 TestObj* imp = V8TestObject::toNative(info.Holder());
1262 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1263 ScriptState* currentState = ScriptState::current();
1266 ScriptState& state = *currentState;
1267 ExecutionContext* scriptContext = getExecutionContext();
1268 imp->setWithExecutionContextAndScriptStateWithSpacesAttribute(&state, scriptContext, WTF::getPtr(cppValue));
1269 if (state.hadException())
1270 throwError(state.exception(), info.GetIsolate());
1273 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1275 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1276 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter(jsValue, info);
1277 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1280 static void enforcedRangeByteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1282 TestObj* imp = V8TestObject::toNative(info.Holder());
1283 v8SetReturnValueInt(info, imp->enforcedRangeByteAttr());
1286 static void enforcedRangeByteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1288 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1289 TestObjV8Internal::enforcedRangeByteAttrAttributeGetter(info);
1290 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1293 static void enforcedRangeByteAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1295 TestObj* imp = V8TestObject::toNative(info.Holder());
1296 V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt8(jsValue, EnforceRange, ok), info.GetIsolate());
1297 imp->setEnforcedRangeByteAttr(cppValue);
1300 static void enforcedRangeByteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1302 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1303 TestObjV8Internal::enforcedRangeByteAttrAttributeSetter(jsValue, info);
1304 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1307 static void enforcedRangeOctetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1309 TestObj* imp = V8TestObject::toNative(info.Holder());
1310 v8SetReturnValueUnsigned(info, imp->enforcedRangeOctetAttr());
1313 static void enforcedRangeOctetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1315 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1316 TestObjV8Internal::enforcedRangeOctetAttrAttributeGetter(info);
1317 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1320 static void enforcedRangeOctetAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1322 TestObj* imp = V8TestObject::toNative(info.Holder());
1323 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt8(jsValue, EnforceRange, ok), info.GetIsolate());
1324 imp->setEnforcedRangeOctetAttr(cppValue);
1327 static void enforcedRangeOctetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1329 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1330 TestObjV8Internal::enforcedRangeOctetAttrAttributeSetter(jsValue, info);
1331 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1334 static void enforcedRangeShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1336 TestObj* imp = V8TestObject::toNative(info.Holder());
1337 v8SetReturnValueInt(info, imp->enforcedRangeShortAttr());
1340 static void enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1342 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1343 TestObjV8Internal::enforcedRangeShortAttrAttributeGetter(info);
1344 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1347 static void enforcedRangeShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1349 TestObj* imp = V8TestObject::toNative(info.Holder());
1350 V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt16(jsValue, EnforceRange, ok), info.GetIsolate());
1351 imp->setEnforcedRangeShortAttr(cppValue);
1354 static void enforcedRangeShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1356 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1357 TestObjV8Internal::enforcedRangeShortAttrAttributeSetter(jsValue, info);
1358 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1361 static void enforcedRangeUnsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1363 TestObj* imp = V8TestObject::toNative(info.Holder());
1364 v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedShortAttr());
1367 static void enforcedRangeUnsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1369 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1370 TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeGetter(info);
1371 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1374 static void enforcedRangeUnsignedShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1376 TestObj* imp = V8TestObject::toNative(info.Holder());
1377 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt16(jsValue, EnforceRange, ok), info.GetIsolate());
1378 imp->setEnforcedRangeUnsignedShortAttr(cppValue);
1381 static void enforcedRangeUnsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1383 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1384 TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeSetter(jsValue, info);
1385 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1388 static void enforcedRangeLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1390 TestObj* imp = V8TestObject::toNative(info.Holder());
1391 v8SetReturnValueInt(info, imp->enforcedRangeLongAttr());
1394 static void enforcedRangeLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1397 TestObjV8Internal::enforcedRangeLongAttrAttributeGetter(info);
1398 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1401 static void enforcedRangeLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1403 TestObj* imp = V8TestObject::toNative(info.Holder());
1404 V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt32(jsValue, EnforceRange, ok), info.GetIsolate());
1405 imp->setEnforcedRangeLongAttr(cppValue);
1408 static void enforcedRangeLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1410 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1411 TestObjV8Internal::enforcedRangeLongAttrAttributeSetter(jsValue, info);
1412 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1415 static void enforcedRangeUnsignedLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1417 TestObj* imp = V8TestObject::toNative(info.Holder());
1418 v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedLongAttr());
1421 static void enforcedRangeUnsignedLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1423 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1424 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeGetter(info);
1425 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1428 static void enforcedRangeUnsignedLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1430 TestObj* imp = V8TestObject::toNative(info.Holder());
1431 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt32(jsValue, EnforceRange, ok), info.GetIsolate());
1432 imp->setEnforcedRangeUnsignedLongAttr(cppValue);
1435 static void enforcedRangeUnsignedLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1437 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1438 TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeSetter(jsValue, info);
1439 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1442 static void enforcedRangeLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1444 TestObj* imp = V8TestObject::toNative(info.Holder());
1445 v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeLongLongAttr()));
1448 static void enforcedRangeLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1450 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1451 TestObjV8Internal::enforcedRangeLongLongAttrAttributeGetter(info);
1452 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1455 static void enforcedRangeLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1457 TestObj* imp = V8TestObject::toNative(info.Holder());
1458 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, cppValue, toInt64(jsValue, EnforceRange, ok), info.GetIsolate());
1459 imp->setEnforcedRangeLongLongAttr(cppValue);
1462 static void enforcedRangeLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1464 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1465 TestObjV8Internal::enforcedRangeLongLongAttrAttributeSetter(jsValue, info);
1466 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1469 static void enforcedRangeUnsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1471 TestObj* imp = V8TestObject::toNative(info.Holder());
1472 v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeUnsignedLongLongAttr()));
1475 static void enforcedRangeUnsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1477 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1478 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetter(info);
1479 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1482 static void enforcedRangeUnsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1484 TestObj* imp = V8TestObject::toNative(info.Holder());
1485 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, cppValue, toUInt64(jsValue, EnforceRange, ok), info.GetIsolate());
1486 imp->setEnforcedRangeUnsignedLongLongAttr(cppValue);
1489 static void enforcedRangeUnsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1491 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1492 TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetter(jsValue, info);
1493 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1496 #if ENABLE(Condition1)
1497 static void conditionalAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1499 TestObj* imp = V8TestObject::toNative(info.Holder());
1500 v8SetReturnValueInt(info, imp->conditionalAttr1());
1502 #endif // ENABLE(Condition1)
1504 #if ENABLE(Condition1)
1505 static void conditionalAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1507 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1508 TestObjV8Internal::conditionalAttr1AttributeGetter(info);
1509 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1511 #endif // ENABLE(Condition1)
1513 #if ENABLE(Condition1)
1514 static void conditionalAttr1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1516 TestObj* imp = V8TestObject::toNative(info.Holder());
1517 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1518 imp->setConditionalAttr1(cppValue);
1520 #endif // ENABLE(Condition1)
1522 #if ENABLE(Condition1)
1523 static void conditionalAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1525 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1526 TestObjV8Internal::conditionalAttr1AttributeSetter(jsValue, info);
1527 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1529 #endif // ENABLE(Condition1)
1531 #if ENABLE(Condition1) && ENABLE(Condition2)
1532 static void conditionalAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1534 TestObj* imp = V8TestObject::toNative(info.Holder());
1535 v8SetReturnValueInt(info, imp->conditionalAttr2());
1537 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1539 #if ENABLE(Condition1) && ENABLE(Condition2)
1540 static void conditionalAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1542 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1543 TestObjV8Internal::conditionalAttr2AttributeGetter(info);
1544 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1546 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1548 #if ENABLE(Condition1) && ENABLE(Condition2)
1549 static void conditionalAttr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1551 TestObj* imp = V8TestObject::toNative(info.Holder());
1552 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1553 imp->setConditionalAttr2(cppValue);
1555 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1557 #if ENABLE(Condition1) && ENABLE(Condition2)
1558 static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1560 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1561 TestObjV8Internal::conditionalAttr2AttributeSetter(jsValue, info);
1562 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1564 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1566 #if ENABLE(Condition1) || ENABLE(Condition2)
1567 static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1569 TestObj* imp = V8TestObject::toNative(info.Holder());
1570 v8SetReturnValueInt(info, imp->conditionalAttr3());
1572 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1574 #if ENABLE(Condition1) || ENABLE(Condition2)
1575 static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1577 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1578 TestObjV8Internal::conditionalAttr3AttributeGetter(info);
1579 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1581 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1583 #if ENABLE(Condition1) || ENABLE(Condition2)
1584 static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1586 TestObj* imp = V8TestObject::toNative(info.Holder());
1587 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1588 imp->setConditionalAttr3(cppValue);
1590 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1592 #if ENABLE(Condition1) || ENABLE(Condition2)
1593 static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1595 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1596 TestObjV8Internal::conditionalAttr3AttributeSetter(jsValue, info);
1597 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1599 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1601 static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1603 TestObj* imp = V8TestObject::toNative(info.Holder());
1604 v8SetReturnValue(info, imp->cachedAttribute1().v8Value());
1607 static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1609 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1610 TestObjV8Internal::cachedAttribute1AttributeGetter(info);
1611 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1614 static void cachedAttribute2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1616 TestObj* imp = V8TestObject::toNative(info.Holder());
1617 v8SetReturnValue(info, imp->cachedAttribute2().v8Value());
1620 static void cachedAttribute2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1622 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1623 TestObjV8Internal::cachedAttribute2AttributeGetter(info);
1624 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1627 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1629 TestObj* imp = V8TestObject::toNative(info.Holder());
1630 v8SetReturnValue(info, imp->anyAttribute().v8Value());
1633 static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1635 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1636 TestObjV8Internal::anyAttributeAttributeGetter(info);
1637 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1640 static void anyAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1642 TestObj* imp = V8TestObject::toNative(info.Holder());
1643 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate()));
1644 imp->setAnyAttribute(cppValue);
1647 static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1649 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1650 TestObjV8Internal::anyAttributeAttributeSetter(jsValue, info);
1651 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1654 static void callbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1656 TestObj* imp = V8TestObject::toNative(info.Holder());
1657 v8SetReturnValue(info, imp->callbackFunctionAttribute().v8Value());
1660 static void callbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1663 TestObjV8Internal::callbackFunctionAttributeAttributeGetter(info);
1664 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1667 static void callbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1669 TestObj* imp = V8TestObject::toNative(info.Holder());
1670 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate()));
1671 imp->setCallbackFunctionAttribute(cppValue);
1674 static void callbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1676 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1677 TestObjV8Internal::callbackFunctionAttributeAttributeSetter(jsValue, info);
1678 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1681 static void enabledAtRuntimeAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1683 TestObj* imp = V8TestObject::toNative(info.Holder());
1684 v8SetReturnValueInt(info, imp->enabledAtRuntimeAttr());
1687 static void enabledAtRuntimeAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1689 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1690 TestObjV8Internal::enabledAtRuntimeAttrAttributeGetter(info);
1691 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1694 static void enabledAtRuntimeAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1696 TestObj* imp = V8TestObject::toNative(info.Holder());
1697 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1698 imp->setEnabledAtRuntimeAttr(cppValue);
1701 static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1703 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1704 TestObjV8Internal::enabledAtRuntimeAttrAttributeSetter(jsValue, info);
1705 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1708 static void enabledPerContextAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1710 TestObj* imp = V8TestObject::toNative(info.Holder());
1711 v8SetReturnValueInt(info, imp->enabledPerContextAttr());
1714 static void enabledPerContextAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1716 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1717 TestObjV8Internal::enabledPerContextAttrAttributeGetter(info);
1718 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1721 static void enabledPerContextAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1723 TestObj* imp = V8TestObject::toNative(info.Holder());
1724 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1725 imp->setEnabledPerContextAttr(cppValue);
1728 static void enabledPerContextAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1730 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1731 TestObjV8Internal::enabledPerContextAttrAttributeSetter(jsValue, info);
1732 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1735 static void floatArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1737 TestObj* imp = V8TestObject::toNative(info.Holder());
1738 v8SetReturnValue(info, v8Array(imp->floatArray(), info.GetIsolate()));
1741 static void floatArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1743 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1744 TestObjV8Internal::floatArrayAttributeGetter(info);
1745 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1748 static void floatArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1750 TestObj* imp = V8TestObject::toNative(info.Holder());
1751 V8TRYCATCH_VOID(Vector<float>, cppValue, toNativeArray<float>(jsValue, 0, info.GetIsolate()));
1752 imp->setFloatArray(cppValue);
1755 static void floatArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1757 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1758 TestObjV8Internal::floatArrayAttributeSetter(jsValue, info);
1759 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1762 static void doubleArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1764 TestObj* imp = V8TestObject::toNative(info.Holder());
1765 v8SetReturnValue(info, v8Array(imp->doubleArray(), info.GetIsolate()));
1768 static void doubleArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1770 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1771 TestObjV8Internal::doubleArrayAttributeGetter(info);
1772 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1775 static void doubleArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1777 TestObj* imp = V8TestObject::toNative(info.Holder());
1778 V8TRYCATCH_VOID(Vector<double>, cppValue, toNativeArray<double>(jsValue, 0, info.GetIsolate()));
1779 imp->setDoubleArray(cppValue);
1782 static void doubleArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1784 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1785 TestObjV8Internal::doubleArrayAttributeSetter(jsValue, info);
1786 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1789 static void messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1791 TestObj* imp = V8TestObject::toNative(info.Holder());
1792 v8SetReturnValue(info, v8Array(imp->messagePortArray(), info.GetIsolate()));
1795 static void messagePortArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1797 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1798 TestObjV8Internal::messagePortArrayAttributeGetter(info);
1799 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1802 static void messagePortArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1804 TestObj* imp = V8TestObject::toNative(info.Holder());
1805 V8TRYCATCH_VOID(Vector<RefPtr<MessagePort> >, cppValue, (toRefPtrNativeArray<MessagePort, V8MessagePort>(jsValue, 0, info.GetIsolate())));
1806 imp->setMessagePortArray(cppValue);
1809 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1811 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1812 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info);
1813 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1816 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1818 TestObj* imp = V8TestObject::toNative(info.Holder());
1819 ExceptionState es(info.GetIsolate());
1820 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), es)) {
1821 v8SetReturnValueNull(info);
1825 v8SetReturnValueFast(info, imp->contentDocument(), imp);
1828 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1830 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1831 TestObjV8Internal::contentDocumentAttributeGetter(info);
1832 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1835 static void mutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1837 TestObj* imp = V8TestObject::toNative(info.Holder());
1838 v8SetReturnValueFast(info, WTF::getPtr(SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)), imp);
1841 static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1843 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1844 TestObjV8Internal::mutablePointAttributeGetter(info);
1845 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1848 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1850 TestObj* imp = V8TestObject::toNative(info.Holder());
1851 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1852 if (!WTF::getPtr(cppValue)) {
1853 throwUninformativeAndGenericTypeError(info.GetIsolate());
1856 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference());
1859 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1861 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1862 TestObjV8Internal::mutablePointAttributeSetter(jsValue, info);
1863 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1866 static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1868 TestObj* imp = V8TestObject::toNative(info.Holder());
1869 v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->immutablePoint())), imp);
1872 static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1874 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1875 TestObjV8Internal::immutablePointAttributeGetter(info);
1876 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1879 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1881 TestObj* imp = V8TestObject::toNative(info.Holder());
1882 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1883 if (!WTF::getPtr(cppValue)) {
1884 throwUninformativeAndGenericTypeError(info.GetIsolate());
1887 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference());
1890 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1892 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1893 TestObjV8Internal::immutablePointAttributeSetter(jsValue, info);
1894 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1897 static void strawberryAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1899 TestObj* imp = V8TestObject::toNative(info.Holder());
1900 v8SetReturnValueInt(info, imp->blueberry());
1903 static void strawberryAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1905 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1906 TestObjV8Internal::strawberryAttributeGetter(info);
1907 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1910 static void strawberryAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1912 TestObj* imp = V8TestObject::toNative(info.Holder());
1913 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1914 imp->setBlueberry(cppValue);
1917 static void strawberryAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1919 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1920 TestObjV8Internal::strawberryAttributeSetter(jsValue, info);
1921 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1924 static void strictFloatAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1926 TestObj* imp = V8TestObject::toNative(info.Holder());
1927 v8SetReturnValue(info, imp->strictFloat());
1930 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1932 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1933 TestObjV8Internal::strictFloatAttributeGetter(info);
1934 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1937 static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1939 TestObj* imp = V8TestObject::toNative(info.Holder());
1940 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue()));
1941 imp->setStrictFloat(cppValue);
1944 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1946 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1947 TestObjV8Internal::strictFloatAttributeSetter(jsValue, info);
1948 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1951 static void replaceableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1953 TestObj* imp = V8TestObject::toNative(info.Holder());
1954 v8SetReturnValueInt(info, imp->replaceableAttribute());
1957 static void replaceableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1959 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1960 TestObjV8Internal::replaceableAttributeAttributeGetter(info);
1961 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1964 static void nullableDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1966 TestObj* imp = V8TestObject::toNative(info.Holder());
1967 bool isNull = false;
1968 double jsValue = imp->nullableDoubleAttribute(isNull);
1970 v8SetReturnValueNull(info);
1973 v8SetReturnValue(info, jsValue);
1976 static void nullableDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1978 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1979 TestObjV8Internal::nullableDoubleAttributeAttributeGetter(info);
1980 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1983 static void nullableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1985 TestObj* imp = V8TestObject::toNative(info.Holder());
1986 bool isNull = false;
1987 int jsValue = imp->nullableLongAttribute(isNull);
1989 v8SetReturnValueNull(info);
1992 v8SetReturnValueInt(info, jsValue);
1995 static void nullableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1997 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1998 TestObjV8Internal::nullableLongAttributeAttributeGetter(info);
1999 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2002 static void nullableBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2004 TestObj* imp = V8TestObject::toNative(info.Holder());
2005 bool isNull = false;
2006 bool jsValue = imp->nullableBooleanAttribute(isNull);
2008 v8SetReturnValueNull(info);
2011 v8SetReturnValueBool(info, jsValue);
2014 static void nullableBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2016 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2017 TestObjV8Internal::nullableBooleanAttributeAttributeGetter(info);
2018 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2021 static void nullableStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2023 TestObj* imp = V8TestObject::toNative(info.Holder());
2024 bool isNull = false;
2025 String jsValue = imp->nullableStringAttribute(isNull);
2027 v8SetReturnValueNull(info);
2030 v8SetReturnValueString(info, jsValue, info.GetIsolate());
2033 static void nullableStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2035 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2036 TestObjV8Internal::nullableStringAttributeAttributeGetter(info);
2037 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2040 static void nullableLongSettableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2042 TestObj* imp = V8TestObject::toNative(info.Holder());
2043 bool isNull = false;
2044 int jsValue = imp->nullableLongSettableAttribute(isNull);
2046 v8SetReturnValueNull(info);
2049 v8SetReturnValueInt(info, jsValue);
2052 static void nullableLongSettableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2054 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2055 TestObjV8Internal::nullableLongSettableAttributeAttributeGetter(info);
2056 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2059 static void nullableLongSettableAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2061 TestObj* imp = V8TestObject::toNative(info.Holder());
2062 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2063 imp->setNullableLongSettableAttribute(cppValue);
2066 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2068 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2069 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, info);
2070 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2073 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2075 TestObj* imp = V8TestObject::toNative(info.Holder());
2076 ExceptionState es(info.GetIsolate());
2077 bool isNull = false;
2078 int jsValue = imp->nullableStringValue(isNull, es);
2080 v8SetReturnValueNull(info);
2083 if (UNLIKELY(es.throwIfNeeded()))
2085 v8SetReturnValueInt(info, jsValue);
2088 static void nullableStringValueAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2090 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2091 TestObjV8Internal::nullableStringValueAttributeGetter(info);
2092 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2095 static void nullableStringValueAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2097 TestObj* imp = V8TestObject::toNative(info.Holder());
2098 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2099 imp->setNullableStringValue(cppValue);
2102 static void nullableStringValueAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2104 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2105 TestObjV8Internal::nullableStringValueAttributeSetter(jsValue, info);
2106 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2109 static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2111 TestObj* imp = V8TestObject::toNative(info.Holder());
2112 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute();
2113 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get()))
2115 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
2116 if (!wrapper.IsEmpty()) {
2117 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWorldReadOnlyAttribute", wrapper);
2118 v8SetReturnValue(info, wrapper);
2122 static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2125 TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetter(info);
2126 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2129 static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2131 TestObj* imp = V8TestObject::toNative(info.Holder());
2132 RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute();
2133 if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObject>(info.GetReturnValue(), result.get()))
2135 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
2136 if (!wrapper.IsEmpty()) {
2137 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWorldReadOnlyAttribute", wrapper);
2138 v8SetReturnValue(info, wrapper);
2142 static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2145 TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterForMainWorld(info);
2146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2149 static void perWorldAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2151 TestObj* imp = V8TestObject::toNative(info.Holder());
2152 v8SetReturnValueFast(info, imp->perWorldAttribute(), imp);
2155 static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2157 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2158 TestObjV8Internal::perWorldAttributeAttributeGetter(info);
2159 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2162 static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2164 TestObj* imp = V8TestObject::toNative(info.Holder());
2165 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
2166 imp->setPerWorldAttribute(WTF::getPtr(cppValue));
2169 static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2171 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2172 TestObjV8Internal::perWorldAttributeAttributeSetter(jsValue, info);
2173 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2176 static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2178 TestObj* imp = V8TestObject::toNative(info.Holder());
2179 v8SetReturnValueForMainWorld(info, imp->perWorldAttribute());
2182 static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2184 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2185 TestObjV8Internal::perWorldAttributeAttributeGetterForMainWorld(info);
2186 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2189 static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2191 TestObj* imp = V8TestObject::toNative(info.Holder());
2192 V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
2193 imp->setPerWorldAttribute(WTF::getPtr(cppValue));
2196 static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2198 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2199 TestObjV8Internal::perWorldAttributeAttributeSetterForMainWorld(jsValue, info);
2200 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2203 static void activityLoggedAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2205 TestObj* imp = V8TestObject::toNative(info.Holder());
2206 v8SetReturnValueInt(info, imp->activityLoggedAttr1());
2209 static void activityLoggedAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2212 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2213 if (contextData && contextData->activityLogger())
2214 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 0, 0, "Getter");
2215 TestObjV8Internal::activityLoggedAttr1AttributeGetter(info);
2216 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2219 static void activityLoggedAttr1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2221 TestObj* imp = V8TestObject::toNative(info.Holder());
2222 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2223 imp->setActivityLoggedAttr1(cppValue);
2226 static void activityLoggedAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2228 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2229 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2230 if (contextData && contextData->activityLogger()) {
2231 v8::Handle<v8::Value> loggerArg[] = { jsValue };
2232 contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1, &loggerArg[0], "Setter");
2234 TestObjV8Internal::activityLoggedAttr1AttributeSetter(jsValue, info);
2235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2238 static void activityLoggedAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2240 TestObj* imp = V8TestObject::toNative(info.Holder());
2241 v8SetReturnValueInt(info, imp->activityLoggedAttr2());
2244 static void activityLoggedAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2246 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2247 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2248 if (contextData && contextData->activityLogger())
2249 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0, 0, "Getter");
2250 TestObjV8Internal::activityLoggedAttr2AttributeGetter(info);
2251 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2254 static void activityLoggedAttr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2256 TestObj* imp = V8TestObject::toNative(info.Holder());
2257 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2258 imp->setActivityLoggedAttr2(cppValue);
2261 static void activityLoggedAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2263 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2264 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2265 if (contextData && contextData->activityLogger()) {
2266 v8::Handle<v8::Value> loggerArg[] = { jsValue };
2267 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter");
2269 TestObjV8Internal::activityLoggedAttr2AttributeSetter(jsValue, info);
2270 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2273 static void activityLoggedAttr2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2275 TestObj* imp = V8TestObject::toNative(info.Holder());
2276 v8SetReturnValueInt(info, imp->activityLoggedAttr2());
2279 static void activityLoggedAttr2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2281 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2282 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2283 if (contextData && contextData->activityLogger())
2284 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0, 0, "Getter");
2285 TestObjV8Internal::activityLoggedAttr2AttributeGetterForMainWorld(info);
2286 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2289 static void activityLoggedAttr2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2291 TestObj* imp = V8TestObject::toNative(info.Holder());
2292 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2293 imp->setActivityLoggedAttr2(cppValue);
2296 static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2298 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2299 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2300 if (contextData && contextData->activityLogger()) {
2301 v8::Handle<v8::Value> loggerArg[] = { jsValue };
2302 contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter");
2304 TestObjV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(jsValue, info);
2305 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2308 static void activityLoggedInIsolatedWorldsAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2310 TestObj* imp = V8TestObject::toNative(info.Holder());
2311 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr());
2314 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2316 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2317 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2318 if (contextData && contextData->activityLogger())
2319 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 0, 0, "Getter");
2320 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetter(info);
2321 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2324 static void activityLoggedInIsolatedWorldsAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2326 TestObj* imp = V8TestObject::toNative(info.Holder());
2327 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2328 imp->setActivityLoggedInIsolatedWorldsAttr(cppValue);
2331 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2333 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2334 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2335 if (contextData && contextData->activityLogger()) {
2336 v8::Handle<v8::Value> loggerArg[] = { jsValue };
2337 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 1, &loggerArg[0], "Setter");
2339 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetter(jsValue, info);
2340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2343 static void activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2345 TestObj* imp = V8TestObject::toNative(info.Holder());
2346 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr());
2349 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2351 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2352 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(info);
2353 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2356 static void activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2358 TestObj* imp = V8TestObject::toNative(info.Holder());
2359 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2360 imp->setActivityLoggedInIsolatedWorldsAttr(cppValue);
2363 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2365 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2366 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(jsValue, info);
2367 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2370 static void activityLoggedAttrSetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2372 TestObj* imp = V8TestObject::toNative(info.Holder());
2373 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter1());
2376 static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2378 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2379 TestObjV8Internal::activityLoggedAttrSetter1AttributeGetter(info);
2380 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2383 static void activityLoggedAttrSetter1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2385 TestObj* imp = V8TestObject::toNative(info.Holder());
2386 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2387 imp->setActivityLoggedAttrSetter1(cppValue);
2390 static void activityLoggedAttrSetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2392 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2393 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2394 if (contextData && contextData->activityLogger()) {
2395 v8::Handle<v8::Value> loggerArg[] = { jsValue };
2396 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1", 1, &loggerArg[0], "Setter");
2398 TestObjV8Internal::activityLoggedAttrSetter1AttributeSetter(jsValue, info);
2399 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2402 static void activityLoggedAttrSetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2404 TestObj* imp = V8TestObject::toNative(info.Holder());
2405 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2());
2408 static void activityLoggedAttrSetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2410 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2411 TestObjV8Internal::activityLoggedAttrSetter2AttributeGetter(info);
2412 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2415 static void activityLoggedAttrSetter2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2417 TestObj* imp = V8TestObject::toNative(info.Holder());
2418 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2419 imp->setActivityLoggedAttrSetter2(cppValue);
2422 static void activityLoggedAttrSetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2424 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2425 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2426 if (contextData && contextData->activityLogger()) {
2427 v8::Handle<v8::Value> loggerArg[] = { jsValue };
2428 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter");
2430 TestObjV8Internal::activityLoggedAttrSetter2AttributeSetter(jsValue, info);
2431 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2434 static void activityLoggedAttrSetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2436 TestObj* imp = V8TestObject::toNative(info.Holder());
2437 v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2());
2440 static void activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2442 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2443 TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterForMainWorld(info);
2444 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2447 static void activityLoggedAttrSetter2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2449 TestObj* imp = V8TestObject::toNative(info.Holder());
2450 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2451 imp->setActivityLoggedAttrSetter2(cppValue);
2454 static void activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2456 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2457 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2458 if (contextData && contextData->activityLogger()) {
2459 v8::Handle<v8::Value> loggerArg[] = { jsValue };
2460 contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter");
2462 TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterForMainWorld(jsValue, info);
2463 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2466 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2468 TestObj* imp = V8TestObject::toNative(info.Holder());
2469 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter());
2472 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2474 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2475 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(info);
2476 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2479 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2481 TestObj* imp = V8TestObject::toNative(info.Holder());
2482 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2483 imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue);
2486 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2488 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2489 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2490 if (contextData && contextData->activityLogger()) {
2491 v8::Handle<v8::Value> loggerArg[] = { jsValue };
2492 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrSetter", 1, &loggerArg[0], "Setter");
2494 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(jsValue, info);
2495 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2498 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2500 TestObj* imp = V8TestObject::toNative(info.Holder());
2501 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter());
2504 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2506 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2507 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(info);
2508 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2511 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2513 TestObj* imp = V8TestObject::toNative(info.Holder());
2514 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2515 imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue);
2518 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2520 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2521 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(jsValue, info);
2522 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2525 static void activityLoggedAttrGetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2527 TestObj* imp = V8TestObject::toNative(info.Holder());
2528 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter1());
2531 static void activityLoggedAttrGetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2533 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2534 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2535 if (contextData && contextData->activityLogger())
2536 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter1", 0, 0, "Getter");
2537 TestObjV8Internal::activityLoggedAttrGetter1AttributeGetter(info);
2538 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2541 static void activityLoggedAttrGetter1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2543 TestObj* imp = V8TestObject::toNative(info.Holder());
2544 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2545 imp->setActivityLoggedAttrGetter1(cppValue);
2548 static void activityLoggedAttrGetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2550 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2551 TestObjV8Internal::activityLoggedAttrGetter1AttributeSetter(jsValue, info);
2552 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2555 static void activityLoggedAttrGetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2557 TestObj* imp = V8TestObject::toNative(info.Holder());
2558 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter2());
2561 static void activityLoggedAttrGetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2563 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2564 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2565 if (contextData && contextData->activityLogger())
2566 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2", 0, 0, "Getter");
2567 TestObjV8Internal::activityLoggedAttrGetter2AttributeGetter(info);
2568 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2571 static void activityLoggedAttrGetter2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2573 TestObj* imp = V8TestObject::toNative(info.Holder());
2574 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2575 imp->setActivityLoggedAttrGetter2(cppValue);
2578 static void activityLoggedAttrGetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2580 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2581 TestObjV8Internal::activityLoggedAttrGetter2AttributeSetter(jsValue, info);
2582 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2585 static void activityLoggedAttrGetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2587 TestObj* imp = V8TestObject::toNative(info.Holder());
2588 v8SetReturnValueInt(info, imp->activityLoggedAttrGetter2());
2591 static void activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2593 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2594 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2595 if (contextData && contextData->activityLogger())
2596 contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2", 0, 0, "Getter");
2597 TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterForMainWorld(info);
2598 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2601 static void activityLoggedAttrGetter2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2603 TestObj* imp = V8TestObject::toNative(info.Holder());
2604 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2605 imp->setActivityLoggedAttrGetter2(cppValue);
2608 static void activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2610 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2611 TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterForMainWorld(jsValue, info);
2612 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2615 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2617 TestObj* imp = V8TestObject::toNative(info.Holder());
2618 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter());
2621 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2623 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2624 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2625 if (contextData && contextData->activityLogger())
2626 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrGetter", 0, 0, "Getter");
2627 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(info);
2628 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2631 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2633 TestObj* imp = V8TestObject::toNative(info.Holder());
2634 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2635 imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue);
2638 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2640 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2641 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(jsValue, info);
2642 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2645 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2647 TestObj* imp = V8TestObject::toNative(info.Holder());
2648 v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter());
2651 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2653 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2654 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(info);
2655 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2658 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2660 TestObj* imp = V8TestObject::toNative(info.Holder());
2661 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2662 imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue);
2665 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2667 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2668 TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(jsValue, info);
2669 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2672 static void deprecatedStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2674 v8SetReturnValueInt(info, TestObj::deprecatedStaticReadOnlyAttr());
2677 static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2680 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticReadonlyAttribute);
2681 TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetter(info);
2682 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2685 static void deprecatedStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2687 v8SetReturnValueInt(info, TestObj::deprecatedStaticAttr());
2690 static void deprecatedStaticAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2692 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2693 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAttribute);
2694 TestObjV8Internal::deprecatedStaticAttrAttributeGetter(info);
2695 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2698 static void deprecatedStaticAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2700 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2701 TestObj::setDeprecatedStaticAttr(cppValue);
2704 static void deprecatedStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2706 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2707 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAttribute);
2708 TestObjV8Internal::deprecatedStaticAttrAttributeSetter(jsValue, info);
2709 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2712 static void deprecatedReadonlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2714 TestObj* imp = V8TestObject::toNative(info.Holder());
2715 v8SetReturnValueInt(info, imp->deprecatedReadonlyAttr());
2718 static void deprecatedReadonlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2720 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2721 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::ReadonlyAttribute);
2722 TestObjV8Internal::deprecatedReadonlyAttrAttributeGetter(info);
2723 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2726 static void deprecatedAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2728 TestObj* imp = V8TestObject::toNative(info.Holder());
2729 v8SetReturnValueInt(info, imp->deprecatedAttr());
2732 static void deprecatedAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2734 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2735 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute);
2736 TestObjV8Internal::deprecatedAttrAttributeGetter(info);
2737 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2740 static void deprecatedAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2742 TestObj* imp = V8TestObject::toNative(info.Holder());
2743 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2744 imp->setDeprecatedAttr(cppValue);
2747 static void deprecatedAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2749 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2750 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute);
2751 TestObjV8Internal::deprecatedAttrAttributeSetter(jsValue, info);
2752 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2755 static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2757 TestObj* imp = V8TestObject::toNative(info.Holder());
2758 v8SetReturnValueFast(info, imp->location(), imp);
2761 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2763 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2764 TestObjV8Internal::locationAttributeGetter(info);
2765 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2768 static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2770 TestObj* proxyImp = V8TestObject::toNative(info.Holder());
2771 TestNode* imp = proxyImp->location();
2774 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
2775 imp->setHref(cppValue);
2778 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2780 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2781 TestObjV8Internal::locationAttributeSetter(jsValue, info);
2782 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2785 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2787 TestObj* imp = V8TestObject::toNative(info.Holder());
2788 v8SetReturnValueFast(info, imp->locationWithException(), imp);
2791 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2793 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2794 TestObjV8Internal::locationWithExceptionAttributeGetter(info);
2795 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2798 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2800 TestObj* proxyImp = V8TestObject::toNative(info.Holder());
2801 TestNode* imp = proxyImp->locationWithException();
2804 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
2805 ExceptionState es(info.GetIsolate());
2806 imp->setHrefThrows(cppValue, es);
2810 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2813 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info);
2814 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2817 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2819 v8::Handle<v8::Value> data = info.Data();
2820 ASSERT(data->IsExternal());
2821 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
2822 if (!perContextData)
2824 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
2827 static void TestObjReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2829 info.This()->ForceSet(name, jsValue);
2832 static void TestObjReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2834 TestObjV8Internal::TestObjReplaceableAttributeSetter(name, jsValue, info);
2837 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2839 TestObj* imp = V8TestObject::toNative(info.Holder());
2843 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2845 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2846 TestObjV8Internal::voidMethodMethod(info);
2847 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2850 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2852 if (UNLIKELY(info.Length() < 3)) {
2853 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
2856 TestObj* imp = V8TestObject::toNative(info.Holder());
2857 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2858 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
2859 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
2860 imp->voidMethodWithArgs(longArg, strArg, objArg);
2863 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2865 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2866 TestObjV8Internal::voidMethodWithArgsMethod(info);
2867 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2870 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2872 TestObj* imp = V8TestObject::toNative(info.Holder());
2873 v8SetReturnValueInt(info, imp->longMethod());
2876 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2878 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2879 TestObjV8Internal::longMethodMethod(info);
2880 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2883 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2885 if (UNLIKELY(info.Length() < 3)) {
2886 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
2889 TestObj* imp = V8TestObject::toNative(info.Holder());
2890 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2891 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
2892 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
2893 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg));
2896 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2898 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2899 TestObjV8Internal::longMethodWithArgsMethod(info);
2900 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2903 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2905 TestObj* imp = V8TestObject::toNative(info.Holder());
2906 v8SetReturnValue(info, imp->objMethod());
2909 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2911 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2912 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature);
2913 TestObjV8Internal::objMethodMethod(info);
2914 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2917 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2919 if (UNLIKELY(info.Length() < 3)) {
2920 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
2923 TestObj* imp = V8TestObject::toNative(info.Holder());
2924 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2925 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
2926 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
2927 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg));
2930 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2932 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2933 TestObjV8Internal::objMethodWithArgsMethod(info);
2934 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2937 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2939 if (UNLIKELY(info.Length() < 1)) {
2940 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
2943 TestObj* imp = V8TestObject::toNative(info.Holder());
2944 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNativeArray<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate())));
2945 imp->methodWithSequenceArg(sequenceArg);
2948 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2951 TestObjV8Internal::methodWithSequenceArgMethod(info);
2952 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2955 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2957 if (UNLIKELY(info.Length() < 1)) {
2958 throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
2961 TestObj* imp = V8TestObject::toNative(info.Holder());
2962 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2963 v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.GetIsolate()));
2966 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2968 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2969 TestObjV8Internal::methodReturningSequenceMethod(info);
2970 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2973 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2975 if (UNLIKELY(info.Length() < 1)) {
2976 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
2979 TestObj* imp = V8TestObject::toNative(info.Holder());
2980 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]);
2981 String string = enumArg;
2982 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) {
2983 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.GetIsolate());
2986 imp->methodWithEnumArg(enumArg);
2989 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2991 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2992 TestObjV8Internal::methodWithEnumArgMethod(info);
2993 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2996 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2998 if (UNLIKELY(info.Length() < 2)) {
2999 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAllArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
3002 TestObj* imp = V8TestObject::toNative(info.Holder());
3003 ExceptionState es(info.GetIsolate());
3004 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3005 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0);
3006 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, es);
3007 if (es.throwIfNeeded())
3009 v8SetReturnValue(info, result.release());
3012 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3014 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3015 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info);
3016 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3019 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3021 if (UNLIKELY(info.Length() < 1)) {
3022 throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3025 TestObj* imp = V8TestObject::toNative(info.Holder());
3026 bool serializedArgDidThrow = false;
3027 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(info[0], 0, 0, serializedArgDidThrow, info.GetIsolate());
3028 if (serializedArgDidThrow)
3030 imp->serializedValue(serializedArg);
3033 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3035 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3036 TestObjV8Internal::serializedValueMethod(info);
3037 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3040 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3042 if (UNLIKELY(info.Length() < 1)) {
3043 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3046 TestObj* imp = V8TestObject::toNative(info.Holder());
3047 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate()));
3048 if (!oo.isUndefinedOrNull() && !oo.isObject()) {
3049 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 1 ('oo') is not an object."), info.GetIsolate());
3052 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate()));
3053 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) {
3054 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 2 ('ooo') is not an object."), info.GetIsolate());
3057 imp->optionsObject(oo, ooo);
3060 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3062 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3063 TestObjV8Internal::optionsObjectMethod(info);
3064 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3067 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3069 TestObj* imp = V8TestObject::toNative(info.Holder());
3070 ExceptionState es(info.GetIsolate());
3071 imp->methodWithException(es);
3072 if (es.throwIfNeeded())
3076 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3078 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3079 TestObjV8Internal::methodWithExceptionMethod(info);
3080 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3083 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3085 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3086 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature);
3087 V8TestObject::customMethodMethodCustom(info);
3088 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3091 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3093 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3094 V8TestObject::customMethodWithArgsMethodCustom(info);
3095 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3098 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3100 EventTarget* impl = V8TestObject::toNative(info.Holder());
3101 if (DOMWindow* window = impl->toDOMWindow()) {
3102 ExceptionState es(info.GetIsolate());
3103 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
3108 if (!window->document())
3112 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[1], false, ListenerFindOrCreate);
3114 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, stringResource, info[0]);
3115 impl->addEventListener(stringResource, listener, info[2]->BooleanValue());
3116 if (!impl->toNode())
3117 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventListenerCacheIndex, info.GetIsolate());
3121 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3123 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3124 TestObjV8Internal::addEventListenerMethod(info);
3125 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3128 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3130 EventTarget* impl = V8TestObject::toNative(info.Holder());
3131 if (DOMWindow* window = impl->toDOMWindow()) {
3132 ExceptionState es(info.GetIsolate());
3133 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
3138 if (!window->document())
3142 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[1], false, ListenerFindOnly);
3144 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, stringResource, info[0]);
3145 impl->removeEventListener(stringResource, listener.get(), info[2]->BooleanValue());
3146 if (!impl->toNode())
3147 removeHiddenDependency(info.Holder(), info[1], V8TestObject::eventListenerCacheIndex, info.GetIsolate());
3151 static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3153 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3154 TestObjV8Internal::removeEventListenerMethod(info);
3155 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3158 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3160 TestObj* imp = V8TestObject::toNative(info.Holder());
3161 ScriptState* currentState = ScriptState::current();
3164 ScriptState& state = *currentState;
3165 imp->withScriptStateVoid(&state);
3166 if (state.hadException()) {
3167 v8::Local<v8::Value> exception = state.exception();
3168 state.clearException();
3169 throwError(exception, info.GetIsolate());
3174 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3176 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3177 TestObjV8Internal::withScriptStateVoidMethod(info);
3178 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3181 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3183 TestObj* imp = V8TestObject::toNative(info.Holder());
3184 ScriptState* currentState = ScriptState::current();
3187 ScriptState& state = *currentState;
3188 RefPtr<TestObj> result = imp->withScriptStateObj(&state);
3189 if (state.hadException()) {
3190 v8::Local<v8::Value> exception = state.exception();
3191 state.clearException();
3192 throwError(exception, info.GetIsolate());
3195 v8SetReturnValue(info, result.release());
3198 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3200 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3201 TestObjV8Internal::withScriptStateObjMethod(info);
3202 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3205 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3207 TestObj* imp = V8TestObject::toNative(info.Holder());
3208 ExceptionState es(info.GetIsolate());
3209 ScriptState* currentState = ScriptState::current();
3212 ScriptState& state = *currentState;
3213 imp->withScriptStateVoidException(&state, es);
3214 if (es.throwIfNeeded())
3216 if (state.hadException()) {
3217 v8::Local<v8::Value> exception = state.exception();
3218 state.clearException();
3219 throwError(exception, info.GetIsolate());
3224 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3227 TestObjV8Internal::withScriptStateVoidExceptionMethod(info);
3228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3231 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3233 TestObj* imp = V8TestObject::toNative(info.Holder());
3234 ExceptionState es(info.GetIsolate());
3235 ScriptState* currentState = ScriptState::current();
3238 ScriptState& state = *currentState;
3239 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, es);
3240 if (es.throwIfNeeded())
3242 if (state.hadException()) {
3243 v8::Local<v8::Value> exception = state.exception();
3244 state.clearException();
3245 throwError(exception, info.GetIsolate());
3248 v8SetReturnValue(info, result.release());
3251 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3253 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3254 TestObjV8Internal::withScriptStateObjExceptionMethod(info);
3255 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3258 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3260 TestObj* imp = V8TestObject::toNative(info.Holder());
3261 ExecutionContext* scriptContext = getExecutionContext();
3262 imp->withExecutionContext(scriptContext);
3265 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3268 TestObjV8Internal::withExecutionContextMethod(info);
3269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3272 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3274 TestObj* imp = V8TestObject::toNative(info.Holder());
3275 ScriptState* currentState = ScriptState::current();
3278 ScriptState& state = *currentState;
3279 ExecutionContext* scriptContext = getExecutionContext();
3280 imp->withExecutionContextAndScriptState(&state, scriptContext);
3281 if (state.hadException()) {
3282 v8::Local<v8::Value> exception = state.exception();
3283 state.clearException();
3284 throwError(exception, info.GetIsolate());
3289 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3292 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info);
3293 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3296 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3298 TestObj* imp = V8TestObject::toNative(info.Holder());
3299 ExceptionState es(info.GetIsolate());
3300 ScriptState* currentState = ScriptState::current();
3303 ScriptState& state = *currentState;
3304 ExecutionContext* scriptContext = getExecutionContext();
3305 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException(&state, scriptContext, es);
3306 if (es.throwIfNeeded())
3308 if (state.hadException()) {
3309 v8::Local<v8::Value> exception = state.exception();
3310 state.clearException();
3311 throwError(exception, info.GetIsolate());
3314 v8SetReturnValue(info, result.release());
3317 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3319 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3320 TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info);
3321 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3324 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3326 TestObj* imp = V8TestObject::toNative(info.Holder());
3327 ScriptState* currentState = ScriptState::current();
3330 ScriptState& state = *currentState;
3331 ExecutionContext* scriptContext = getExecutionContext();
3332 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateWithSpaces(&state, scriptContext);
3333 if (state.hadException()) {
3334 v8::Local<v8::Value> exception = state.exception();
3335 state.clearException();
3336 throwError(exception, info.GetIsolate());
3339 v8SetReturnValue(info, result.release());
3342 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3344 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3345 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info);
3346 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3349 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3351 TestObj* imp = V8TestObject::toNative(info.Holder());
3352 imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow());
3355 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3357 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3358 TestObjV8Internal::withActiveWindowAndFirstWindowMethod(info);
3359 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3362 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3364 TestObj* imp = V8TestObject::toNative(info.Holder());
3365 if (UNLIKELY(info.Length() <= 0)) {
3366 imp->methodWithOptionalArg();
3369 V8TRYCATCH_VOID(int, opt, toInt32(info[0]));
3370 imp->methodWithOptionalArg(opt);
3373 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3375 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3376 TestObjV8Internal::methodWithOptionalArgMethod(info);
3377 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3380 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3382 if (UNLIKELY(info.Length() < 1)) {
3383 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptionalArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3386 TestObj* imp = V8TestObject::toNative(info.Holder());
3387 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0]));
3388 if (UNLIKELY(info.Length() <= 1)) {
3389 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
3392 V8TRYCATCH_VOID(int, opt, toInt32(info[1]));
3393 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
3396 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3398 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3399 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info);
3400 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3403 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3405 if (UNLIKELY(info.Length() < 1)) {
3406 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptionalArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3409 TestObj* imp = V8TestObject::toNative(info.Holder());
3410 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0]));
3411 if (UNLIKELY(info.Length() <= 1)) {
3412 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
3415 V8TRYCATCH_VOID(int, opt1, toInt32(info[1]));
3416 if (UNLIKELY(info.Length() <= 2)) {
3417 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
3420 V8TRYCATCH_VOID(int, opt2, toInt32(info[2]));
3421 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
3424 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3426 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3427 TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info);
3428 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3431 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3433 TestObj* imp = V8TestObject::toNative(info.Holder());
3434 if (UNLIKELY(info.Length() <= 0)) {
3435 imp->methodWithOptionalString();
3438 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
3439 imp->methodWithOptionalString(str);
3442 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3444 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3445 TestObjV8Internal::methodWithOptionalStringMethod(info);
3446 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3449 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3451 TestObj* imp = V8TestObject::toNative(info.Holder());
3452 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
3453 imp->methodWithOptionalStringIsUndefined(str);
3456 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3458 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3459 TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(info);
3460 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3463 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3465 TestObj* imp = V8TestObject::toNative(info.Holder());
3466 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull(info, 0));
3467 imp->methodWithOptionalStringIsNullString(str);
3470 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3472 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3473 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info);
3474 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3477 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3479 if (UNLIKELY(info.Length() < 1)) {
3480 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3483 TestObj* imp = V8TestObject::toNative(info.Holder());
3484 if (info.Length() <= 0 || !info[0]->IsFunction()) {
3485 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3488 RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecutionContext());
3489 imp->methodWithCallbackArg(callback);
3492 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3494 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3495 TestObjV8Internal::methodWithCallbackArgMethod(info);
3496 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3499 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3501 if (UNLIKELY(info.Length() < 2)) {
3502 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallbackArgAndCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
3505 TestObj* imp = V8TestObject::toNative(info.Holder());
3506 V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0]));
3507 if (info.Length() <= 1 || !info[1]->IsFunction()) {
3508 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallbackArgAndCallbackArg", "TestObject", "The callback provided as parameter 2 is not a function."), info.GetIsolate());
3511 RefPtr<TestCallback> callback = V8TestCallback::create(info[1], getExecutionContext());
3512 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
3515 static void methodWithNonCallbackArgAndCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3517 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3518 TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(info);
3519 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3522 static void methodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3524 TestObj* imp = V8TestObject::toNative(info.Holder());
3525 RefPtr<TestCallback> callback;
3526 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) {
3527 if (!info[0]->IsFunction()) {
3528 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3531 callback = V8TestCallback::create(info[0], getExecutionContext());
3533 imp->methodWithCallbackAndOptionalArg(callback);
3536 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3538 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3539 TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(info);
3540 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3543 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3545 if (UNLIKELY(info.Length() < 1)) {
3546 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3549 TestObj* imp = V8TestObject::toNative(info.Holder());
3550 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) {
3551 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3554 RefPtr<TestCallback> callback = info[0]->IsNull() ? 0 : V8TestCallback::create(info[0], getExecutionContext());
3555 imp->methodWithNullableCallbackArg(callback);
3558 static void methodWithNullableCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3560 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3561 TestObjV8Internal::methodWithNullableCallbackArgMethod(info);
3562 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3565 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3567 RefPtr<TestCallback> callback;
3568 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) {
3569 if (!info[0]->IsFunction()) {
3570 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3573 callback = V8TestCallback::create(info[0], getExecutionContext());
3575 TestObj::staticMethodWithCallbackAndOptionalArg(callback);
3578 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3580 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3581 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info);
3582 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3585 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3587 if (UNLIKELY(info.Length() < 1)) {
3588 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3591 if (info.Length() <= 0 || !info[0]->IsFunction()) {
3592 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3595 RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecutionContext());
3596 TestObj::staticMethodWithCallbackArg(callback);
3599 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3601 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3602 TestObjV8Internal::staticMethodWithCallbackArgMethod(info);
3603 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3606 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3608 if (UNLIKELY(info.Length() < 1)) {
3609 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3612 TestObj* imp = V8TestObject::toNative(info.Holder());
3613 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(info[0], EnforceRange, ok), info.GetIsolate());
3614 imp->methodWithEnforceRangeInt8(value);
3617 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3619 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3620 TestObjV8Internal::methodWithEnforceRangeInt8Method(info);
3621 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3624 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3626 if (UNLIKELY(info.Length() < 1)) {
3627 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3630 TestObj* imp = V8TestObject::toNative(info.Holder());
3631 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(info[0], EnforceRange, ok), info.GetIsolate());
3632 imp->methodWithEnforceRangeUInt8(value);
3635 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3638 TestObjV8Internal::methodWithEnforceRangeUInt8Method(info);
3639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3642 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3644 if (UNLIKELY(info.Length() < 1)) {
3645 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3648 TestObj* imp = V8TestObject::toNative(info.Holder());
3649 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt16(info[0], EnforceRange, ok), info.GetIsolate());
3650 imp->methodWithEnforceRangeInt16(value);
3653 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3655 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3656 TestObjV8Internal::methodWithEnforceRangeInt16Method(info);
3657 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3660 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3662 if (UNLIKELY(info.Length() < 1)) {
3663 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3666 TestObj* imp = V8TestObject::toNative(info.Holder());
3667 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt16(info[0], EnforceRange, ok), info.GetIsolate());
3668 imp->methodWithEnforceRangeUInt16(value);
3671 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3673 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3674 TestObjV8Internal::methodWithEnforceRangeUInt16Method(info);
3675 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3678 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3680 if (UNLIKELY(info.Length() < 1)) {
3681 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3684 TestObj* imp = V8TestObject::toNative(info.Holder());
3685 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(info[0], EnforceRange, ok), info.GetIsolate());
3686 imp->methodWithEnforceRangeInt32(value);
3689 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3691 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3692 TestObjV8Internal::methodWithEnforceRangeInt32Method(info);
3693 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3696 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3698 if (UNLIKELY(info.Length() < 1)) {
3699 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3702 TestObj* imp = V8TestObject::toNative(info.Holder());
3703 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(info[0], EnforceRange, ok), info.GetIsolate());
3704 imp->methodWithEnforceRangeUInt32(value);
3707 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3709 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3710 TestObjV8Internal::methodWithEnforceRangeUInt32Method(info);
3711 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3714 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3716 if (UNLIKELY(info.Length() < 1)) {
3717 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3720 TestObj* imp = V8TestObject::toNative(info.Holder());
3721 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(info[0], EnforceRange, ok), info.GetIsolate());
3722 imp->methodWithEnforceRangeInt64(value);
3725 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3727 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3728 TestObjV8Internal::methodWithEnforceRangeInt64Method(info);
3729 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3732 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3734 if (UNLIKELY(info.Length() < 1)) {
3735 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3738 TestObj* imp = V8TestObject::toNative(info.Holder());
3739 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(info[0], EnforceRange, ok), info.GetIsolate());
3740 imp->methodWithEnforceRangeUInt64(value);
3743 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3745 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3746 TestObjV8Internal::methodWithEnforceRangeUInt64Method(info);
3747 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3750 #if ENABLE(Condition1)
3752 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3754 TestObj* imp = V8TestObject::toNative(info.Holder());
3755 v8SetReturnValueString(info, imp->conditionalMethod1(), info.GetIsolate());
3758 #endif // ENABLE(Condition1)
3760 #if ENABLE(Condition1)
3762 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3764 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3765 TestObjV8Internal::conditionalMethod1Method(info);
3766 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3769 #endif // ENABLE(Condition1)
3771 #if ENABLE(Condition1) && ENABLE(Condition2)
3773 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3775 TestObj* imp = V8TestObject::toNative(info.Holder());
3776 imp->conditionalMethod2();
3779 #endif // ENABLE(Condition1) && ENABLE(Condition2)
3781 #if ENABLE(Condition1) && ENABLE(Condition2)
3783 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3785 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3786 TestObjV8Internal::conditionalMethod2Method(info);
3787 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3790 #endif // ENABLE(Condition1) && ENABLE(Condition2)
3792 #if ENABLE(Condition1) || ENABLE(Condition2)
3794 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3796 TestObj* imp = V8TestObject::toNative(info.Holder());
3797 imp->conditionalMethod3();
3800 #endif // ENABLE(Condition1) || ENABLE(Condition2)
3802 #if ENABLE(Condition1) || ENABLE(Condition2)
3804 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3806 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3807 TestObjV8Internal::conditionalMethod3Method(info);
3808 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3811 #endif // ENABLE(Condition1) || ENABLE(Condition2)
3813 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3815 TestObj* imp = V8TestObject::toNative(info.Holder());
3816 v8SetReturnValue(info, imp->callbackFunctionReturnValue().v8Value());
3819 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3821 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3822 TestObjV8Internal::callbackFunctionReturnValueMethod(info);
3823 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3826 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3828 if (UNLIKELY(info.Length() < 1)) {
3829 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgument", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3832 TestObj* imp = V8TestObject::toNative(info.Holder());
3833 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate()));
3834 imp->callbackFunctionArgument(function);
3837 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3839 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3840 TestObjV8Internal::callbackFunctionArgumentMethod(info);
3841 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3844 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3846 if (UNLIKELY(info.Length() < 2)) {
3847 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
3850 TestObj* imp = V8TestObject::toNative(info.Holder());
3851 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
3852 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
3853 imp->overloadedMethod(objArg, strArg);
3856 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3858 if (UNLIKELY(info.Length() < 1)) {
3859 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3862 TestObj* imp = V8TestObject::toNative(info.Holder());
3863 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
3864 if (UNLIKELY(info.Length() <= 1)) {
3865 imp->overloadedMethod(objArg);
3868 V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
3869 imp->overloadedMethod(objArg, longArg);
3872 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3874 if (UNLIKELY(info.Length() < 1)) {
3875 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3878 TestObj* imp = V8TestObject::toNative(info.Holder());
3879 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3880 imp->overloadedMethod(strArg);
3883 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3885 if (UNLIKELY(info.Length() < 1)) {
3886 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3889 TestObj* imp = V8TestObject::toNative(info.Holder());
3890 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
3891 imp->overloadedMethod(longArg);
3894 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3896 if (UNLIKELY(info.Length() < 1)) {
3897 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3900 TestObj* imp = V8TestObject::toNative(info.Holder());
3901 if (info.Length() <= 0 || !info[0]->IsFunction()) {
3902 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3905 RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecutionContext());
3906 imp->overloadedMethod(callback);
3909 static void overloadedMethod6Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3911 if (UNLIKELY(info.Length() < 1)) {
3912 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3915 TestObj* imp = V8TestObject::toNative(info.Holder());
3916 V8TRYCATCH_VOID(DOMStringList*, listArg, V8DOMStringList::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
3917 imp->overloadedMethod(listArg);
3920 static void overloadedMethod7Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3922 if (UNLIKELY(info.Length() < 1)) {
3923 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3926 TestObj* imp = V8TestObject::toNative(info.Holder());
3927 bool arrayArgIsNull = info[0]->IsNull();
3928 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
3929 imp->overloadedMethod(arrayArgIsNull ? 0 : &arrayArg);
3932 static void overloadedMethod8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3934 if (UNLIKELY(info.Length() < 1)) {
3935 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3938 TestObj* imp = V8TestObject::toNative(info.Holder());
3939 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
3940 imp->overloadedMethod(objArg);
3943 static void overloadedMethod9Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3945 if (UNLIKELY(info.Length() < 1)) {
3946 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3949 TestObj* imp = V8TestObject::toNative(info.Holder());
3950 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
3951 imp->overloadedMethod(arrayArg);
3954 static void overloadedMethod10Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3956 if (UNLIKELY(info.Length() < 1)) {
3957 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3960 TestObj* imp = V8TestObject::toNative(info.Holder());
3961 V8TRYCATCH_VOID(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(info[0], 1, info.GetIsolate()));
3962 imp->overloadedMethod(arrayArg);
3965 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3967 if (UNLIKELY(info.Length() < 1)) {
3968 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3971 TestObj* imp = V8TestObject::toNative(info.Holder());
3972 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3973 imp->overloadedMethod(strArg);
3976 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3978 if ((info.Length() == 2 && (info[0]->IsNull() || V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) && (info[1]->IsNull() || info[1]->IsUndefined() || info[1]->IsString() || info[1]->IsObject()))) {
3979 overloadedMethod1Method(info);
3982 if ((info.Length() == 1 && (info[0]->IsNull() || V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())))) || (info.Length() == 2 && (info[0]->IsNull() || V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
3983 overloadedMethod2Method(info);
3986 if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsUndefined() || info[0]->IsString() || info[0]->IsObject()))) {
3987 overloadedMethod3Method(info);
3990 if (info.Length() == 1) {
3991 overloadedMethod4Method(info);
3994 if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsFunction()))) {
3995 overloadedMethod5Method(info);
3998 if ((info.Length() == 1 && (info[0]->IsNull() || V8DOMStringList::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
3999 overloadedMethod6Method(info);
4002 if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsArray()))) {
4003 overloadedMethod7Method(info);
4006 if ((info.Length() == 1 && (V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
4007 overloadedMethod8Method(info);
4010 if ((info.Length() == 1 && (info[0]->IsArray()))) {
4011 overloadedMethod9Method(info);
4014 if ((info.Length() == 1 && (info[0]->IsArray()))) {
4015 overloadedMethod10Method(info);
4018 if (info.Length() == 1) {
4019 overloadedMethod11Method(info);
4022 if (UNLIKELY(info.Length() < 1)) {
4023 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4026 throwUninformativeAndGenericTypeError(info.GetIsolate());
4029 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4031 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4032 TestObjV8Internal::overloadedMethodMethod(info);
4033 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4036 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4038 TestObj::classMethod();
4041 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4043 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4044 TestObjV8Internal::classMethodMethod(info);
4045 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4048 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4050 if (UNLIKELY(info.Length() <= 0)) {
4051 v8SetReturnValueInt(info, TestObj::classMethodWithOptional());
4054 V8TRYCATCH_VOID(int, arg, toInt32(info[0]));
4055 v8SetReturnValueInt(info, TestObj::classMethodWithOptional(arg));
4058 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4060 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4061 TestObjV8Internal::classMethodWithOptionalMethod(info);
4062 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4065 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4067 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4068 V8TestObject::classMethod2MethodCustom(info);
4069 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4072 #if ENABLE(Condition1)
4074 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4076 if (UNLIKELY(info.Length() < 1)) {
4077 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4080 V8TRYCATCH_VOID(int, arg, toInt32(info[0]));
4081 TestObj::overloadedMethod1(arg);
4084 #endif // ENABLE(Condition1)
4086 #if ENABLE(Condition1)
4088 static void overloadedMethod12Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4090 if (UNLIKELY(info.Length() < 1)) {
4091 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4094 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
4095 TestObj::overloadedMethod1(type);
4098 #endif // ENABLE(Condition1)
4100 #if ENABLE(Condition1)
4102 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4104 if (info.Length() == 1) {
4105 overloadedMethod11Method(info);
4108 if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsUndefined() || info[0]->IsString() || info[0]->IsObject()))) {
4109 overloadedMethod12Method(info);
4112 if (UNLIKELY(info.Length() < 1)) {
4113 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4116 throwUninformativeAndGenericTypeError(info.GetIsolate());
4119 #endif // ENABLE(Condition1)
4121 #if ENABLE(Condition1)
4123 static void overloadedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4126 TestObjV8Internal::overloadedMethod1Method(info);
4127 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4130 #endif // ENABLE(Condition1)
4132 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4134 if (UNLIKELY(info.Length() < 2)) {
4135 throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4138 TestObj* imp = V8TestObject::toNative(info.Holder());
4139 unsigned objArgsShort = 0;
4140 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue());
4141 if (!std::isnan(objArgsShortNativeValue))
4142 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue);
4143 unsigned objArgsLong = 0;
4144 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue());
4145 if (!std::isnan(objArgsLongNativeValue))
4146 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue);
4147 imp->classMethodWithClamp(objArgsShort, objArgsLong);
4150 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4152 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4153 TestObjV8Internal::classMethodWithClampMethod(info);
4154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4157 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4159 if (UNLIKELY(info.Length() < 1)) {
4160 throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4163 TestObj* imp = V8TestObject::toNative(info.Holder());
4164 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4165 imp->enabledAtRuntimeMethod(longArg);
4168 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4170 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4171 TestObjV8Internal::enabledAtRuntimeMethodMethod(info);
4172 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4175 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4177 if (UNLIKELY(info.Length() < 1)) {
4178 throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4181 TestObj* imp = V8TestObject::toNative(info.Holder());
4182 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4183 imp->enabledPerContextMethod(longArg);
4186 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4188 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4189 TestObjV8Internal::enabledPerContextMethodMethod(info);
4190 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4193 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4195 if (UNLIKELY(info.Length() < 1)) {
4196 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLongSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4199 TestObj* imp = V8TestObject::toNative(info.Holder());
4200 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsigned>(info[0], 1, info.GetIsolate()));
4201 imp->methodWithUnsignedLongSequence(unsignedLongSequence);
4204 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4206 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4207 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info);
4208 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4211 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4213 if (UNLIKELY(info.Length() < 1)) {
4214 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4217 TestObj* imp = V8TestObject::toNative(info.Holder());
4218 ExceptionState es(info.GetIsolate());
4219 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate()));
4220 Vector<String> result = imp->stringArrayFunction(values, es);
4221 if (es.throwIfNeeded())
4223 v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
4226 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4228 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4229 TestObjV8Internal::stringArrayFunctionMethod(info);
4230 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4233 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4235 if (UNLIKELY(info.Length() < 1)) {
4236 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4239 TestObj* imp = V8TestObject::toNative(info.Holder());
4240 ExceptionState es(info.GetIsolate());
4241 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4242 RefPtr<DOMStringList> result = imp->domStringListFunction(values, es);
4243 if (es.throwIfNeeded())
4245 v8SetReturnValue(info, result.release());
4248 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4250 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4251 TestObjV8Internal::domStringListFunctionMethod(info);
4252 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4255 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4257 TestObj* imp = V8TestObject::toNative(info.Holder());
4258 ExceptionState es(info.GetIsolate());
4259 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(es), es)) {
4260 v8SetReturnValueNull(info);
4264 RefPtr<SVGDocument> result = imp->getSVGDocument(es);
4265 if (es.throwIfNeeded())
4267 v8SetReturnValue(info, result.release());
4270 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4272 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4273 TestObjV8Internal::getSVGDocumentMethod(info);
4274 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4277 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4279 if (UNLIKELY(info.Length() < 1)) {
4280 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4283 TestObj* imp = V8TestObject::toNative(info.Holder());
4284 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4285 imp->convert1(value);
4288 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4290 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4291 TestObjV8Internal::convert1Method(info);
4292 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4295 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4297 if (UNLIKELY(info.Length() < 1)) {
4298 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4301 TestObj* imp = V8TestObject::toNative(info.Holder());
4302 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4303 imp->convert2(value);
4306 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4308 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4309 TestObjV8Internal::convert2Method(info);
4310 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4313 static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4315 TestObj* imp = V8TestObject::toNative(info.Holder());
4316 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->mutablePointFunction())));
4319 static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4321 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4322 TestObjV8Internal::mutablePointFunctionMethod(info);
4323 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4326 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4328 TestObj* imp = V8TestObject::toNative(info.Holder());
4329 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->immutablePointFunction())));
4332 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4334 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4335 TestObjV8Internal::immutablePointFunctionMethod(info);
4336 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4339 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4341 if (UNLIKELY(info.Length() < 2)) {
4342 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4345 TestObj* imp = V8TestObject::toNative(info.Holder());
4346 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4347 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1]));
4349 throwUninformativeAndGenericTypeError(info.GetIsolate());
4352 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->svgPointMethod(item->propertyReference(), index))));
4355 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4357 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4358 TestObjV8Internal::svgPointMethodMethod(info);
4359 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4362 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4364 if (UNLIKELY(info.Length() < 2)) {
4365 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4368 TestObj* imp = V8TestObject::toNative(info.Holder());
4369 ExceptionState es(info.GetIsolate());
4370 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
4371 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
4374 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4375 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1]));
4377 throwUninformativeAndGenericTypeError(info.GetIsolate());
4380 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index, es);
4381 if (es.throwIfNeeded())
4383 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(result)));
4386 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4388 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4389 TestObjV8Internal::strictSVGPointMethodMethod(info);
4390 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4393 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4395 TestObj* imp = V8TestObject::toNative(info.Holder());
4399 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4401 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4402 TestObjV8Internal::orangeMethod(info);
4403 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4406 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4408 if (UNLIKELY(info.Length() < 3)) {
4409 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
4412 TestObj* imp = V8TestObject::toNative(info.Holder());
4413 ExceptionState es(info.GetIsolate());
4414 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
4415 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue()));
4416 V8TRYCATCH_VOID(int, b, toInt32(info[2]));
4417 bool result = imp->strictFunction(str, a, b, es);
4418 if (es.throwIfNeeded())
4420 v8SetReturnValueBool(info, result);
4423 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4425 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4426 TestObjV8Internal::strictFunctionMethod(info);
4427 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4430 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4432 if (UNLIKELY(info.Length() < 1)) {
4433 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4436 TestObj* imp = V8TestObject::toNative(info.Holder());
4437 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]);
4438 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1));
4439 imp->variadicStringMethod(head, tail);
4442 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4444 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4445 TestObjV8Internal::variadicStringMethodMethod(info);
4446 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4449 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4451 if (UNLIKELY(info.Length() < 1)) {
4452 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4455 TestObj* imp = V8TestObject::toNative(info.Holder());
4456 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue()));
4457 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1));
4458 imp->variadicDoubleMethod(head, tail);
4461 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4463 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4464 TestObjV8Internal::variadicDoubleMethodMethod(info);
4465 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4468 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4470 if (UNLIKELY(info.Length() < 1)) {
4471 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4474 TestObj* imp = V8TestObject::toNative(info.Holder());
4475 V8TRYCATCH_VOID(Node*, head, V8Node::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4476 Vector<RefPtr<Node> > tail;
4477 for (int i = 1; i < info.Length(); ++i) {
4478 if (!V8Node::HasInstance(info[i], info.GetIsolate(), worldType(info.GetIsolate()))) {
4479 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate());
4482 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i])));
4484 imp->variadicNodeMethod(head, tail);
4487 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4489 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4490 TestObjV8Internal::variadicNodeMethodMethod(info);
4491 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4494 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4496 if (UNLIKELY(info.Length() < 3)) {
4497 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArguments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
4500 TestObj* imp = V8TestObject::toNative(info.Holder());
4501 bool strIsNull = info[0]->IsNull();
4502 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource, info[0]);
4503 String str = strStringResource;
4504 bool lIsNull = info[1]->IsNull();
4505 V8TRYCATCH_VOID(int, l, toInt32(info[1]));
4506 V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::HasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
4507 if (UNLIKELY(info.Length() <= 3)) {
4508 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj);
4511 bool dIsNull = info[3]->IsNull();
4512 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue()));
4513 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj, dIsNull ? 0 : &d);
4516 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4518 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4519 TestObjV8Internal::methodWithNullableArgumentsMethod(info);
4520 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4523 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4525 TestObj* imp = V8TestObject::toNative(info.Holder());
4526 imp->perWorldMethod();
4529 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4531 TestObj* imp = V8TestObject::toNative(info.Holder());
4532 imp->perWorldMethod();
4535 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4537 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4538 TestObjV8Internal::perWorldMethodMethod(info);
4539 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4542 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4544 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4545 TestObjV8Internal::perWorldMethodMethodForMainWorld(info);
4546 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4549 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4551 if (UNLIKELY(info.Length() < 1)) {
4552 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4555 TestObj* imp = V8TestObject::toNative(info.Holder());
4556 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4557 imp->overloadedPerWorldMethod(longArg);
4560 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4562 if (UNLIKELY(info.Length() < 1)) {
4563 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4566 TestObj* imp = V8TestObject::toNative(info.Holder());
4567 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4568 imp->overloadedPerWorldMethod(longArg);
4571 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4573 if (UNLIKELY(info.Length() < 2)) {
4574 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4577 TestObj* imp = V8TestObject::toNative(info.Holder());
4578 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4579 V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4580 imp->overloadedPerWorldMethod(strArg, longArg);
4583 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4585 if (UNLIKELY(info.Length() < 2)) {
4586 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4589 TestObj* imp = V8TestObject::toNative(info.Holder());
4590 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4591 V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4592 imp->overloadedPerWorldMethod(strArg, longArg);
4595 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4597 if (info.Length() == 1) {
4598 overloadedPerWorldMethod1Method(info);
4601 if (info.Length() == 2) {
4602 overloadedPerWorldMethod2Method(info);
4605 if (UNLIKELY(info.Length() < 1)) {
4606 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4609 throwUninformativeAndGenericTypeError(info.GetIsolate());
4612 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4614 if (info.Length() == 1) {
4615 overloadedPerWorldMethod1MethodForMainWorld(info);
4618 if (info.Length() == 2) {
4619 overloadedPerWorldMethod2MethodForMainWorld(info);
4622 if (UNLIKELY(info.Length() < 1)) {
4623 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4626 throwUninformativeAndGenericTypeError(info.GetIsolate());
4629 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4631 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4632 TestObjV8Internal::overloadedPerWorldMethodMethod(info);
4633 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4636 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4638 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4639 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info);
4640 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4643 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4645 if (UNLIKELY(info.Length() < 1)) {
4646 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4649 TestObj* imp = V8TestObject::toNative(info.Holder());
4650 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4651 imp->activityLoggedMethod1(longArg);
4654 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4656 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4657 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4658 if (contextData && contextData->activityLogger()) {
4659 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4660 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", info.Length(), loggerArgs.data(), "Method");
4662 TestObjV8Internal::activityLoggedMethod1Method(info);
4663 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4666 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4668 if (UNLIKELY(info.Length() < 1)) {
4669 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4672 TestObj* imp = V8TestObject::toNative(info.Holder());
4673 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4674 imp->activityLoggedMethod2(longArg);
4677 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4679 if (UNLIKELY(info.Length() < 1)) {
4680 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4683 TestObj* imp = V8TestObject::toNative(info.Holder());
4684 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4685 imp->activityLoggedMethod2(longArg);
4688 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4690 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4691 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4692 if (contextData && contextData->activityLogger()) {
4693 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4694 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", info.Length(), loggerArgs.data(), "Method");
4696 TestObjV8Internal::activityLoggedMethod2Method(info);
4697 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4700 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4702 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4703 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4704 if (contextData && contextData->activityLogger()) {
4705 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4706 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", info.Length(), loggerArgs.data(), "Method");
4708 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info);
4709 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4712 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4714 if (UNLIKELY(info.Length() < 1)) {
4715 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsolatedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4718 TestObj* imp = V8TestObject::toNative(info.Holder());
4719 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4720 imp->activityLoggedInIsolatedWorldMethod(longArg);
4723 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4725 if (UNLIKELY(info.Length() < 1)) {
4726 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsolatedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4729 TestObj* imp = V8TestObject::toNative(info.Holder());
4730 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4731 imp->activityLoggedInIsolatedWorldMethod(longArg);
4734 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4736 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4737 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4738 if (contextData && contextData->activityLogger()) {
4739 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4740 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldMethod", info.Length(), loggerArgs.data(), "Method");
4742 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info);
4743 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4746 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4748 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4749 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(info);
4750 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4753 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4755 if (UNLIKELY(info.Length() < 1)) {
4756 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4759 TestObj* imp = V8TestObject::toNative(info.Holder());
4760 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4761 imp->overloadedActivityLoggedMethod(longArg);
4764 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4766 if (UNLIKELY(info.Length() < 1)) {
4767 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4770 TestObj* imp = V8TestObject::toNative(info.Holder());
4771 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4772 imp->overloadedActivityLoggedMethod(longArg);
4775 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4777 if (UNLIKELY(info.Length() < 2)) {
4778 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4781 TestObj* imp = V8TestObject::toNative(info.Holder());
4782 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4783 V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4784 imp->overloadedActivityLoggedMethod(strArg, longArg);
4787 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4789 if (UNLIKELY(info.Length() < 2)) {
4790 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4793 TestObj* imp = V8TestObject::toNative(info.Holder());
4794 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4795 V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4796 imp->overloadedActivityLoggedMethod(strArg, longArg);
4799 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4801 if (info.Length() == 1) {
4802 overloadedActivityLoggedMethod1Method(info);
4805 if (info.Length() == 2) {
4806 overloadedActivityLoggedMethod2Method(info);
4809 if (UNLIKELY(info.Length() < 1)) {
4810 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4813 throwUninformativeAndGenericTypeError(info.GetIsolate());
4816 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4818 if (info.Length() == 1) {
4819 overloadedActivityLoggedMethod1MethodForMainWorld(info);
4822 if (info.Length() == 2) {
4823 overloadedActivityLoggedMethod2MethodForMainWorld(info);
4826 if (UNLIKELY(info.Length() < 1)) {
4827 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4830 throwUninformativeAndGenericTypeError(info.GetIsolate());
4833 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4835 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4836 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4837 if (contextData && contextData->activityLogger()) {
4838 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4839 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedMethod", info.Length(), loggerArgs.data(), "Method");
4841 TestObjV8Internal::overloadedActivityLoggedMethodMethod(info);
4842 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4845 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4847 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4848 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4849 if (contextData && contextData->activityLogger()) {
4850 Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4851 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedMethod", info.Length(), loggerArgs.data(), "Method");
4853 TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info);
4854 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4857 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4859 TestObj* imp = V8TestObject::toNative(info.Holder());
4860 imp->deprecatedMethod();
4863 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4865 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4866 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method);
4867 TestObjV8Internal::deprecatedMethodMethod(info);
4868 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4871 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4873 TestObj::deprecatedStaticMethod();
4876 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4878 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4879 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMethod);
4880 TestObjV8Internal::deprecatedStaticMethodMethod(info);
4881 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4884 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
4886 if (UNLIKELY(info.Length() < 1)) {
4887 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4890 if (info.Length() <= 0 || !info[0]->IsFunction()) {
4891 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
4894 RefPtr<TestCallback> testCallback = V8TestCallback::create(info[0], getExecutionContext());
4896 RefPtr<TestObj> impl = TestObj::create(testCallback);
4897 v8::Handle<v8::Object> wrapper = info.Holder();
4899 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8TestObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
4900 info.GetReturnValue().Set(wrapper);
4903 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
4905 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
4906 TestObj* collection = V8TestObject::toNative(info.Holder());
4907 RefPtr<Node> element = collection->item(index);
4910 v8SetReturnValueFast(info, element.release(), collection);
4913 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
4915 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
4916 TestObjV8Internal::indexedPropertyGetter(index, info);
4917 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4920 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
4922 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
4924 if (info.Holder()->HasRealNamedCallbackProperty(name))
4926 if (info.Holder()->HasRealNamedProperty(name))
4929 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
4930 TestObj* collection = V8TestObject::toNative(info.Holder());
4931 AtomicString propertyName = toWebCoreAtomicString(name);
4932 String element = collection->namedItem(propertyName);
4933 if (element.isNull())
4935 v8SetReturnValueString(info, element, info.GetIsolate());
4938 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
4940 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
4941 TestObjV8Internal::namedPropertyGetter(name, info);
4942 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4945 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
4947 ExceptionState es(info.GetIsolate());
4948 TestObj* collection = V8TestObject::toNative(info.Holder());
4949 Vector<String> names;
4950 collection->namedPropertyEnumerator(names, es);
4951 if (es.throwIfNeeded())
4953 v8::Handle<v8::Array> v8names = v8::Array::New(names.size());
4954 for (size_t i = 0; i < names.size(); ++i)
4955 v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i], info.GetIsolate()));
4956 v8SetReturnValue(info, v8names);
4959 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
4961 TestObj* collection = V8TestObject::toNative(info.Holder());
4962 AtomicString propertyName = toWebCoreAtomicString(name);
4963 ExceptionState es(info.GetIsolate());
4964 bool result = collection->namedPropertyQuery(propertyName, es);
4965 if (es.throwIfNeeded())
4969 v8SetReturnValueInt(info, v8::None);
4972 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
4974 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
4975 TestObjV8Internal::namedPropertyEnumerator(info);
4976 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4979 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
4981 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
4982 TestObjV8Internal::namedPropertyQuery(name, info);
4983 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4986 } // namespace TestObjV8Internal
4988 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] = {
4989 {"readOnlyLongAttr", TestObjV8Internal::readOnlyLongAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4990 {"readOnlyStringAttr", TestObjV8Internal::readOnlyStringAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4991 {"readOnlyTestObjectAttr", TestObjV8Internal::readOnlyTestObjectAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4992 {"enumAttr", TestObjV8Internal::enumAttrAttributeGetterCallback, TestObjV8Internal::enumAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4993 {"readOnlyEnumAttr", TestObjV8Internal::readOnlyEnumAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4994 {"byteAttr", TestObjV8Internal::byteAttrAttributeGetterCallback, TestObjV8Internal::byteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4995 {"octetAttr", TestObjV8Internal::octetAttrAttributeGetterCallback, TestObjV8Internal::octetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4996 {"shortAttr", TestObjV8Internal::shortAttrAttributeGetterCallback, TestObjV8Internal::shortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4997 {"unsignedShortAttr", TestObjV8Internal::unsignedShortAttrAttributeGetterCallback, TestObjV8Internal::unsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4998 {"longAttr", TestObjV8Internal::longAttrAttributeGetterCallback, TestObjV8Internal::longAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4999 {"longLongAttr", TestObjV8Internal::longLongAttrAttributeGetterCallback, TestObjV8Internal::longLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5000 {"unsignedLongLongAttr", TestObjV8Internal::unsignedLongLongAttrAttributeGetterCallback, TestObjV8Internal::unsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5001 {"stringAttr", TestObjV8Internal::stringAttrAttributeGetterCallback, TestObjV8Internal::stringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5002 {"eventHandlerAttr", TestObjV8Internal::eventHandlerAttrAttributeGetterCallback, TestObjV8Internal::eventHandlerAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5003 {"testObjAttr", TestObjV8Internal::testObjAttrAttributeGetterCallback, TestObjV8Internal::testObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5004 {"XMLObjAttr", TestObjV8Internal::XMLObjAttrAttributeGetterCallback, TestObjV8Internal::XMLObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5005 {"create", TestObjV8Internal::createAttributeGetterCallback, TestObjV8Internal::createAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5006 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGetterCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5007 {"reflectedIntegralAttr", TestObjV8Internal::reflectedIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5008 {"reflectedUnsignedIntegralAttr", TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5009 {"reflectedBooleanAttr", TestObjV8Internal::reflectedBooleanAttrAttributeGetterCallback, TestObjV8Internal::reflectedBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5010 {"reflectedURLAttr", TestObjV8Internal::reflectedURLAttrAttributeGetterCallback, TestObjV8Internal::reflectedURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5011 {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGetterCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5012 {"reflectedCustomIntegralAttr", TestObjV8Internal::reflectedCustomIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5013 {"reflectedCustomBooleanAttr", TestObjV8Internal::reflectedCustomBooleanAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5014 {"reflectedCustomURLAttr", TestObjV8Internal::reflectedCustomURLAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5015 {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttributeGetterCallback, TestObjV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5016 {"attrWithGetterException", TestObjV8Internal::attrWithGetterExceptionAttributeGetterCallback, TestObjV8Internal::attrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5017 {"attrWithSetterException", TestObjV8Internal::attrWithSetterExceptionAttributeGetterCallback, TestObjV8Internal::attrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5018 {"stringAttrWithGetterException", TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5019 {"stringAttrWithSetterException", TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5020 {"customAttr", TestObjV8Internal::customAttrAttributeGetterCallback, TestObjV8Internal::customAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5021 {"withScriptStateAttribute", TestObjV8Internal::withScriptStateAttributeAttributeGetterCallback, TestObjV8Internal::withScriptStateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5022 {"withExecutionContextAttribute", TestObjV8Internal::withExecutionContextAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5023 {"withActiveWindowAndFirstWindowAttribute", TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetterCallback, TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5024 {"withScriptStateAttributeRaises", TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5025 {"withExecutionContextAttributeRaises", TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5026 {"withExecutionContextAndScriptStateAttribute", TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5027 {"withExecutionContextAndScriptStateAttributeRaises", TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5028 {"withExecutionContextAndScriptStateWithSpacesAttribute", TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5029 {"enforcedRangeByteAttr", TestObjV8Internal::enforcedRangeByteAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeByteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5030 {"enforcedRangeOctetAttr", TestObjV8Internal::enforcedRangeOctetAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeOctetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5031 {"enforcedRangeShortAttr", TestObjV8Internal::enforcedRangeShortAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5032 {"enforcedRangeUnsignedShortAttr", TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5033 {"enforcedRangeLongAttr", TestObjV8Internal::enforcedRangeLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5034 {"enforcedRangeUnsignedLongAttr", TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5035 {"enforcedRangeLongLongAttr", TestObjV8Internal::enforcedRangeLongLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5036 {"enforcedRangeUnsignedLongLongAttr", TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5037 #if ENABLE(Condition1)
5038 {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttributeGetterCallback, TestObjV8Internal::conditionalAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5039 #endif // ENABLE(Condition1)
5040 #if ENABLE(Condition1) && ENABLE(Condition2)
5041 {"conditionalAttr2", TestObjV8Internal::conditionalAttr2AttributeGetterCallback, TestObjV8Internal::conditionalAttr2AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5042 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5043 #if ENABLE(Condition1) || ENABLE(Condition2)
5044 {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttributeGetterCallback, TestObjV8Internal::conditionalAttr3AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5045 #endif // ENABLE(Condition1) || ENABLE(Condition2)
5046 #if ENABLE(Condition1)
5047 {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectA::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5048 #endif // ENABLE(Condition1)
5049 #if ENABLE(Condition1) && ENABLE(Condition2)
5050 {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectB::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5051 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5052 #if ENABLE(Condition1) || ENABLE(Condition2)
5053 {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectC::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5054 #endif // ENABLE(Condition1) || ENABLE(Condition2)
5055 {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5056 {"cachedAttribute2", TestObjV8Internal::cachedAttribute2AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5057 {"anyAttribute", TestObjV8Internal::anyAttributeAttributeGetterCallback, TestObjV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5058 {"callbackFunctionAttribute", TestObjV8Internal::callbackFunctionAttributeAttributeGetterCallback, TestObjV8Internal::callbackFunctionAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5059 {"floatArray", TestObjV8Internal::floatArrayAttributeGetterCallback, TestObjV8Internal::floatArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5060 {"doubleArray", TestObjV8Internal::doubleArrayAttributeGetterCallback, TestObjV8Internal::doubleArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5061 {"messagePortArray", TestObjV8Internal::messagePortArrayAttributeGetterCallback, TestObjV8Internal::messagePortArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5062 {"contentDocument", TestObjV8Internal::contentDocumentAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5063 {"mutablePoint", TestObjV8Internal::mutablePointAttributeGetterCallback, TestObjV8Internal::mutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5064 {"immutablePoint", TestObjV8Internal::immutablePointAttributeGetterCallback, TestObjV8Internal::immutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5065 {"strawberry", TestObjV8Internal::strawberryAttributeGetterCallback, TestObjV8Internal::strawberryAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5066 {"strictFloat", TestObjV8Internal::strictFloatAttributeGetterCallback, TestObjV8Internal::strictFloatAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5067 {"replaceableAttribute", TestObjV8Internal::replaceableAttributeAttributeGetterCallback, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5068 {"nullableDoubleAttribute", TestObjV8Internal::nullableDoubleAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5069 {"nullableLongAttribute", TestObjV8Internal::nullableLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5070 {"nullableBooleanAttribute", TestObjV8Internal::nullableBooleanAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5071 {"nullableStringAttribute", TestObjV8Internal::nullableStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5072 {"nullableLongSettableAttribute", TestObjV8Internal::nullableLongSettableAttributeAttributeGetterCallback, TestObjV8Internal::nullableLongSettableAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5073 {"nullableStringValue", TestObjV8Internal::nullableStringValueAttributeGetterCallback, TestObjV8Internal::nullableStringValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5074 {"perWorldReadOnlyAttribute", TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterCallback, 0, TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5075 {"perWorldAttribute", TestObjV8Internal::perWorldAttributeAttributeGetterCallback, TestObjV8Internal::perWorldAttributeAttributeSetterCallback, TestObjV8Internal::perWorldAttributeAttributeGetterCallbackForMainWorld, TestObjV8Internal::perWorldAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5076 {"activityLoggedAttr1", TestObjV8Internal::activityLoggedAttr1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5077 {"activityLoggedAttr2", TestObjV8Internal::activityLoggedAttr2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttr2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttr2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttr2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5078 {"activityLoggedInIsolatedWorldsAttr", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5079 {"activityLoggedAttrSetter1", TestObjV8Internal::activityLoggedAttrSetter1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5080 {"activityLoggedAttrSetter2", TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5081 {"activityLoggedInIsolatedWorldsAttrSetter", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5082 {"activityLoggedAttrGetter1", TestObjV8Internal::activityLoggedAttrGetter1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5083 {"activityLoggedAttrGetter2", TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5084 {"activityLoggedInIsolatedWorldsAttrGetter", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5085 {"deprecatedReadonlyAttr", TestObjV8Internal::deprecatedReadonlyAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5086 {"deprecatedAttr", TestObjV8Internal::deprecatedAttrAttributeGetterCallback, TestObjV8Internal::deprecatedAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5087 {"location", TestObjV8Internal::locationAttributeGetterCallback, TestObjV8Internal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5088 {"locationWithException", TestObjV8Internal::locationWithExceptionAttributeGetterCallback, TestObjV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5091 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
5092 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0},
5093 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0},
5094 {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0},
5095 {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCallback, 0, 1},
5096 {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethodCallback, 0, 1},
5097 {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0, 1},
5098 {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1},
5099 {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1},
5100 {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback, 0, 0},
5101 {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0},
5102 {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallback, 0, 3},
5103 {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2},
5104 {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback, 0, 2},
5105 {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback, 0, 0},
5106 {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback, 0, 0},
5107 {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExceptionMethodCallback, 0, 0},
5108 {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExceptionMethodCallback, 0, 0},
5109 {"withExecutionContext", TestObjV8Internal::withExecutionContextMethodCallback, 0, 0},
5110 {"withExecutionContextAndScriptState", TestObjV8Internal::withExecutionContextAndScriptStateMethodCallback, 0, 0},
5111 {"withExecutionContextAndScriptStateObjException", TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0},
5112 {"withExecutionContextAndScriptStateWithSpaces", TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethodCallback, 0, 0},
5113 {"withActiveWindowAndFirstWindow", TestObjV8Internal::withActiveWindowAndFirstWindowMethodCallback, 0, 0},
5114 {"methodWithOptionalArg", TestObjV8Internal::methodWithOptionalArgMethodCallback, 0, 0},
5115 {"methodWithNonOptionalArgAndOptionalArg", TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethodCallback, 0, 1},
5116 {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1},
5117 {"methodWithOptionalString", TestObjV8Internal::methodWithOptionalStringMethodCallback, 0, 0},
5118 {"methodWithOptionalStringIsUndefined", TestObjV8Internal::methodWithOptionalStringIsUndefinedMethodCallback, 0, 0},
5119 {"methodWithOptionalStringIsNullString", TestObjV8Internal::methodWithOptionalStringIsNullStringMethodCallback, 0, 0},
5120 {"methodWithCallbackArg", TestObjV8Internal::methodWithCallbackArgMethodCallback, 0, 1},
5121 {"methodWithNonCallbackArgAndCallbackArg", TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethodCallback, 0, 2},
5122 {"methodWithCallbackAndOptionalArg", TestObjV8Internal::methodWithCallbackAndOptionalArgMethodCallback, 0, 0},
5123 {"methodWithNullableCallbackArg", TestObjV8Internal::methodWithNullableCallbackArgMethodCallback, 0, 1},
5124 {"methodWithEnforceRangeInt8", TestObjV8Internal::methodWithEnforceRangeInt8MethodCallback, 0, 1},
5125 {"methodWithEnforceRangeUInt8", TestObjV8Internal::methodWithEnforceRangeUInt8MethodCallback, 0, 1},
5126 {"methodWithEnforceRangeInt16", TestObjV8Internal::methodWithEnforceRangeInt16MethodCallback, 0, 1},
5127 {"methodWithEnforceRangeUInt16", TestObjV8Internal::methodWithEnforceRangeUInt16MethodCallback, 0, 1},
5128 {"methodWithEnforceRangeInt32", TestObjV8Internal::methodWithEnforceRangeInt32MethodCallback, 0, 1},
5129 {"methodWithEnforceRangeUInt32", TestObjV8Internal::methodWithEnforceRangeUInt32MethodCallback, 0, 1},
5130 {"methodWithEnforceRangeInt64", TestObjV8Internal::methodWithEnforceRangeInt64MethodCallback, 0, 1},
5131 {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUInt64MethodCallback, 0, 1},
5132 #if ENABLE(Condition1)
5133 {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback, 0, 0},
5134 #endif // ENABLE(Condition1)
5135 #if ENABLE(Condition1) && ENABLE(Condition2)
5136 {"conditionalMethod2", TestObjV8Internal::conditionalMethod2MethodCallback, 0, 0},
5137 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5138 #if ENABLE(Condition1) || ENABLE(Condition2)
5139 {"conditionalMethod3", TestObjV8Internal::conditionalMethod3MethodCallback, 0, 0},
5140 #endif // ENABLE(Condition1) || ENABLE(Condition2)
5141 {"callbackFunctionReturnValue", TestObjV8Internal::callbackFunctionReturnValueMethodCallback, 0, 0},
5142 {"callbackFunctionArgument", TestObjV8Internal::callbackFunctionArgumentMethodCallback, 0, 1},
5143 {"overloadedMethod", TestObjV8Internal::overloadedMethodMethodCallback, 0, 2},
5144 {"classMethodWithClamp", TestObjV8Internal::classMethodWithClampMethodCallback, 0, 2},
5145 {"methodWithUnsignedLongSequence", TestObjV8Internal::methodWithUnsignedLongSequenceMethodCallback, 0, 1},
5146 {"stringArrayFunction", TestObjV8Internal::stringArrayFunctionMethodCallback, 0, 1},
5147 {"getSVGDocument", TestObjV8Internal::getSVGDocumentMethodCallback, 0, 0},
5148 {"mutablePointFunction", TestObjV8Internal::mutablePointFunctionMethodCallback, 0, 0},
5149 {"immutablePointFunction", TestObjV8Internal::immutablePointFunctionMethodCallback, 0, 0},
5150 {"strictSVGPointMethod", TestObjV8Internal::strictSVGPointMethodMethodCallback, 0, 2},
5151 {"orange", TestObjV8Internal::orangeMethodCallback, 0, 0},
5152 {"strictFunction", TestObjV8Internal::strictFunctionMethodCallback, 0, 3},
5153 {"variadicStringMethod", TestObjV8Internal::variadicStringMethodMethodCallback, 0, 2},
5154 {"variadicDoubleMethod", TestObjV8Internal::variadicDoubleMethodMethodCallback, 0, 2},
5155 {"methodWithNullableArguments", TestObjV8Internal::methodWithNullableArgumentsMethodCallback, 0, 3},
5156 {"perWorldMethod", TestObjV8Internal::perWorldMethodMethodCallback, TestObjV8Internal::perWorldMethodMethodCallbackForMainWorld, 0},
5157 {"overloadedPerWorldMethod", TestObjV8Internal::overloadedPerWorldMethodMethodCallback, TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorld, 1},
5158 {"activityLoggedMethod1", TestObjV8Internal::activityLoggedMethod1MethodCallback, 0, 1},
5159 {"activityLoggedMethod2", TestObjV8Internal::activityLoggedMethod2MethodCallback, TestObjV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1},
5160 {"activityLoggedInIsolatedWorldMethod", TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodCallback, TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld, 1},
5161 {"overloadedActivityLoggedMethod", TestObjV8Internal::overloadedActivityLoggedMethodMethodCallback, TestObjV8Internal::overloadedActivityLoggedMethodMethodCallbackForMainWorld, 1},
5162 {"deprecatedMethod", TestObjV8Internal::deprecatedMethodMethodCallback, 0, 0},
5165 void V8TestObject::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5167 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
5168 if (!info.IsConstructCall()) {
5169 throwTypeError(ExceptionMessages::failedToConstruct("TestObject", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate());
5173 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
5174 info.GetReturnValue().Set(info.Holder());
5178 TestObjV8Internal::constructor(info);
5181 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)
5183 desc->ReadOnlyPrototype();
5185 v8::Local<v8::Signature> defaultSignature;
5186 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestObject", V8EventTarget::GetTemplate(isolate, currentWorldType), V8TestObject::internalFieldCount,
5187 V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes),
5188 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods),
5189 isolate, currentWorldType);
5190 UNUSED_PARAM(defaultSignature);
5191 desc->SetCallHandler(V8TestObject::constructorCallback);
5193 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
5194 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
5195 UNUSED_PARAM(instance);
5196 UNUSED_PARAM(proto);
5197 if (RuntimeEnabledFeatures::featureNameEnabled()) {
5198 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
5199 {"enabledAtRuntimeAttr", TestObjV8Internal::enabledAtRuntimeAttrAttributeGetterCallback, TestObjV8Internal::enabledAtRuntimeAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
5200 V8DOMConfiguration::installAttribute(instance, proto, attributeConfiguration, isolate, currentWorldType);
5202 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = {
5203 {"DEPRECATED_CONSTANT", 1},
5205 V8DOMConfiguration::installConstants(desc, proto, V8TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate);
5206 COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TheValueOfTestObj_DEPRECATED_CONSTANTDoesntMatchWithImplementation);
5207 desc->InstanceTemplate()->SetIndexedPropertyHandler(TestObjV8Internal::indexedPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObj>);
5208 desc->InstanceTemplate()->SetNamedPropertyHandler(TestObjV8Internal::namedPropertyGetterCallback, 0, TestObjV8Internal::namedPropertyQueryCallback, 0, TestObjV8Internal::namedPropertyEnumeratorCallback);
5210 // Custom Signature 'voidMethodWithArgs'
5211 const int voidMethodWithArgsArgc = 3;
5212 v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5213 v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
5214 proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMethodWithArgsSignature, 3));
5216 // Custom Signature 'longMethodWithArgs'
5217 const int longMethodWithArgsArgc = 3;
5218 v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5219 v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(desc, longMethodWithArgsArgc, longMethodWithArgsArgv);
5220 proto->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMethodWithArgsSignature, 3));
5222 // Custom Signature 'objMethodWithArgs'
5223 const int objMethodWithArgsArgc = 3;
5224 v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5225 v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
5226 proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMethodWithArgsSignature, 3));
5228 // Custom Signature 'methodThatRequiresAllArgsAndThrows'
5229 const int methodThatRequiresAllArgsAndThrowsArgc = 2;
5230 v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5231 v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
5232 proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature, 2));
5233 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackAndOptionalArg"), v8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5234 desc->Set(v8::String::NewSymbol("staticMethodWithCallbackArg"), v8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5235 desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5236 desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5237 desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5238 #if ENABLE(Condition1)
5239 desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5240 #endif // ENABLE(Condition1)
5241 if (RuntimeEnabledFeatures::featureNameEnabled())
5242 proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSignature, 1));
5244 // Custom Signature 'domStringListFunction'
5245 const int domStringListFunctionArgc = 1;
5246 v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::wrapperTypeInfo, currentWorldType) };
5247 v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::New(desc, domStringListFunctionArgc, domStringListFunctionArgv);
5248 proto->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTemplate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(), domStringListFunctionSignature, 1));
5250 // Custom Signature 'convert1'
5251 const int convert1Argc = 1;
5252 v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) };
5253 v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
5254 proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1));
5256 // Custom Signature 'convert2'
5257 const int convert2Argc = 1;
5258 v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) };
5259 v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
5260 proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1));
5262 // Custom Signature 'svgPointMethod'
5263 const int svgPointMethodArgc = 2;
5264 v8::Handle<v8::FunctionTemplate> svgPointMethodArgv[svgPointMethodArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8SVGPoint::wrapperTypeInfo, currentWorldType), v8::Handle<v8::FunctionTemplate>() };
5265 v8::Handle<v8::Signature> svgPointMethodSignature = v8::Signature::New(desc, svgPointMethodArgc, svgPointMethodArgv);
5266 proto->Set(v8::String::NewSymbol("svgPointMethod"), v8::FunctionTemplate::New(TestObjV8Internal::svgPointMethodMethodCallback, v8Undefined(), svgPointMethodSignature, 2));
5268 // Custom Signature 'variadicNodeMethod'
5269 const int variadicNodeMethodArgc = 2;
5270 v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, currentWorldType), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, currentWorldType) };
5271 v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(desc, variadicNodeMethodArgc, variadicNodeMethodArgv);
5272 proto->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variadicNodeMethodSignature, 2));
5273 desc->Set(v8::String::NewSymbol("deprecatedStaticMethod"), v8::FunctionTemplate::New(TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5274 desc->SetNativeDataProperty(v8::String::NewSymbol("staticReadOnlyLongAttr"), TestObjV8Internal::staticReadOnlyLongAttrAttributeGetterCallback, 0, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5275 desc->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttr"), TestObjV8Internal::staticStringAttrAttributeGetterCallback, TestObjV8Internal::staticStringAttrAttributeSetterCallback, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5276 desc->SetNativeDataProperty(v8::String::NewSymbol("TestSubObj"), TestObjV8Internal::TestObjConstructorGetter, 0, v8::External::New(const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5277 desc->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticReadOnlyAttr"), TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5278 desc->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticAttr"), TestObjV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjV8Internal::deprecatedStaticAttrAttributeSetterCallback, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5280 // Custom toString template
5281 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
5285 v8::Handle<v8::FunctionTemplate> V8TestObject::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
5287 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
5288 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
5289 if (result != data->templateMap(currentWorldType).end())
5290 return result->value.newLocal(isolate);
5292 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
5293 v8::HandleScope handleScope(isolate);
5294 v8::Handle<v8::FunctionTemplate> templ =
5295 ConfigureV8TestObjectTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
5296 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
5297 return handleScope.Close(templ);
5300 bool V8TestObject::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
5302 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
5305 bool V8TestObject::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
5307 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
5308 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
5309 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
5312 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> instance, TestObj* impl, v8::Isolate* isolate)
5314 v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype());
5315 if (ContextFeatures::featureNameEnabled(impl->document())) {
5316 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
5317 {"enabledPerContextAttr", TestObjV8Internal::enabledPerContextAttrAttributeGetterCallback, TestObjV8Internal::enabledPerContextAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
5318 V8DOMConfiguration::installAttribute(instance, proto, attributeConfiguration, isolate);
5322 void V8TestObject::installPerContextEnabledPrototypeProperties(v8::Handle<v8::Object> proto, v8::Isolate* isolate)
5324 UNUSED_PARAM(proto);
5325 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(isolate, worldType(isolate)));
5326 UNUSED_PARAM(defaultSignature);
5328 ExecutionContext* context = toExecutionContext(proto->CreationContext());
5329 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context)))
5330 proto->Set(v8::String::NewSymbol("enabledPerContextMethod"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction());
5333 EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object)
5335 return toNative(object);
5338 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
5341 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate));
5342 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
5343 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
5344 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
5345 // the same object de-ref functions, though, so use that as the basis of the check.
5346 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
5349 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
5350 if (UNLIKELY(wrapper.IsEmpty()))
5353 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
5354 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
5358 void V8TestObject::derefObject(void* object)
5360 fromInternalPointer(object)->deref();
5363 } // namespace WebCore