1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 6 7 #include "config.h" 8 #include "V8TestObject.h" 9 10 #include "HTMLNames.h" 11 #include "bindings/core/v8/V8HTMLCollection.h" 12 #include "bindings/tests/v8/V8Attr.h" 13 #include "bindings/tests/v8/V8Document.h" 14 #include "bindings/tests/v8/V8DocumentFragment.h" 15 #include "bindings/tests/v8/V8DocumentType.h" 16 #include "bindings/tests/v8/V8Element.h" 17 #include "bindings/tests/v8/V8EventTarget.h" 18 #include "bindings/tests/v8/V8HTMLElement.h" 19 #include "bindings/tests/v8/V8Node.h" 20 #include "bindings/tests/v8/V8NodeFilter.h" 21 #include "bindings/tests/v8/V8ShadowRoot.h" 22 #include "bindings/tests/v8/V8TestCallbackInterface.h" 23 #include "bindings/tests/v8/V8TestInterface.h" 24 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" 25 #include "bindings/tests/v8/V8TestInterfaceGarbageCollected.h" 26 #include "bindings/tests/v8/V8TestInterfaceWillBeGarbageCollected.h" 27 #include "bindings/tests/v8/V8TestNode.h" 28 #include "bindings/tests/v8/V8TestObject.h" 29 #include "bindings/tests/v8/V8Window.h" 30 #include "bindings/tests/v8/V8XPathNSResolver.h" 31 #include "bindings/v8/BindingSecurity.h" 32 #include "bindings/v8/Dictionary.h" 33 #include "bindings/v8/ExceptionState.h" 34 #include "bindings/v8/ScriptCallStackFactory.h" 35 #include "bindings/v8/ScriptPromise.h" 36 #include "bindings/v8/ScriptState.h" 37 #include "bindings/v8/ScriptValue.h" 38 #include "bindings/v8/SerializedScriptValue.h" 39 #include "bindings/v8/V8AbstractEventListener.h" 40 #include "bindings/v8/V8DOMActivityLogger.h" 41 #include "bindings/v8/V8DOMConfiguration.h" 42 #include "bindings/v8/V8EventListenerList.h" 43 #include "bindings/v8/V8HiddenValue.h" 44 #include "bindings/v8/V8ObjectConstructor.h" 45 #include "bindings/v8/custom/V8ArrayBufferCustom.h" 46 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h" 47 #include "bindings/v8/custom/V8Float32ArrayCustom.h" 48 #include "bindings/v8/custom/V8Int32ArrayCustom.h" 49 #include "bindings/v8/custom/V8Uint8ArrayCustom.h" 50 #include "core/css/MediaQueryListListener.h" 51 #include "core/dom/ClassCollection.h" 52 #include "core/dom/ContextFeatures.h" 53 #include "core/dom/Document.h" 54 #include "core/dom/TagCollection.h" 55 #include "core/dom/custom/CustomElementCallbackDispatcher.h" 56 #include "core/frame/LocalDOMWindow.h" 57 #include "core/frame/UseCounter.h" 58 #include "core/html/HTMLCollection.h" 59 #include "core/html/HTMLFormControlsCollection.h" 60 #include "core/html/HTMLTableRowsCollection.h" 61 #include "core/inspector/ScriptArguments.h" 62 #include "platform/RuntimeEnabledFeatures.h" 63 #include "platform/TraceEvent.h" 64 #include "wtf/GetPtr.h" 65 #include "wtf/RefPtr.h" 66 67 namespace WebCore { 68 69 static void initializeScriptWrappableForInterface(TestObject* object) 70 { 71 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 72 ScriptWrappable::fromObject(object)->setTypeInfo(&V8TestObject::wrapperTypeInfo); 73 else 74 ASSERT_NOT_REACHED(); 75 } 76 77 } // namespace WebCore 78 79 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObject* object) 80 { 81 WebCore::initializeScriptWrappableForInterface(object); 82 } 83 84 namespace WebCore { 85 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::domTemplate, V8TestObject::derefObject, 0, 0, 0, V8TestObject::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, RefCountedObject }; 86 87 namespace TestObjectV8Internal { 88 89 template <typename T> void V8_USE(T) { } 90 91 static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 92 { 93 v8::Handle<v8::Object> holder = info.Holder(); 94 TestObject* impl = V8TestObject::toNative(holder); 95 v8SetReturnValueString(info, impl->readonlyStringAttribute(), info.GetIsolate()); 96 } 97 98 static void readonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 99 { 100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 101 TestObjectV8Internal::readonlyStringAttributeAttributeGetter(info); 102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 103 } 104 105 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 106 { 107 v8::Handle<v8::Object> holder = info.Holder(); 108 TestObject* impl = V8TestObject::toNative(holder); 109 RefPtr<TestInterfaceEmpty> result(impl->readonlyTestInterfaceEmptyAttribute()); 110 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEmpty>(info.GetReturnValue(), result.get())) 111 return; 112 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate()); 113 if (!wrapper.IsEmpty()) { 114 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "readonlyTestInterfaceEmptyAttribute"), wrapper); 115 v8SetReturnValue(info, wrapper); 116 } 117 } 118 119 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 120 { 121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 122 TestObjectV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGetter(info); 123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 124 } 125 126 static void readonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 127 { 128 v8::Handle<v8::Object> holder = info.Holder(); 129 TestObject* impl = V8TestObject::toNative(holder); 130 v8SetReturnValueInt(info, impl->readonlyLongAttribute()); 131 } 132 133 static void readonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 134 { 135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 136 TestObjectV8Internal::readonlyLongAttributeAttributeGetter(info); 137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 138 } 139 140 static void dateAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 141 { 142 v8::Handle<v8::Object> holder = info.Holder(); 143 TestObject* impl = V8TestObject::toNative(holder); 144 v8SetReturnValue(info, v8DateOrNaN(impl->dateAttribute(), info.GetIsolate())); 145 } 146 147 static void dateAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 148 { 149 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 150 TestObjectV8Internal::dateAttributeAttributeGetter(info); 151 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 152 } 153 154 static void dateAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 155 { 156 v8::Handle<v8::Object> holder = info.Holder(); 157 TestObject* impl = V8TestObject::toNative(holder); 158 TONATIVE_VOID(double, cppValue, toCoreDate(v8Value)); 159 impl->setDateAttribute(cppValue); 160 } 161 162 static void dateAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 163 { 164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 165 TestObjectV8Internal::dateAttributeAttributeSetter(v8Value, info); 166 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 167 } 168 169 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 170 { 171 v8::Handle<v8::Object> holder = info.Holder(); 172 TestObject* impl = V8TestObject::toNative(holder); 173 v8SetReturnValueString(info, impl->stringAttribute(), info.GetIsolate()); 174 } 175 176 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 177 { 178 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 179 TestObjectV8Internal::stringAttributeAttributeGetter(info); 180 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 181 } 182 183 static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 184 { 185 v8::Handle<v8::Object> holder = info.Holder(); 186 TestObject* impl = V8TestObject::toNative(holder); 187 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 188 impl->setStringAttribute(cppValue); 189 } 190 191 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 192 { 193 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 194 TestObjectV8Internal::stringAttributeAttributeSetter(v8Value, info); 195 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 196 } 197 198 static void byteStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 199 { 200 v8::Handle<v8::Object> holder = info.Holder(); 201 TestObject* impl = V8TestObject::toNative(holder); 202 v8SetReturnValueString(info, impl->byteStringAttribute(), info.GetIsolate()); 203 } 204 205 static void byteStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 206 { 207 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 208 TestObjectV8Internal::byteStringAttributeAttributeGetter(info); 209 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 210 } 211 212 static void byteStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 213 { 214 v8::Handle<v8::Object> holder = info.Holder(); 215 ExceptionState exceptionState(ExceptionState::SetterContext, "byteStringAttribute", "TestObject", holder, info.GetIsolate()); 216 TestObject* impl = V8TestObject::toNative(holder); 217 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toByteString(v8Value, exceptionState), exceptionState); 218 impl->setByteStringAttribute(cppValue); 219 } 220 221 static void byteStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 222 { 223 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 224 TestObjectV8Internal::byteStringAttributeAttributeSetter(v8Value, info); 225 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 226 } 227 228 static void scalarValueStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 229 { 230 v8::Handle<v8::Object> holder = info.Holder(); 231 TestObject* impl = V8TestObject::toNative(holder); 232 v8SetReturnValueString(info, impl->scalarValueStringAttribute(), info.GetIsolate()); 233 } 234 235 static void scalarValueStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 236 { 237 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 238 TestObjectV8Internal::scalarValueStringAttributeAttributeGetter(info); 239 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 240 } 241 242 static void scalarValueStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 243 { 244 v8::Handle<v8::Object> holder = info.Holder(); 245 ExceptionState exceptionState(ExceptionState::SetterContext, "scalarValueStringAttribute", "TestObject", holder, info.GetIsolate()); 246 TestObject* impl = V8TestObject::toNative(holder); 247 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toScalarValueString(v8Value, exceptionState), exceptionState); 248 impl->setScalarValueStringAttribute(cppValue); 249 } 250 251 static void scalarValueStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 252 { 253 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 254 TestObjectV8Internal::scalarValueStringAttributeAttributeSetter(v8Value, info); 255 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 256 } 257 258 static void domTimeStampAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 259 { 260 v8::Handle<v8::Object> holder = info.Holder(); 261 TestObject* impl = V8TestObject::toNative(holder); 262 v8SetReturnValue(info, static_cast<double>(impl->domTimeStampAttribute())); 263 } 264 265 static void domTimeStampAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 266 { 267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 268 TestObjectV8Internal::domTimeStampAttributeAttributeGetter(info); 269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 270 } 271 272 static void domTimeStampAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 273 { 274 v8::Handle<v8::Object> holder = info.Holder(); 275 ExceptionState exceptionState(ExceptionState::SetterContext, "domTimeStampAttribute", "TestObject", holder, info.GetIsolate()); 276 TestObject* impl = V8TestObject::toNative(holder); 277 TONATIVE_VOID_EXCEPTIONSTATE(unsigned long long, cppValue, toUInt64(v8Value, exceptionState), exceptionState); 278 impl->setDomTimeStampAttribute(cppValue); 279 } 280 281 static void domTimeStampAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 282 { 283 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 284 TestObjectV8Internal::domTimeStampAttributeAttributeSetter(v8Value, info); 285 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 286 } 287 288 static void booleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 289 { 290 v8::Handle<v8::Object> holder = info.Holder(); 291 TestObject* impl = V8TestObject::toNative(holder); 292 v8SetReturnValueBool(info, impl->booleanAttribute()); 293 } 294 295 static void booleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 296 { 297 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 298 TestObjectV8Internal::booleanAttributeAttributeGetter(info); 299 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 300 } 301 302 static void booleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 303 { 304 v8::Handle<v8::Object> holder = info.Holder(); 305 TestObject* impl = V8TestObject::toNative(holder); 306 TONATIVE_VOID(bool, cppValue, v8Value->BooleanValue()); 307 impl->setBooleanAttribute(cppValue); 308 } 309 310 static void booleanAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 311 { 312 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 313 TestObjectV8Internal::booleanAttributeAttributeSetter(v8Value, info); 314 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 315 } 316 317 static void byteAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 318 { 319 v8::Handle<v8::Object> holder = info.Holder(); 320 TestObject* impl = V8TestObject::toNative(holder); 321 v8SetReturnValueInt(info, impl->byteAttribute()); 322 } 323 324 static void byteAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 325 { 326 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 327 TestObjectV8Internal::byteAttributeAttributeGetter(info); 328 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 329 } 330 331 static void byteAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 332 { 333 v8::Handle<v8::Object> holder = info.Holder(); 334 ExceptionState exceptionState(ExceptionState::SetterContext, "byteAttribute", "TestObject", holder, info.GetIsolate()); 335 TestObject* impl = V8TestObject::toNative(holder); 336 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt8(v8Value, exceptionState), exceptionState); 337 impl->setByteAttribute(cppValue); 338 } 339 340 static void byteAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 341 { 342 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 343 TestObjectV8Internal::byteAttributeAttributeSetter(v8Value, info); 344 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 345 } 346 347 static void doubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 348 { 349 v8::Handle<v8::Object> holder = info.Holder(); 350 TestObject* impl = V8TestObject::toNative(holder); 351 v8SetReturnValue(info, impl->doubleAttribute()); 352 } 353 354 static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 355 { 356 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 357 TestObjectV8Internal::doubleAttributeAttributeGetter(info); 358 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 359 } 360 361 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 362 { 363 v8::Handle<v8::Object> holder = info.Holder(); 364 TestObject* impl = V8TestObject::toNative(holder); 365 TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue())); 366 impl->setDoubleAttribute(cppValue); 367 } 368 369 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 370 { 371 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 372 TestObjectV8Internal::doubleAttributeAttributeSetter(v8Value, info); 373 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 374 } 375 376 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 377 { 378 v8::Handle<v8::Object> holder = info.Holder(); 379 TestObject* impl = V8TestObject::toNative(holder); 380 v8SetReturnValue(info, impl->floatAttribute()); 381 } 382 383 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 384 { 385 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 386 TestObjectV8Internal::floatAttributeAttributeGetter(info); 387 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 388 } 389 390 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 391 { 392 v8::Handle<v8::Object> holder = info.Holder(); 393 TestObject* impl = V8TestObject::toNative(holder); 394 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); 395 impl->setFloatAttribute(cppValue); 396 } 397 398 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 399 { 400 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 401 TestObjectV8Internal::floatAttributeAttributeSetter(v8Value, info); 402 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 403 } 404 405 static void longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 406 { 407 v8::Handle<v8::Object> holder = info.Holder(); 408 TestObject* impl = V8TestObject::toNative(holder); 409 v8SetReturnValueInt(info, impl->longAttribute()); 410 } 411 412 static void longAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 413 { 414 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 415 TestObjectV8Internal::longAttributeAttributeGetter(info); 416 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 417 } 418 419 static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 420 { 421 v8::Handle<v8::Object> holder = info.Holder(); 422 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute", "TestObject", holder, info.GetIsolate()); 423 TestObject* impl = V8TestObject::toNative(holder); 424 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 425 impl->setLongAttribute(cppValue); 426 } 427 428 static void longAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 429 { 430 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 431 TestObjectV8Internal::longAttributeAttributeSetter(v8Value, info); 432 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 433 } 434 435 static void longLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 436 { 437 v8::Handle<v8::Object> holder = info.Holder(); 438 TestObject* impl = V8TestObject::toNative(holder); 439 v8SetReturnValue(info, static_cast<double>(impl->longLongAttribute())); 440 } 441 442 static void longLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 443 { 444 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 445 TestObjectV8Internal::longLongAttributeAttributeGetter(info); 446 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 447 } 448 449 static void longLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 450 { 451 v8::Handle<v8::Object> holder = info.Holder(); 452 ExceptionState exceptionState(ExceptionState::SetterContext, "longLongAttribute", "TestObject", holder, info.GetIsolate()); 453 TestObject* impl = V8TestObject::toNative(holder); 454 TONATIVE_VOID_EXCEPTIONSTATE(long long, cppValue, toInt64(v8Value, exceptionState), exceptionState); 455 impl->setLongLongAttribute(cppValue); 456 } 457 458 static void longLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 459 { 460 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 461 TestObjectV8Internal::longLongAttributeAttributeSetter(v8Value, info); 462 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 463 } 464 465 static void octetAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 466 { 467 v8::Handle<v8::Object> holder = info.Holder(); 468 TestObject* impl = V8TestObject::toNative(holder); 469 v8SetReturnValueUnsigned(info, impl->octetAttribute()); 470 } 471 472 static void octetAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 473 { 474 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 475 TestObjectV8Internal::octetAttributeAttributeGetter(info); 476 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 477 } 478 479 static void octetAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 480 { 481 v8::Handle<v8::Object> holder = info.Holder(); 482 ExceptionState exceptionState(ExceptionState::SetterContext, "octetAttribute", "TestObject", holder, info.GetIsolate()); 483 TestObject* impl = V8TestObject::toNative(holder); 484 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt8(v8Value, exceptionState), exceptionState); 485 impl->setOctetAttribute(cppValue); 486 } 487 488 static void octetAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 489 { 490 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 491 TestObjectV8Internal::octetAttributeAttributeSetter(v8Value, info); 492 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 493 } 494 495 static void shortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 496 { 497 v8::Handle<v8::Object> holder = info.Holder(); 498 TestObject* impl = V8TestObject::toNative(holder); 499 v8SetReturnValueInt(info, impl->shortAttribute()); 500 } 501 502 static void shortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 503 { 504 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 505 TestObjectV8Internal::shortAttributeAttributeGetter(info); 506 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 507 } 508 509 static void shortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 510 { 511 v8::Handle<v8::Object> holder = info.Holder(); 512 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute", "TestObject", holder, info.GetIsolate()); 513 TestObject* impl = V8TestObject::toNative(holder); 514 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState); 515 impl->setShortAttribute(cppValue); 516 } 517 518 static void shortAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 519 { 520 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 521 TestObjectV8Internal::shortAttributeAttributeSetter(v8Value, info); 522 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 523 } 524 525 static void unrestrictedDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 526 { 527 v8::Handle<v8::Object> holder = info.Holder(); 528 TestObject* impl = V8TestObject::toNative(holder); 529 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); 530 } 531 532 static void unrestrictedDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 533 { 534 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 535 TestObjectV8Internal::unrestrictedDoubleAttributeAttributeGetter(info); 536 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 537 } 538 539 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 540 { 541 v8::Handle<v8::Object> holder = info.Holder(); 542 TestObject* impl = V8TestObject::toNative(holder); 543 TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue())); 544 impl->setUnrestrictedDoubleAttribute(cppValue); 545 } 546 547 static void unrestrictedDoubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 548 { 549 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 550 TestObjectV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, info); 551 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 552 } 553 554 static void unrestrictedFloatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 555 { 556 v8::Handle<v8::Object> holder = info.Holder(); 557 TestObject* impl = V8TestObject::toNative(holder); 558 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); 559 } 560 561 static void unrestrictedFloatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 562 { 563 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 564 TestObjectV8Internal::unrestrictedFloatAttributeAttributeGetter(info); 565 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 566 } 567 568 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 569 { 570 v8::Handle<v8::Object> holder = info.Holder(); 571 TestObject* impl = V8TestObject::toNative(holder); 572 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); 573 impl->setUnrestrictedFloatAttribute(cppValue); 574 } 575 576 static void unrestrictedFloatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 577 { 578 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 579 TestObjectV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, info); 580 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 581 } 582 583 static void unsignedLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 584 { 585 v8::Handle<v8::Object> holder = info.Holder(); 586 TestObject* impl = V8TestObject::toNative(holder); 587 v8SetReturnValueUnsigned(info, impl->unsignedLongAttribute()); 588 } 589 590 static void unsignedLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 591 { 592 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 593 TestObjectV8Internal::unsignedLongAttributeAttributeGetter(info); 594 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 595 } 596 597 static void unsignedLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 598 { 599 v8::Handle<v8::Object> holder = info.Holder(); 600 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongAttribute", "TestObject", holder, info.GetIsolate()); 601 TestObject* impl = V8TestObject::toNative(holder); 602 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt32(v8Value, exceptionState), exceptionState); 603 impl->setUnsignedLongAttribute(cppValue); 604 } 605 606 static void unsignedLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 607 { 608 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 609 TestObjectV8Internal::unsignedLongAttributeAttributeSetter(v8Value, info); 610 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 611 } 612 613 static void unsignedLongLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 614 { 615 v8::Handle<v8::Object> holder = info.Holder(); 616 TestObject* impl = V8TestObject::toNative(holder); 617 v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongAttribute())); 618 } 619 620 static void unsignedLongLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 621 { 622 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 623 TestObjectV8Internal::unsignedLongLongAttributeAttributeGetter(info); 624 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 625 } 626 627 static void unsignedLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 628 { 629 v8::Handle<v8::Object> holder = info.Holder(); 630 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLongAttribute", "TestObject", holder, info.GetIsolate()); 631 TestObject* impl = V8TestObject::toNative(holder); 632 TONATIVE_VOID_EXCEPTIONSTATE(unsigned long long, cppValue, toUInt64(v8Value, exceptionState), exceptionState); 633 impl->setUnsignedLongLongAttribute(cppValue); 634 } 635 636 static void unsignedLongLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 637 { 638 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 639 TestObjectV8Internal::unsignedLongLongAttributeAttributeSetter(v8Value, info); 640 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 641 } 642 643 static void unsignedShortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 644 { 645 v8::Handle<v8::Object> holder = info.Holder(); 646 TestObject* impl = V8TestObject::toNative(holder); 647 v8SetReturnValueUnsigned(info, impl->unsignedShortAttribute()); 648 } 649 650 static void unsignedShortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 651 { 652 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 653 TestObjectV8Internal::unsignedShortAttributeAttributeGetter(info); 654 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 655 } 656 657 static void unsignedShortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 658 { 659 v8::Handle<v8::Object> holder = info.Holder(); 660 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedShortAttribute", "TestObject", holder, info.GetIsolate()); 661 TestObject* impl = V8TestObject::toNative(holder); 662 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt16(v8Value, exceptionState), exceptionState); 663 impl->setUnsignedShortAttribute(cppValue); 664 } 665 666 static void unsignedShortAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 667 { 668 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 669 TestObjectV8Internal::unsignedShortAttributeAttributeSetter(v8Value, info); 670 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 671 } 672 673 static void testInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 674 { 675 v8::Handle<v8::Object> holder = info.Holder(); 676 TestObject* impl = V8TestObject::toNative(holder); 677 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceEmptyAttribute()), impl); 678 } 679 680 static void testInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 681 { 682 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 683 TestObjectV8Internal::testInterfaceEmptyAttributeAttributeGetter(info); 684 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 685 } 686 687 static void testInterfaceEmptyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 688 { 689 v8::Handle<v8::Object> holder = info.Holder(); 690 TestObject* impl = V8TestObject::toNative(holder); 691 TONATIVE_VOID(TestInterfaceEmpty*, cppValue, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 692 impl->setTestInterfaceEmptyAttribute(WTF::getPtr(cppValue)); 693 } 694 695 static void testInterfaceEmptyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 696 { 697 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 698 TestObjectV8Internal::testInterfaceEmptyAttributeAttributeSetter(v8Value, info); 699 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 700 } 701 702 static void testObjectAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 703 { 704 v8::Handle<v8::Object> holder = info.Holder(); 705 TestObject* impl = V8TestObject::toNative(holder); 706 v8SetReturnValueFast(info, WTF::getPtr(impl->testObjectAttribute()), impl); 707 } 708 709 static void testObjectAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 710 { 711 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 712 TestObjectV8Internal::testObjectAttributeAttributeGetter(info); 713 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 714 } 715 716 static void testObjectAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 717 { 718 v8::Handle<v8::Object> holder = info.Holder(); 719 TestObject* impl = V8TestObject::toNative(holder); 720 TONATIVE_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 721 impl->setTestObjectAttribute(WTF::getPtr(cppValue)); 722 } 723 724 static void testObjectAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 725 { 726 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 727 TestObjectV8Internal::testObjectAttributeAttributeSetter(v8Value, info); 728 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 729 } 730 731 static void voidCallbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 732 { 733 v8::Handle<v8::Object> holder = info.Holder(); 734 TestObject* impl = V8TestObject::toNative(holder); 735 v8SetReturnValue(info, impl->voidCallbackFunctionAttribute().v8Value()); 736 } 737 738 static void voidCallbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 739 { 740 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 741 TestObjectV8Internal::voidCallbackFunctionAttributeAttributeGetter(info); 742 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 743 } 744 745 static void voidCallbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 746 { 747 v8::Handle<v8::Object> holder = info.Holder(); 748 TestObject* impl = V8TestObject::toNative(holder); 749 TONATIVE_VOID(ScriptValue, cppValue, ScriptValue(ScriptState::current(info.GetIsolate()), v8Value)); 750 impl->setVoidCallbackFunctionAttribute(cppValue); 751 } 752 753 static void voidCallbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 754 { 755 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 756 TestObjectV8Internal::voidCallbackFunctionAttributeAttributeSetter(v8Value, info); 757 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 758 } 759 760 static void anyCallbackFunctionOptionalAnyArgAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 761 { 762 v8::Handle<v8::Object> holder = info.Holder(); 763 TestObject* impl = V8TestObject::toNative(holder); 764 v8SetReturnValue(info, impl->anyCallbackFunctionOptionalAnyArgAttribute().v8Value()); 765 } 766 767 static void anyCallbackFunctionOptionalAnyArgAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 768 { 769 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 770 TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeGetter(info); 771 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 772 } 773 774 static void anyCallbackFunctionOptionalAnyArgAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 775 { 776 v8::Handle<v8::Object> holder = info.Holder(); 777 TestObject* impl = V8TestObject::toNative(holder); 778 TONATIVE_VOID(ScriptValue, cppValue, ScriptValue(ScriptState::current(info.GetIsolate()), v8Value)); 779 impl->setAnyCallbackFunctionOptionalAnyArgAttribute(cppValue); 780 } 781 782 static void anyCallbackFunctionOptionalAnyArgAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 783 { 784 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 785 TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeSetter(v8Value, info); 786 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 787 } 788 789 static void cssAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 790 { 791 v8::Handle<v8::Object> holder = info.Holder(); 792 TestObject* impl = V8TestObject::toNative(holder); 793 v8SetReturnValueInt(info, impl->cssAttribute()); 794 } 795 796 static void cssAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 797 { 798 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 799 TestObjectV8Internal::cssAttributeAttributeGetter(info); 800 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 801 } 802 803 static void cssAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 804 { 805 v8::Handle<v8::Object> holder = info.Holder(); 806 ExceptionState exceptionState(ExceptionState::SetterContext, "cssAttribute", "TestObject", holder, info.GetIsolate()); 807 TestObject* impl = V8TestObject::toNative(holder); 808 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 809 impl->setCSSAttribute(cppValue); 810 } 811 812 static void cssAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 813 { 814 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 815 TestObjectV8Internal::cssAttributeAttributeSetter(v8Value, info); 816 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 817 } 818 819 static void imeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 820 { 821 v8::Handle<v8::Object> holder = info.Holder(); 822 TestObject* impl = V8TestObject::toNative(holder); 823 v8SetReturnValueInt(info, impl->imeAttribute()); 824 } 825 826 static void imeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 827 { 828 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 829 TestObjectV8Internal::imeAttributeAttributeGetter(info); 830 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 831 } 832 833 static void imeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 834 { 835 v8::Handle<v8::Object> holder = info.Holder(); 836 ExceptionState exceptionState(ExceptionState::SetterContext, "imeAttribute", "TestObject", holder, info.GetIsolate()); 837 TestObject* impl = V8TestObject::toNative(holder); 838 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 839 impl->setIMEAttribute(cppValue); 840 } 841 842 static void imeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 843 { 844 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 845 TestObjectV8Internal::imeAttributeAttributeSetter(v8Value, info); 846 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 847 } 848 849 static void svgAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 850 { 851 v8::Handle<v8::Object> holder = info.Holder(); 852 TestObject* impl = V8TestObject::toNative(holder); 853 v8SetReturnValueInt(info, impl->svgAttribute()); 854 } 855 856 static void svgAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 857 { 858 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 859 TestObjectV8Internal::svgAttributeAttributeGetter(info); 860 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 861 } 862 863 static void svgAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 864 { 865 v8::Handle<v8::Object> holder = info.Holder(); 866 ExceptionState exceptionState(ExceptionState::SetterContext, "svgAttribute", "TestObject", holder, info.GetIsolate()); 867 TestObject* impl = V8TestObject::toNative(holder); 868 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 869 impl->setSVGAttribute(cppValue); 870 } 871 872 static void svgAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 873 { 874 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 875 TestObjectV8Internal::svgAttributeAttributeSetter(v8Value, info); 876 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 877 } 878 879 static void xmlAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 880 { 881 v8::Handle<v8::Object> holder = info.Holder(); 882 TestObject* impl = V8TestObject::toNative(holder); 883 v8SetReturnValueInt(info, impl->xmlAttribute()); 884 } 885 886 static void xmlAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 887 { 888 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 889 TestObjectV8Internal::xmlAttributeAttributeGetter(info); 890 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 891 } 892 893 static void xmlAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 894 { 895 v8::Handle<v8::Object> holder = info.Holder(); 896 ExceptionState exceptionState(ExceptionState::SetterContext, "xmlAttribute", "TestObject", holder, info.GetIsolate()); 897 TestObject* impl = V8TestObject::toNative(holder); 898 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 899 impl->setXMLAttribute(cppValue); 900 } 901 902 static void xmlAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 903 { 904 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 905 TestObjectV8Internal::xmlAttributeAttributeSetter(v8Value, info); 906 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 907 } 908 909 static void nodeFilterAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 910 { 911 v8::Handle<v8::Object> holder = info.Holder(); 912 TestObject* impl = V8TestObject::toNative(holder); 913 v8SetReturnValueFast(info, WTF::getPtr(impl->nodeFilterAttribute()), impl); 914 } 915 916 static void nodeFilterAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 917 { 918 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 919 TestObjectV8Internal::nodeFilterAttributeAttributeGetter(info); 920 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 921 } 922 923 static void nodeFilterAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 924 { 925 v8::Handle<v8::Object> holder = info.Holder(); 926 TestObject* impl = V8TestObject::toNative(holder); 927 TONATIVE_VOID(RefPtrWillBeRawPtr<NodeFilter>, cppValue, toNodeFilter(v8Value, info.Holder(), ScriptState::current(info.GetIsolate()))); 928 impl->setNodeFilterAttribute(WTF::getPtr(cppValue)); 929 } 930 931 static void nodeFilterAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 932 { 933 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 934 TestObjectV8Internal::nodeFilterAttributeAttributeSetter(v8Value, info); 935 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 936 } 937 938 static void serializedScriptValueAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 939 { 940 v8::Handle<v8::Object> holder = info.Holder(); 941 TestObject* impl = V8TestObject::toNative(holder); 942 v8SetReturnValue(info, impl->serializedScriptValueAttribute() ? impl->serializedScriptValueAttribute()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()))); 943 } 944 945 static void serializedScriptValueAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 946 { 947 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 948 TestObjectV8Internal::serializedScriptValueAttributeAttributeGetter(info); 949 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 950 } 951 952 static void serializedScriptValueAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 953 { 954 v8::Handle<v8::Object> holder = info.Holder(); 955 TestObject* impl = V8TestObject::toNative(holder); 956 TONATIVE_VOID(RefPtr<SerializedScriptValue>, cppValue, SerializedScriptValue::create(v8Value, info.GetIsolate())); 957 impl->setSerializedScriptValueAttribute(WTF::getPtr(cppValue)); 958 } 959 960 static void serializedScriptValueAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 961 { 962 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 963 TestObjectV8Internal::serializedScriptValueAttributeAttributeSetter(v8Value, info); 964 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 965 } 966 967 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 968 { 969 v8::Handle<v8::Object> holder = info.Holder(); 970 TestObject* impl = V8TestObject::toNative(holder); 971 v8SetReturnValue(info, impl->anyAttribute().v8Value()); 972 } 973 974 static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 975 { 976 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 977 TestObjectV8Internal::anyAttributeAttributeGetter(info); 978 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 979 } 980 981 static void anyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 982 { 983 v8::Handle<v8::Object> holder = info.Holder(); 984 TestObject* impl = V8TestObject::toNative(holder); 985 TONATIVE_VOID(ScriptValue, cppValue, ScriptValue(ScriptState::current(info.GetIsolate()), v8Value)); 986 impl->setAnyAttribute(cppValue); 987 } 988 989 static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 990 { 991 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 992 TestObjectV8Internal::anyAttributeAttributeSetter(v8Value, info); 993 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 994 } 995 996 static void promiseAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 997 { 998 v8::Handle<v8::Object> holder = info.Holder(); 999 TestObject* impl = V8TestObject::toNative(holder); 1000 v8SetReturnValue(info, impl->promiseAttribute().v8Value()); 1001 } 1002 1003 static void promiseAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1004 { 1005 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1006 TestObjectV8Internal::promiseAttributeAttributeGetter(info); 1007 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1008 } 1009 1010 static void promiseAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1011 { 1012 v8::Handle<v8::Object> holder = info.Holder(); 1013 TestObject* impl = V8TestObject::toNative(holder); 1014 TONATIVE_VOID(ScriptPromise, cppValue, ScriptPromise::cast(ScriptState::current(info.GetIsolate()), v8Value)); 1015 impl->setPromiseAttribute(cppValue); 1016 } 1017 1018 static void promiseAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1019 { 1020 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1021 TestObjectV8Internal::promiseAttributeAttributeSetter(v8Value, info); 1022 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1023 } 1024 1025 static void windowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1026 { 1027 v8::Handle<v8::Object> holder = info.Holder(); 1028 TestObject* impl = V8TestObject::toNative(holder); 1029 v8SetReturnValueFast(info, WTF::getPtr(impl->windowAttribute()), impl); 1030 } 1031 1032 static void windowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1033 { 1034 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1035 TestObjectV8Internal::windowAttributeAttributeGetter(info); 1036 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1037 } 1038 1039 static void windowAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1040 { 1041 v8::Handle<v8::Object> holder = info.Holder(); 1042 TestObject* impl = V8TestObject::toNative(holder); 1043 TONATIVE_VOID(LocalDOMWindow*, cppValue, toDOMWindow(v8Value, info.GetIsolate())); 1044 impl->setWindowAttribute(WTF::getPtr(cppValue)); 1045 } 1046 1047 static void windowAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1048 { 1049 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1050 TestObjectV8Internal::windowAttributeAttributeSetter(v8Value, info); 1051 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1052 } 1053 1054 static void documentAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1055 { 1056 v8::Handle<v8::Object> holder = info.Holder(); 1057 TestObject* impl = V8TestObject::toNative(holder); 1058 v8SetReturnValueFast(info, WTF::getPtr(impl->documentAttribute()), impl); 1059 } 1060 1061 static void documentAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1062 { 1063 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1064 TestObjectV8Internal::documentAttributeAttributeGetter(info); 1065 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1066 } 1067 1068 static void documentAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1069 { 1070 v8::Handle<v8::Object> holder = info.Holder(); 1071 TestObject* impl = V8TestObject::toNative(holder); 1072 TONATIVE_VOID(Document*, cppValue, V8Document::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 1073 impl->setDocumentAttribute(WTF::getPtr(cppValue)); 1074 } 1075 1076 static void documentAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1077 { 1078 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1079 TestObjectV8Internal::documentAttributeAttributeSetter(v8Value, info); 1080 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1081 } 1082 1083 static void documentFragmentAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1084 { 1085 v8::Handle<v8::Object> holder = info.Holder(); 1086 TestObject* impl = V8TestObject::toNative(holder); 1087 v8SetReturnValueFast(info, WTF::getPtr(impl->documentFragmentAttribute()), impl); 1088 } 1089 1090 static void documentFragmentAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1091 { 1092 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1093 TestObjectV8Internal::documentFragmentAttributeAttributeGetter(info); 1094 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1095 } 1096 1097 static void documentFragmentAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1098 { 1099 v8::Handle<v8::Object> holder = info.Holder(); 1100 TestObject* impl = V8TestObject::toNative(holder); 1101 TONATIVE_VOID(DocumentFragment*, cppValue, V8DocumentFragment::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 1102 impl->setDocumentFragmentAttribute(WTF::getPtr(cppValue)); 1103 } 1104 1105 static void documentFragmentAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1106 { 1107 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1108 TestObjectV8Internal::documentFragmentAttributeAttributeSetter(v8Value, info); 1109 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1110 } 1111 1112 static void documentTypeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1113 { 1114 v8::Handle<v8::Object> holder = info.Holder(); 1115 TestObject* impl = V8TestObject::toNative(holder); 1116 v8SetReturnValueFast(info, WTF::getPtr(impl->documentTypeAttribute()), impl); 1117 } 1118 1119 static void documentTypeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1120 { 1121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1122 TestObjectV8Internal::documentTypeAttributeAttributeGetter(info); 1123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1124 } 1125 1126 static void documentTypeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1127 { 1128 v8::Handle<v8::Object> holder = info.Holder(); 1129 TestObject* impl = V8TestObject::toNative(holder); 1130 TONATIVE_VOID(DocumentType*, cppValue, V8DocumentType::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 1131 impl->setDocumentTypeAttribute(WTF::getPtr(cppValue)); 1132 } 1133 1134 static void documentTypeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1135 { 1136 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1137 TestObjectV8Internal::documentTypeAttributeAttributeSetter(v8Value, info); 1138 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1139 } 1140 1141 static void elementAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1142 { 1143 v8::Handle<v8::Object> holder = info.Holder(); 1144 TestObject* impl = V8TestObject::toNative(holder); 1145 v8SetReturnValueFast(info, WTF::getPtr(impl->elementAttribute()), impl); 1146 } 1147 1148 static void elementAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1149 { 1150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1151 TestObjectV8Internal::elementAttributeAttributeGetter(info); 1152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1153 } 1154 1155 static void elementAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1156 { 1157 v8::Handle<v8::Object> holder = info.Holder(); 1158 TestObject* impl = V8TestObject::toNative(holder); 1159 TONATIVE_VOID(Element*, cppValue, V8Element::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 1160 impl->setElementAttribute(WTF::getPtr(cppValue)); 1161 } 1162 1163 static void elementAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1164 { 1165 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1166 TestObjectV8Internal::elementAttributeAttributeSetter(v8Value, info); 1167 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1168 } 1169 1170 static void nodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1171 { 1172 v8::Handle<v8::Object> holder = info.Holder(); 1173 TestObject* impl = V8TestObject::toNative(holder); 1174 v8SetReturnValueFast(info, WTF::getPtr(impl->nodeAttribute()), impl); 1175 } 1176 1177 static void nodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1178 { 1179 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1180 TestObjectV8Internal::nodeAttributeAttributeGetter(info); 1181 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1182 } 1183 1184 static void nodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1185 { 1186 v8::Handle<v8::Object> holder = info.Holder(); 1187 TestObject* impl = V8TestObject::toNative(holder); 1188 TONATIVE_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 1189 impl->setNodeAttribute(WTF::getPtr(cppValue)); 1190 } 1191 1192 static void nodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1193 { 1194 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1195 TestObjectV8Internal::nodeAttributeAttributeSetter(v8Value, info); 1196 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1197 } 1198 1199 static void shadowRootAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1200 { 1201 v8::Handle<v8::Object> holder = info.Holder(); 1202 TestObject* impl = V8TestObject::toNative(holder); 1203 v8SetReturnValueFast(info, WTF::getPtr(impl->shadowRootAttribute()), impl); 1204 } 1205 1206 static void shadowRootAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1207 { 1208 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1209 TestObjectV8Internal::shadowRootAttributeAttributeGetter(info); 1210 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1211 } 1212 1213 static void shadowRootAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1214 { 1215 v8::Handle<v8::Object> holder = info.Holder(); 1216 TestObject* impl = V8TestObject::toNative(holder); 1217 TONATIVE_VOID(ShadowRoot*, cppValue, V8ShadowRoot::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 1218 impl->setShadowRootAttribute(WTF::getPtr(cppValue)); 1219 } 1220 1221 static void shadowRootAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1222 { 1223 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1224 TestObjectV8Internal::shadowRootAttributeAttributeSetter(v8Value, info); 1225 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1226 } 1227 1228 static void arrayBufferAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1229 { 1230 v8::Handle<v8::Object> holder = info.Holder(); 1231 TestObject* impl = V8TestObject::toNative(holder); 1232 v8SetReturnValueFast(info, WTF::getPtr(impl->arrayBufferAttribute()), impl); 1233 } 1234 1235 static void arrayBufferAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1236 { 1237 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1238 TestObjectV8Internal::arrayBufferAttributeAttributeGetter(info); 1239 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1240 } 1241 1242 static void arrayBufferAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1243 { 1244 v8::Handle<v8::Object> holder = info.Holder(); 1245 TestObject* impl = V8TestObject::toNative(holder); 1246 TONATIVE_VOID(ArrayBuffer*, cppValue, v8Value->IsArrayBuffer() ? V8ArrayBuffer::toNative(v8::Handle<v8::ArrayBuffer>::Cast(v8Value)) : 0); 1247 impl->setArrayBufferAttribute(WTF::getPtr(cppValue)); 1248 } 1249 1250 static void arrayBufferAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1251 { 1252 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1253 TestObjectV8Internal::arrayBufferAttributeAttributeSetter(v8Value, info); 1254 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1255 } 1256 1257 static void float32ArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1258 { 1259 v8::Handle<v8::Object> holder = info.Holder(); 1260 TestObject* impl = V8TestObject::toNative(holder); 1261 v8SetReturnValueFast(info, WTF::getPtr(impl->float32ArrayAttribute()), impl); 1262 } 1263 1264 static void float32ArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1265 { 1266 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1267 TestObjectV8Internal::float32ArrayAttributeAttributeGetter(info); 1268 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1269 } 1270 1271 static void float32ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1272 { 1273 v8::Handle<v8::Object> holder = info.Holder(); 1274 TestObject* impl = V8TestObject::toNative(holder); 1275 TONATIVE_VOID(Float32Array*, cppValue, v8Value->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(v8Value)) : 0); 1276 impl->setFloat32ArrayAttribute(WTF::getPtr(cppValue)); 1277 } 1278 1279 static void float32ArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1280 { 1281 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1282 TestObjectV8Internal::float32ArrayAttributeAttributeSetter(v8Value, info); 1283 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1284 } 1285 1286 static void uint8ArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1287 { 1288 v8::Handle<v8::Object> holder = info.Holder(); 1289 TestObject* impl = V8TestObject::toNative(holder); 1290 v8SetReturnValueFast(info, WTF::getPtr(impl->uint8ArrayAttribute()), impl); 1291 } 1292 1293 static void uint8ArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1294 { 1295 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1296 TestObjectV8Internal::uint8ArrayAttributeAttributeGetter(info); 1297 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1298 } 1299 1300 static void uint8ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1301 { 1302 v8::Handle<v8::Object> holder = info.Holder(); 1303 TestObject* impl = V8TestObject::toNative(holder); 1304 TONATIVE_VOID(Uint8Array*, cppValue, v8Value->IsUint8Array() ? V8Uint8Array::toNative(v8::Handle<v8::Uint8Array>::Cast(v8Value)) : 0); 1305 impl->setUint8ArrayAttribute(WTF::getPtr(cppValue)); 1306 } 1307 1308 static void uint8ArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1309 { 1310 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1311 TestObjectV8Internal::uint8ArrayAttributeAttributeSetter(v8Value, info); 1312 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1313 } 1314 1315 static void selfAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1316 { 1317 v8::Handle<v8::Object> holder = info.Holder(); 1318 TestObject* impl = V8TestObject::toNative(holder); 1319 v8SetReturnValueFast(info, WTF::getPtr(impl->self()), impl); 1320 } 1321 1322 static void selfAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1323 { 1324 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1325 TestObjectV8Internal::selfAttributeGetter(info); 1326 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1327 } 1328 1329 static void readonlyEventTargetAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1330 { 1331 v8::Handle<v8::Object> holder = info.Holder(); 1332 TestObject* impl = V8TestObject::toNative(holder); 1333 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyEventTargetAttribute()), impl); 1334 } 1335 1336 static void readonlyEventTargetAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1337 { 1338 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1339 TestObjectV8Internal::readonlyEventTargetAttributeAttributeGetter(info); 1340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1341 } 1342 1343 static void readonlyEventTargetOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1344 { 1345 v8::Handle<v8::Object> holder = info.Holder(); 1346 TestObject* impl = V8TestObject::toNative(holder); 1347 bool isNull = false; 1348 RefPtrWillBeRawPtr<EventTarget> v8Value = impl->readonlyEventTargetOrNullAttribute(isNull); 1349 if (isNull) { 1350 v8SetReturnValueNull(info); 1351 return; 1352 } 1353 v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); 1354 } 1355 1356 static void readonlyEventTargetOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1357 { 1358 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1359 TestObjectV8Internal::readonlyEventTargetOrNullAttributeAttributeGetter(info); 1360 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1361 } 1362 1363 static void readonlyWindowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1364 { 1365 v8::Handle<v8::Object> holder = info.Holder(); 1366 TestObject* impl = V8TestObject::toNative(holder); 1367 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyWindowAttribute()), impl); 1368 } 1369 1370 static void readonlyWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1371 { 1372 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1373 TestObjectV8Internal::readonlyWindowAttributeAttributeGetter(info); 1374 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1375 } 1376 1377 static void htmlCollectionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1378 { 1379 v8::Handle<v8::Object> holder = info.Holder(); 1380 TestObject* impl = V8TestObject::toNative(holder); 1381 v8SetReturnValueFast(info, WTF::getPtr(impl->htmlCollectionAttribute()), impl); 1382 } 1383 1384 static void htmlCollectionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1385 { 1386 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1387 TestObjectV8Internal::htmlCollectionAttributeAttributeGetter(info); 1388 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1389 } 1390 1391 static void htmlElementAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1392 { 1393 v8::Handle<v8::Object> holder = info.Holder(); 1394 TestObject* impl = V8TestObject::toNative(holder); 1395 v8SetReturnValueFast(info, WTF::getPtr(impl->htmlElementAttribute()), impl); 1396 } 1397 1398 static void htmlElementAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1399 { 1400 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1401 TestObjectV8Internal::htmlElementAttributeAttributeGetter(info); 1402 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1403 } 1404 1405 static void stringArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1406 { 1407 v8::Handle<v8::Object> holder = info.Holder(); 1408 TestObject* impl = V8TestObject::toNative(holder); 1409 v8SetReturnValue(info, v8Array(impl->stringArrayAttribute(), info.Holder(), info.GetIsolate())); 1410 } 1411 1412 static void stringArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1413 { 1414 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1415 TestObjectV8Internal::stringArrayAttributeAttributeGetter(info); 1416 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1417 } 1418 1419 static void stringArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1420 { 1421 v8::Handle<v8::Object> holder = info.Holder(); 1422 TestObject* impl = V8TestObject::toNative(holder); 1423 TONATIVE_VOID(Vector<String>, cppValue, toNativeArray<String>(v8Value, 0, info.GetIsolate())); 1424 impl->setStringArrayAttribute(cppValue); 1425 } 1426 1427 static void stringArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1428 { 1429 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1430 TestObjectV8Internal::stringArrayAttributeAttributeSetter(v8Value, info); 1431 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1432 } 1433 1434 static void testInterfaceEmptyArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1435 { 1436 v8::Handle<v8::Object> holder = info.Holder(); 1437 TestObject* impl = V8TestObject::toNative(holder); 1438 v8SetReturnValue(info, v8Array(impl->testInterfaceEmptyArrayAttribute(), info.Holder(), info.GetIsolate())); 1439 } 1440 1441 static void testInterfaceEmptyArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1442 { 1443 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1444 TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeGetter(info); 1445 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1446 } 1447 1448 static void testInterfaceEmptyArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1449 { 1450 v8::Handle<v8::Object> holder = info.Holder(); 1451 TestObject* impl = V8TestObject::toNative(holder); 1452 TONATIVE_VOID(Vector<RefPtr<TestInterfaceEmpty> >, cppValue, (toRefPtrNativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(v8Value, 0, info.GetIsolate()))); 1453 impl->setTestInterfaceEmptyArrayAttribute(cppValue); 1454 } 1455 1456 static void testInterfaceEmptyArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1457 { 1458 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1459 TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeSetter(v8Value, info); 1460 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1461 } 1462 1463 static void floatArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1464 { 1465 v8::Handle<v8::Object> holder = info.Holder(); 1466 TestObject* impl = V8TestObject::toNative(holder); 1467 v8SetReturnValue(info, v8Array(impl->floatArrayAttribute(), info.Holder(), info.GetIsolate())); 1468 } 1469 1470 static void floatArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1471 { 1472 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1473 TestObjectV8Internal::floatArrayAttributeAttributeGetter(info); 1474 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1475 } 1476 1477 static void floatArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1478 { 1479 v8::Handle<v8::Object> holder = info.Holder(); 1480 TestObject* impl = V8TestObject::toNative(holder); 1481 TONATIVE_VOID(Vector<float>, cppValue, toNativeArray<float>(v8Value, 0, info.GetIsolate())); 1482 impl->setFloatArrayAttribute(cppValue); 1483 } 1484 1485 static void floatArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1486 { 1487 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1488 TestObjectV8Internal::floatArrayAttributeAttributeSetter(v8Value, info); 1489 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1490 } 1491 1492 static void stringOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1493 { 1494 v8::Handle<v8::Object> holder = info.Holder(); 1495 TestObject* impl = V8TestObject::toNative(holder); 1496 bool isNull = false; 1497 String v8Value = impl->stringOrNullAttribute(isNull); 1498 if (isNull) { 1499 v8SetReturnValueNull(info); 1500 return; 1501 } 1502 v8SetReturnValueString(info, v8Value, info.GetIsolate()); 1503 } 1504 1505 static void stringOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1506 { 1507 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1508 TestObjectV8Internal::stringOrNullAttributeAttributeGetter(info); 1509 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1510 } 1511 1512 static void stringOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1513 { 1514 v8::Handle<v8::Object> holder = info.Holder(); 1515 TestObject* impl = V8TestObject::toNative(holder); 1516 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 1517 impl->setStringOrNullAttribute(cppValue); 1518 } 1519 1520 static void stringOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1521 { 1522 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1523 TestObjectV8Internal::stringOrNullAttributeAttributeSetter(v8Value, info); 1524 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1525 } 1526 1527 static void longOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1528 { 1529 v8::Handle<v8::Object> holder = info.Holder(); 1530 TestObject* impl = V8TestObject::toNative(holder); 1531 bool isNull = false; 1532 int v8Value = impl->longOrNullAttribute(isNull); 1533 if (isNull) { 1534 v8SetReturnValueNull(info); 1535 return; 1536 } 1537 v8SetReturnValueInt(info, v8Value); 1538 } 1539 1540 static void longOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1541 { 1542 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1543 TestObjectV8Internal::longOrNullAttributeAttributeGetter(info); 1544 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1545 } 1546 1547 static void longOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1548 { 1549 v8::Handle<v8::Object> holder = info.Holder(); 1550 ExceptionState exceptionState(ExceptionState::SetterContext, "longOrNullAttribute", "TestObject", holder, info.GetIsolate()); 1551 TestObject* impl = V8TestObject::toNative(holder); 1552 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1553 impl->setLongOrNullAttribute(cppValue); 1554 } 1555 1556 static void longOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1557 { 1558 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1559 TestObjectV8Internal::longOrNullAttributeAttributeSetter(v8Value, info); 1560 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1561 } 1562 1563 static void testInterfaceOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1564 { 1565 v8::Handle<v8::Object> holder = info.Holder(); 1566 TestObject* impl = V8TestObject::toNative(holder); 1567 bool isNull = false; 1568 RefPtr<TestInterfaceImplementation> v8Value = impl->testInterfaceOrNullAttribute(isNull); 1569 if (isNull) { 1570 v8SetReturnValueNull(info); 1571 return; 1572 } 1573 v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); 1574 } 1575 1576 static void testInterfaceOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1577 { 1578 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1579 TestObjectV8Internal::testInterfaceOrNullAttributeAttributeGetter(info); 1580 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1581 } 1582 1583 static void testInterfaceOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1584 { 1585 v8::Handle<v8::Object> holder = info.Holder(); 1586 TestObject* impl = V8TestObject::toNative(holder); 1587 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 1588 impl->setTestInterfaceOrNullAttribute(WTF::getPtr(cppValue)); 1589 } 1590 1591 static void testInterfaceOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1592 { 1593 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1594 TestObjectV8Internal::testInterfaceOrNullAttributeAttributeSetter(v8Value, info); 1595 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1596 } 1597 1598 static void testEnumAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1599 { 1600 v8::Handle<v8::Object> holder = info.Holder(); 1601 TestObject* impl = V8TestObject::toNative(holder); 1602 v8SetReturnValueString(info, impl->testEnumAttribute(), info.GetIsolate()); 1603 } 1604 1605 static void testEnumAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1606 { 1607 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1608 TestObjectV8Internal::testEnumAttributeAttributeGetter(info); 1609 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1610 } 1611 1612 static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1613 { 1614 v8::Handle<v8::Object> holder = info.Holder(); 1615 TestObject* impl = V8TestObject::toNative(holder); 1616 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 1617 String string = cppValue; 1618 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) 1619 return; 1620 impl->setTestEnumAttribute(cppValue); 1621 } 1622 1623 static void testEnumAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1624 { 1625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1626 TestObjectV8Internal::testEnumAttributeAttributeSetter(v8Value, info); 1627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1628 } 1629 1630 static void staticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1631 { 1632 v8SetReturnValueString(info, TestObject::staticStringAttribute(), info.GetIsolate()); 1633 } 1634 1635 static void staticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1636 { 1637 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1638 TestObjectV8Internal::staticStringAttributeAttributeGetter(info); 1639 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1640 } 1641 1642 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1643 { 1644 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 1645 TestObject::setStaticStringAttribute(cppValue); 1646 } 1647 1648 static void staticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1649 { 1650 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1651 TestObjectV8Internal::staticStringAttributeAttributeSetter(v8Value, info); 1652 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1653 } 1654 1655 static void staticLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1656 { 1657 v8SetReturnValueInt(info, TestObject::staticLongAttribute()); 1658 } 1659 1660 static void staticLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1661 { 1662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1663 TestObjectV8Internal::staticLongAttributeAttributeGetter(info); 1664 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1665 } 1666 1667 static void staticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1668 { 1669 ExceptionState exceptionState(ExceptionState::SetterContext, "staticLongAttribute", "TestObject", holder, info.GetIsolate()); 1670 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1671 TestObject::setStaticLongAttribute(cppValue); 1672 } 1673 1674 static void staticLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1675 { 1676 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1677 TestObjectV8Internal::staticLongAttributeAttributeSetter(v8Value, info); 1678 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1679 } 1680 1681 static void eventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1682 { 1683 v8::Handle<v8::Object> holder = info.Holder(); 1684 TestObject* impl = V8TestObject::toNative(holder); 1685 EventListener* v8Value = impl->eventHandlerAttribute(); 1686 v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()))); 1687 } 1688 1689 static void eventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1690 { 1691 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1692 TestObjectV8Internal::eventHandlerAttributeAttributeGetter(info); 1693 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1694 } 1695 1696 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1697 { 1698 v8::Handle<v8::Object> holder = info.Holder(); 1699 TestObject* impl = V8TestObject::toNative(holder); 1700 moveEventListenerToNewWrapper(holder, impl->eventHandlerAttribute(), v8Value, V8TestObject::eventListenerCacheIndex, info.GetIsolate()); 1701 impl->setEventHandlerAttribute(V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)); 1702 } 1703 1704 static void eventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1705 { 1706 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1707 TestObjectV8Internal::eventHandlerAttributeAttributeSetter(v8Value, info); 1708 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1709 } 1710 1711 static void activityLoggingAccessForAllWorldsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1712 { 1713 v8::Handle<v8::Object> holder = info.Holder(); 1714 TestObject* impl = V8TestObject::toNative(holder); 1715 v8SetReturnValueInt(info, impl->activityLoggingAccessForAllWorldsLongAttribute()); 1716 } 1717 1718 static void activityLoggingAccessForAllWorldsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1719 { 1720 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1721 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 1722 V8PerContextData* contextData = scriptState->perContextData(); 1723 if (contextData && contextData->activityLogger()) 1724 contextData->activityLogger()->logGetter("TestObject.activityLoggingAccessForAllWorldsLongAttribute"); 1725 TestObjectV8Internal::activityLoggingAccessForAllWorldsLongAttributeAttributeGetter(info); 1726 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1727 } 1728 1729 static void activityLoggingAccessForAllWorldsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1730 { 1731 v8::Handle<v8::Object> holder = info.Holder(); 1732 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate()); 1733 TestObject* impl = V8TestObject::toNative(holder); 1734 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1735 impl->setActivityLoggingAccessForAllWorldsLongAttribute(cppValue); 1736 } 1737 1738 static void activityLoggingAccessForAllWorldsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1739 { 1740 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1741 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 1742 V8PerContextData* contextData = scriptState->perContextData(); 1743 if (contextData && contextData->activityLogger()) { 1744 contextData->activityLogger()->logSetter("TestObject.activityLoggingAccessForAllWorldsLongAttribute", v8Value); 1745 } 1746 TestObjectV8Internal::activityLoggingAccessForAllWorldsLongAttributeAttributeSetter(v8Value, info); 1747 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1748 } 1749 1750 static void activityLoggingGetterForAllWorldsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1751 { 1752 v8::Handle<v8::Object> holder = info.Holder(); 1753 TestObject* impl = V8TestObject::toNative(holder); 1754 v8SetReturnValueInt(info, impl->activityLoggingGetterForAllWorldsLongAttribute()); 1755 } 1756 1757 static void activityLoggingGetterForAllWorldsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1758 { 1759 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1760 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 1761 V8PerContextData* contextData = scriptState->perContextData(); 1762 if (contextData && contextData->activityLogger()) 1763 contextData->activityLogger()->logGetter("TestObject.activityLoggingGetterForAllWorldsLongAttribute"); 1764 TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeGetter(info); 1765 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1766 } 1767 1768 static void activityLoggingGetterForAllWorldsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1769 { 1770 v8::Handle<v8::Object> holder = info.Holder(); 1771 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate()); 1772 TestObject* impl = V8TestObject::toNative(holder); 1773 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1774 impl->setActivityLoggingGetterForAllWorldsLongAttribute(cppValue); 1775 } 1776 1777 static void activityLoggingGetterForAllWorldsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1778 { 1779 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1780 TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeSetter(v8Value, info); 1781 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1782 } 1783 1784 static void activityLoggingSetterForAllWorldsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1785 { 1786 v8::Handle<v8::Object> holder = info.Holder(); 1787 TestObject* impl = V8TestObject::toNative(holder); 1788 v8SetReturnValueInt(info, impl->activityLoggingSetterForAllWorldsLongAttribute()); 1789 } 1790 1791 static void activityLoggingSetterForAllWorldsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1792 { 1793 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1794 TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeGetter(info); 1795 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1796 } 1797 1798 static void activityLoggingSetterForAllWorldsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1799 { 1800 v8::Handle<v8::Object> holder = info.Holder(); 1801 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingSetterForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate()); 1802 TestObject* impl = V8TestObject::toNative(holder); 1803 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1804 impl->setActivityLoggingSetterForAllWorldsLongAttribute(cppValue); 1805 } 1806 1807 static void activityLoggingSetterForAllWorldsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1808 { 1809 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1810 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 1811 V8PerContextData* contextData = scriptState->perContextData(); 1812 if (contextData && contextData->activityLogger()) { 1813 contextData->activityLogger()->logSetter("TestObject.activityLoggingSetterForAllWorldsLongAttribute", v8Value); 1814 } 1815 TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeSetter(v8Value, info); 1816 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1817 } 1818 1819 static void cachedAttributeAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1820 { 1821 v8::Handle<v8::Object> holder = info.Holder(); 1822 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedAttributeAnyAttribute"); 1823 TestObject* impl = V8TestObject::toNative(holder); 1824 if (!impl->isValueDirty()) { 1825 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); 1826 if (!v8Value.IsEmpty()) { 1827 v8SetReturnValue(info, v8Value); 1828 return; 1829 } 1830 } 1831 ScriptValue v8Value = impl->cachedAttributeAnyAttribute(); 1832 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value.v8Value()); 1833 v8SetReturnValue(info, v8Value.v8Value()); 1834 } 1835 1836 static void cachedAttributeAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1837 { 1838 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1839 TestObjectV8Internal::cachedAttributeAnyAttributeAttributeGetter(info); 1840 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1841 } 1842 1843 static void cachedAttributeAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1844 { 1845 v8::Handle<v8::Object> holder = info.Holder(); 1846 TestObject* impl = V8TestObject::toNative(holder); 1847 TONATIVE_VOID(ScriptValue, cppValue, ScriptValue(ScriptState::current(info.GetIsolate()), v8Value)); 1848 impl->setCachedAttributeAnyAttribute(cppValue); 1849 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "cachedAttributeAnyAttribute")); // Invalidate the cached value. 1850 } 1851 1852 static void cachedAttributeAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1853 { 1854 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1855 TestObjectV8Internal::cachedAttributeAnyAttributeAttributeSetter(v8Value, info); 1856 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1857 } 1858 1859 static void cachedArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1860 { 1861 v8::Handle<v8::Object> holder = info.Holder(); 1862 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedArrayAttribute"); 1863 TestObject* impl = V8TestObject::toNative(holder); 1864 if (!impl->isArrayDirty()) { 1865 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); 1866 if (!v8Value.IsEmpty()) { 1867 v8SetReturnValue(info, v8Value); 1868 return; 1869 } 1870 } 1871 Vector<String> v8Value = impl->cachedArrayAttribute(); 1872 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Array(v8Value, info.Holder(), info.GetIsolate())); 1873 v8SetReturnValue(info, v8Array(v8Value, info.Holder(), info.GetIsolate())); 1874 } 1875 1876 static void cachedArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1877 { 1878 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1879 TestObjectV8Internal::cachedArrayAttributeAttributeGetter(info); 1880 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1881 } 1882 1883 static void cachedArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1884 { 1885 v8::Handle<v8::Object> holder = info.Holder(); 1886 TestObject* impl = V8TestObject::toNative(holder); 1887 TONATIVE_VOID(Vector<String>, cppValue, toNativeArray<String>(v8Value, 0, info.GetIsolate())); 1888 impl->setCachedArrayAttribute(cppValue); 1889 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "cachedArrayAttribute")); // Invalidate the cached value. 1890 } 1891 1892 static void cachedArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1893 { 1894 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1895 TestObjectV8Internal::cachedArrayAttributeAttributeSetter(v8Value, info); 1896 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1897 } 1898 1899 static void callWithExecutionContextAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1900 { 1901 v8::Handle<v8::Object> holder = info.Holder(); 1902 TestObject* impl = V8TestObject::toNative(holder); 1903 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 1904 v8SetReturnValue(info, impl->callWithExecutionContextAnyAttribute(executionContext).v8Value()); 1905 } 1906 1907 static void callWithExecutionContextAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1908 { 1909 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1910 TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeGetter(info); 1911 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1912 } 1913 1914 static void callWithExecutionContextAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1915 { 1916 v8::Handle<v8::Object> holder = info.Holder(); 1917 TestObject* impl = V8TestObject::toNative(holder); 1918 TONATIVE_VOID(ScriptValue, cppValue, ScriptValue(ScriptState::current(info.GetIsolate()), v8Value)); 1919 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 1920 impl->setCallWithExecutionContextAnyAttribute(executionContext, cppValue); 1921 } 1922 1923 static void callWithExecutionContextAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1924 { 1925 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1926 TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeSetter(v8Value, info); 1927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1928 } 1929 1930 static void callWithScriptStateAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1931 { 1932 v8::Handle<v8::Object> holder = info.Holder(); 1933 TestObject* impl = V8TestObject::toNative(holder); 1934 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 1935 v8SetReturnValue(info, impl->callWithScriptStateAnyAttribute(scriptState).v8Value()); 1936 } 1937 1938 static void callWithScriptStateAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1939 { 1940 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1941 TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeGetter(info); 1942 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1943 } 1944 1945 static void callWithScriptStateAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1946 { 1947 v8::Handle<v8::Object> holder = info.Holder(); 1948 TestObject* impl = V8TestObject::toNative(holder); 1949 TONATIVE_VOID(ScriptValue, cppValue, ScriptValue(ScriptState::current(info.GetIsolate()), v8Value)); 1950 impl->setCallWithScriptStateAnyAttribute(scriptState, cppValue); 1951 } 1952 1953 static void callWithScriptStateAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1954 { 1955 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1956 TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeSetter(v8Value, info); 1957 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1958 } 1959 1960 static void callWithExecutionContextAndScriptStateAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1961 { 1962 v8::Handle<v8::Object> holder = info.Holder(); 1963 TestObject* impl = V8TestObject::toNative(holder); 1964 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 1965 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 1966 v8SetReturnValue(info, impl->callWithExecutionContextAndScriptStateAnyAttribute(scriptState, executionContext).v8Value()); 1967 } 1968 1969 static void callWithExecutionContextAndScriptStateAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1970 { 1971 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1972 TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeGetter(info); 1973 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1974 } 1975 1976 static void callWithExecutionContextAndScriptStateAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1977 { 1978 v8::Handle<v8::Object> holder = info.Holder(); 1979 TestObject* impl = V8TestObject::toNative(holder); 1980 TONATIVE_VOID(ScriptValue, cppValue, ScriptValue(ScriptState::current(info.GetIsolate()), v8Value)); 1981 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 1982 impl->setCallWithExecutionContextAndScriptStateAnyAttribute(scriptState, executionContext, cppValue); 1983 } 1984 1985 static void callWithExecutionContextAndScriptStateAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1986 { 1987 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1988 TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeSetter(v8Value, info); 1989 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1990 } 1991 1992 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1993 { 1994 v8::Handle<v8::Object> holder = info.Holder(); 1995 TestObject* impl = V8TestObject::toNative(holder); 1996 ExceptionState exceptionState(ExceptionState::GetterContext, "checkSecurityForNodeReadonlyDocumentAttribute", "TestObject", holder, info.GetIsolate()); 1997 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->checkSecurityForNodeReadonlyDocumentAttribute(), exceptionState)) { 1998 v8SetReturnValueNull(info); 1999 exceptionState.throwIfNeeded(); 2000 return; 2001 } 2002 v8SetReturnValueFast(info, WTF::getPtr(impl->checkSecurityForNodeReadonlyDocumentAttribute()), impl); 2003 } 2004 2005 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2006 { 2007 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2008 TestObjectV8Internal::checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(info); 2009 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2010 } 2011 2012 #if ENABLE(CONDITION) 2013 static void conditionalLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2014 { 2015 v8::Handle<v8::Object> holder = info.Holder(); 2016 TestObject* impl = V8TestObject::toNative(holder); 2017 v8SetReturnValueInt(info, impl->conditionalLongAttribute()); 2018 } 2019 #endif // ENABLE(CONDITION) 2020 2021 #if ENABLE(CONDITION) 2022 static void conditionalLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2023 { 2024 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2025 TestObjectV8Internal::conditionalLongAttributeAttributeGetter(info); 2026 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2027 } 2028 #endif // ENABLE(CONDITION) 2029 2030 #if ENABLE(CONDITION) 2031 static void conditionalLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2032 { 2033 v8::Handle<v8::Object> holder = info.Holder(); 2034 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalLongAttribute", "TestObject", holder, info.GetIsolate()); 2035 TestObject* impl = V8TestObject::toNative(holder); 2036 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2037 impl->setConditionalLongAttribute(cppValue); 2038 } 2039 #endif // ENABLE(CONDITION) 2040 2041 #if ENABLE(CONDITION) 2042 static void conditionalLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2043 { 2044 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2045 TestObjectV8Internal::conditionalLongAttributeAttributeSetter(v8Value, info); 2046 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2047 } 2048 #endif // ENABLE(CONDITION) 2049 2050 #if ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 2051 static void conditionalAndLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2052 { 2053 v8::Handle<v8::Object> holder = info.Holder(); 2054 TestObject* impl = V8TestObject::toNative(holder); 2055 v8SetReturnValueInt(info, impl->conditionalAndLongAttribute()); 2056 } 2057 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 2058 2059 #if ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 2060 static void conditionalAndLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2061 { 2062 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2063 TestObjectV8Internal::conditionalAndLongAttributeAttributeGetter(info); 2064 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2065 } 2066 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 2067 2068 #if ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 2069 static void conditionalAndLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2070 { 2071 v8::Handle<v8::Object> holder = info.Holder(); 2072 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalAndLongAttribute", "TestObject", holder, info.GetIsolate()); 2073 TestObject* impl = V8TestObject::toNative(holder); 2074 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2075 impl->setConditionalAndLongAttribute(cppValue); 2076 } 2077 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 2078 2079 #if ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 2080 static void conditionalAndLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2081 { 2082 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2083 TestObjectV8Internal::conditionalAndLongAttributeAttributeSetter(v8Value, info); 2084 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2085 } 2086 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 2087 2088 #if ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 2089 static void conditionalOrLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2090 { 2091 v8::Handle<v8::Object> holder = info.Holder(); 2092 TestObject* impl = V8TestObject::toNative(holder); 2093 v8SetReturnValueInt(info, impl->conditionalOrLongAttribute()); 2094 } 2095 #endif // ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 2096 2097 #if ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 2098 static void conditionalOrLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2099 { 2100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2101 TestObjectV8Internal::conditionalOrLongAttributeAttributeGetter(info); 2102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2103 } 2104 #endif // ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 2105 2106 #if ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 2107 static void conditionalOrLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2108 { 2109 v8::Handle<v8::Object> holder = info.Holder(); 2110 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalOrLongAttribute", "TestObject", holder, info.GetIsolate()); 2111 TestObject* impl = V8TestObject::toNative(holder); 2112 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2113 impl->setConditionalOrLongAttribute(cppValue); 2114 } 2115 #endif // ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 2116 2117 #if ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 2118 static void conditionalOrLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2119 { 2120 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2121 TestObjectV8Internal::conditionalOrLongAttributeAttributeSetter(v8Value, info); 2122 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2123 } 2124 #endif // ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 2125 2126 static void customObjectAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2127 { 2128 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2129 V8TestObject::customObjectAttributeAttributeGetterCustom(info); 2130 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2131 } 2132 2133 static void customObjectAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2134 { 2135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2136 V8TestObject::customObjectAttributeAttributeSetterCustom(v8Value, info); 2137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2138 } 2139 2140 static void customGetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2141 { 2142 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2143 V8TestObject::customGetterLongAttributeAttributeGetterCustom(info); 2144 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2145 } 2146 2147 static void customGetterLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2148 { 2149 v8::Handle<v8::Object> holder = info.Holder(); 2150 ExceptionState exceptionState(ExceptionState::SetterContext, "customGetterLongAttribute", "TestObject", holder, info.GetIsolate()); 2151 TestObject* impl = V8TestObject::toNative(holder); 2152 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2153 impl->setCustomGetterLongAttribute(cppValue); 2154 } 2155 2156 static void customGetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2157 { 2158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2159 TestObjectV8Internal::customGetterLongAttributeAttributeSetter(v8Value, info); 2160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2161 } 2162 2163 static void customGetterReadonlyObjectAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2164 { 2165 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2166 V8TestObject::customGetterReadonlyObjectAttributeAttributeGetterCustom(info); 2167 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2168 } 2169 2170 static void customSetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2171 { 2172 v8::Handle<v8::Object> holder = info.Holder(); 2173 TestObject* impl = V8TestObject::toNative(holder); 2174 v8SetReturnValueInt(info, impl->customSetterLongAttribute()); 2175 } 2176 2177 static void customSetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2178 { 2179 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2180 TestObjectV8Internal::customSetterLongAttributeAttributeGetter(info); 2181 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2182 } 2183 2184 static void customSetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2185 { 2186 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2187 V8TestObject::customSetterLongAttributeAttributeSetterCustom(v8Value, info); 2188 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2189 } 2190 2191 #if ENABLE(CONDITION) 2192 static void customLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2193 { 2194 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2195 V8TestObject::customLongAttributeAttributeGetterCustom(info); 2196 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2197 } 2198 #endif // ENABLE(CONDITION) 2199 2200 #if ENABLE(CONDITION) 2201 static void customLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2202 { 2203 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2204 V8TestObject::customLongAttributeAttributeSetterCustom(v8Value, info); 2205 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2206 } 2207 #endif // ENABLE(CONDITION) 2208 2209 static void customElementsCallbacksReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2210 { 2211 v8::Handle<v8::Object> holder = info.Holder(); 2212 TestObject* impl = V8TestObject::toNative(holder); 2213 v8SetReturnValueInt(info, impl->customElementsCallbacksReadonlyLongAttribute()); 2214 } 2215 2216 static void customElementsCallbacksReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2217 { 2218 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2219 TestObjectV8Internal::customElementsCallbacksReadonlyLongAttributeAttributeGetter(info); 2220 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2221 } 2222 2223 static void deprecatedLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2224 { 2225 v8::Handle<v8::Object> holder = info.Holder(); 2226 TestObject* impl = V8TestObject::toNative(holder); 2227 v8SetReturnValueInt(info, impl->deprecatedLongAttribute()); 2228 } 2229 2230 static void deprecatedLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2231 { 2232 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2233 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::LongAttribute); 2234 TestObjectV8Internal::deprecatedLongAttributeAttributeGetter(info); 2235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2236 } 2237 2238 static void deprecatedLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2239 { 2240 v8::Handle<v8::Object> holder = info.Holder(); 2241 ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedLongAttribute", "TestObject", holder, info.GetIsolate()); 2242 TestObject* impl = V8TestObject::toNative(holder); 2243 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2244 impl->setDeprecatedLongAttribute(cppValue); 2245 } 2246 2247 static void deprecatedLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2248 { 2249 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2250 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::LongAttribute); 2251 TestObjectV8Internal::deprecatedLongAttributeAttributeSetter(v8Value, info); 2252 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2253 } 2254 2255 static void enforceRangeLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2256 { 2257 v8::Handle<v8::Object> holder = info.Holder(); 2258 TestObject* impl = V8TestObject::toNative(holder); 2259 v8SetReturnValueInt(info, impl->enforceRangeLongAttribute()); 2260 } 2261 2262 static void enforceRangeLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2263 { 2264 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2265 TestObjectV8Internal::enforceRangeLongAttributeAttributeGetter(info); 2266 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2267 } 2268 2269 static void enforceRangeLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2270 { 2271 v8::Handle<v8::Object> holder = info.Holder(); 2272 ExceptionState exceptionState(ExceptionState::SetterContext, "enforceRangeLongAttribute", "TestObject", holder, info.GetIsolate()); 2273 TestObject* impl = V8TestObject::toNative(holder); 2274 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, EnforceRange, exceptionState), exceptionState); 2275 impl->setEnforceRangeLongAttribute(cppValue); 2276 } 2277 2278 static void enforceRangeLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2279 { 2280 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2281 TestObjectV8Internal::enforceRangeLongAttributeAttributeSetter(v8Value, info); 2282 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2283 } 2284 2285 static void exposeJSAccessorsLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) 2286 { 2287 v8::Handle<v8::Object> holder = info.Holder(); 2288 TestObject* impl = V8TestObject::toNative(holder); 2289 v8SetReturnValueInt(info, impl->exposeJSAccessorsLongAttribute()); 2290 } 2291 2292 static void exposeJSAccessorsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 2293 { 2294 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2295 TestObjectV8Internal::exposeJSAccessorsLongAttributeAttributeGetter(info); 2296 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2297 } 2298 2299 static void exposeJSAccessorsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 2300 { 2301 v8::Handle<v8::Object> holder = info.Holder(); 2302 ExceptionState exceptionState(ExceptionState::SetterContext, "exposeJSAccessorsLongAttribute", "TestObject", holder, info.GetIsolate()); 2303 TestObject* impl = V8TestObject::toNative(holder); 2304 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2305 impl->setExposeJSAccessorsLongAttribute(cppValue); 2306 } 2307 2308 static void exposeJSAccessorsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 2309 { 2310 v8::Local<v8::Value> v8Value = info[0]; 2311 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2312 TestObjectV8Internal::exposeJSAccessorsLongAttributeAttributeSetter(v8Value, info); 2313 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2314 } 2315 2316 static void implementedAsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2317 { 2318 v8::Handle<v8::Object> holder = info.Holder(); 2319 TestObject* impl = V8TestObject::toNative(holder); 2320 v8SetReturnValueInt(info, impl->implementedAsName()); 2321 } 2322 2323 static void implementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2324 { 2325 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2326 TestObjectV8Internal::implementedAsLongAttributeAttributeGetter(info); 2327 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2328 } 2329 2330 static void implementedAsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2331 { 2332 v8::Handle<v8::Object> holder = info.Holder(); 2333 ExceptionState exceptionState(ExceptionState::SetterContext, "implementedAsLongAttribute", "TestObject", holder, info.GetIsolate()); 2334 TestObject* impl = V8TestObject::toNative(holder); 2335 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2336 impl->setImplementedAsName(cppValue); 2337 } 2338 2339 static void implementedAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2340 { 2341 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2342 TestObjectV8Internal::implementedAsLongAttributeAttributeSetter(v8Value, info); 2343 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2344 } 2345 2346 static void customImplementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2347 { 2348 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2349 V8TestObject::customImplementedAsLongAttributeAttributeGetterCustom(info); 2350 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2351 } 2352 2353 static void customImplementedAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2354 { 2355 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2356 V8TestObject::customImplementedAsLongAttributeAttributeSetterCustom(v8Value, info); 2357 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2358 } 2359 2360 static void customGetterImplementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2361 { 2362 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2363 V8TestObject::customGetterImplementedAsLongAttributeAttributeGetterCustom(info); 2364 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2365 } 2366 2367 static void customGetterImplementedAsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2368 { 2369 v8::Handle<v8::Object> holder = info.Holder(); 2370 ExceptionState exceptionState(ExceptionState::SetterContext, "customGetterImplementedAsLongAttribute", "TestObject", holder, info.GetIsolate()); 2371 TestObject* impl = V8TestObject::toNative(holder); 2372 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2373 impl->setImplementedAsNameWithCustomGetter(cppValue); 2374 } 2375 2376 static void customGetterImplementedAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2377 { 2378 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2379 TestObjectV8Internal::customGetterImplementedAsLongAttributeAttributeSetter(v8Value, info); 2380 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2381 } 2382 2383 static void customSetterImplementedAsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2384 { 2385 v8::Handle<v8::Object> holder = info.Holder(); 2386 TestObject* impl = V8TestObject::toNative(holder); 2387 v8SetReturnValueInt(info, impl->implementedAsNameWithCustomGetter()); 2388 } 2389 2390 static void customSetterImplementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2391 { 2392 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2393 TestObjectV8Internal::customSetterImplementedAsLongAttributeAttributeGetter(info); 2394 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2395 } 2396 2397 static void customSetterImplementedAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2398 { 2399 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2400 V8TestObject::customSetterImplementedAsLongAttributeAttributeSetterCustom(v8Value, info); 2401 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2402 } 2403 2404 static void measureAsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2405 { 2406 v8::Handle<v8::Object> holder = info.Holder(); 2407 TestObject* impl = V8TestObject::toNative(holder); 2408 v8SetReturnValueInt(info, impl->measureAsLongAttribute()); 2409 } 2410 2411 static void measureAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2412 { 2413 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2414 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 2415 TestObjectV8Internal::measureAsLongAttributeAttributeGetter(info); 2416 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2417 } 2418 2419 static void measureAsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2420 { 2421 v8::Handle<v8::Object> holder = info.Holder(); 2422 ExceptionState exceptionState(ExceptionState::SetterContext, "measureAsLongAttribute", "TestObject", holder, info.GetIsolate()); 2423 TestObject* impl = V8TestObject::toNative(holder); 2424 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2425 impl->setMeasureAsLongAttribute(cppValue); 2426 } 2427 2428 static void measureAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2429 { 2430 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2431 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 2432 TestObjectV8Internal::measureAsLongAttributeAttributeSetter(v8Value, info); 2433 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2434 } 2435 2436 static void notEnumerableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2437 { 2438 v8::Handle<v8::Object> holder = info.Holder(); 2439 TestObject* impl = V8TestObject::toNative(holder); 2440 v8SetReturnValueInt(info, impl->notEnumerableLongAttribute()); 2441 } 2442 2443 static void notEnumerableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2444 { 2445 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2446 TestObjectV8Internal::notEnumerableLongAttributeAttributeGetter(info); 2447 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2448 } 2449 2450 static void notEnumerableLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2451 { 2452 v8::Handle<v8::Object> holder = info.Holder(); 2453 ExceptionState exceptionState(ExceptionState::SetterContext, "notEnumerableLongAttribute", "TestObject", holder, info.GetIsolate()); 2454 TestObject* impl = V8TestObject::toNative(holder); 2455 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2456 impl->setNotEnumerableLongAttribute(cppValue); 2457 } 2458 2459 static void notEnumerableLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2460 { 2461 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2462 TestObjectV8Internal::notEnumerableLongAttributeAttributeSetter(v8Value, info); 2463 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2464 } 2465 2466 static void perContextEnabledLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2467 { 2468 v8::Handle<v8::Object> holder = info.Holder(); 2469 TestObject* impl = V8TestObject::toNative(holder); 2470 v8SetReturnValueInt(info, impl->perContextEnabledLongAttribute()); 2471 } 2472 2473 static void perContextEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2474 { 2475 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2476 TestObjectV8Internal::perContextEnabledLongAttributeAttributeGetter(info); 2477 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2478 } 2479 2480 static void perContextEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2481 { 2482 v8::Handle<v8::Object> holder = info.Holder(); 2483 ExceptionState exceptionState(ExceptionState::SetterContext, "perContextEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); 2484 TestObject* impl = V8TestObject::toNative(holder); 2485 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2486 impl->setPerContextEnabledLongAttribute(cppValue); 2487 } 2488 2489 static void perContextEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2490 { 2491 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2492 TestObjectV8Internal::perContextEnabledLongAttributeAttributeSetter(v8Value, info); 2493 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2494 } 2495 2496 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2497 { 2498 v8::Handle<v8::Object> holder = info.Holder(); 2499 TestObject* impl = V8TestObject::toNative(holder); 2500 RefPtr<TestInterfaceEmpty> result(impl->perWorldBindingsReadonlyTestInterfaceEmptyAttribute()); 2501 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEmpty>(info.GetReturnValue(), result.get())) 2502 return; 2503 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate()); 2504 if (!wrapper.IsEmpty()) { 2505 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "perWorldBindingsReadonlyTestInterfaceEmptyAttribute"), wrapper); 2506 v8SetReturnValue(info, wrapper); 2507 } 2508 } 2509 2510 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2511 { 2512 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2513 TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(info); 2514 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2515 } 2516 2517 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2518 { 2519 v8::Handle<v8::Object> holder = info.Holder(); 2520 TestObject* impl = V8TestObject::toNative(holder); 2521 RefPtr<TestInterfaceEmpty> result(impl->perWorldBindingsReadonlyTestInterfaceEmptyAttribute()); 2522 if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceEmpty>(info.GetReturnValue(), result.get())) 2523 return; 2524 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate()); 2525 if (!wrapper.IsEmpty()) { 2526 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "perWorldBindingsReadonlyTestInterfaceEmptyAttribute"), wrapper); 2527 v8SetReturnValue(info, wrapper); 2528 } 2529 } 2530 2531 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2532 { 2533 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2534 TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterForMainWorld(info); 2535 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2536 } 2537 2538 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2539 { 2540 v8::Handle<v8::Object> holder = info.Holder(); 2541 TestObject* impl = V8TestObject::toNative(holder); 2542 v8SetReturnValueInt(info, impl->activityLoggingAccessPerWorldBindingsLongAttribute()); 2543 } 2544 2545 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2546 { 2547 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2548 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2549 V8PerContextData* contextData = scriptState->perContextData(); 2550 if (contextData && contextData->activityLogger()) 2551 contextData->activityLogger()->logGetter("TestObject.activityLoggingAccessPerWorldBindingsLongAttribute"); 2552 TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetter(info); 2553 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2554 } 2555 2556 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2557 { 2558 v8::Handle<v8::Object> holder = info.Holder(); 2559 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2560 TestObject* impl = V8TestObject::toNative(holder); 2561 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2562 impl->setActivityLoggingAccessPerWorldBindingsLongAttribute(cppValue); 2563 } 2564 2565 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2566 { 2567 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2568 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2569 V8PerContextData* contextData = scriptState->perContextData(); 2570 if (contextData && contextData->activityLogger()) { 2571 contextData->activityLogger()->logSetter("TestObject.activityLoggingAccessPerWorldBindingsLongAttribute", v8Value); 2572 } 2573 TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); 2574 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2575 } 2576 2577 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2578 { 2579 v8::Handle<v8::Object> holder = info.Holder(); 2580 TestObject* impl = V8TestObject::toNative(holder); 2581 v8SetReturnValueInt(info, impl->activityLoggingAccessPerWorldBindingsLongAttribute()); 2582 } 2583 2584 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2585 { 2586 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2587 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2588 V8PerContextData* contextData = scriptState->perContextData(); 2589 if (contextData && contextData->activityLogger()) 2590 contextData->activityLogger()->logGetter("TestObject.activityLoggingAccessPerWorldBindingsLongAttribute"); 2591 TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); 2592 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2593 } 2594 2595 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2596 { 2597 v8::Handle<v8::Object> holder = info.Holder(); 2598 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2599 TestObject* impl = V8TestObject::toNative(holder); 2600 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2601 impl->setActivityLoggingAccessPerWorldBindingsLongAttribute(cppValue); 2602 } 2603 2604 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2605 { 2606 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2607 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2608 V8PerContextData* contextData = scriptState->perContextData(); 2609 if (contextData && contextData->activityLogger()) { 2610 contextData->activityLogger()->logSetter("TestObject.activityLoggingAccessPerWorldBindingsLongAttribute", v8Value); 2611 } 2612 TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); 2613 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2614 } 2615 2616 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2617 { 2618 v8::Handle<v8::Object> holder = info.Holder(); 2619 TestObject* impl = V8TestObject::toNative(holder); 2620 v8SetReturnValueInt(info, impl->activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute()); 2621 } 2622 2623 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2624 { 2625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2626 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2627 V8PerContextData* contextData = scriptState->perContextData(); 2628 if (contextData && contextData->activityLogger()) 2629 contextData->activityLogger()->logGetter("TestObject.activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute"); 2630 TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetter(info); 2631 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2632 } 2633 2634 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2635 { 2636 v8::Handle<v8::Object> holder = info.Holder(); 2637 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2638 TestObject* impl = V8TestObject::toNative(holder); 2639 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2640 impl->setActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue); 2641 } 2642 2643 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2644 { 2645 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2646 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2647 V8PerContextData* contextData = scriptState->perContextData(); 2648 if (contextData && contextData->activityLogger()) { 2649 contextData->activityLogger()->logSetter("TestObject.activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", v8Value); 2650 } 2651 TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); 2652 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2653 } 2654 2655 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2656 { 2657 v8::Handle<v8::Object> holder = info.Holder(); 2658 TestObject* impl = V8TestObject::toNative(holder); 2659 v8SetReturnValueInt(info, impl->activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute()); 2660 } 2661 2662 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2663 { 2664 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2665 TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); 2666 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2667 } 2668 2669 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2670 { 2671 v8::Handle<v8::Object> holder = info.Holder(); 2672 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2673 TestObject* impl = V8TestObject::toNative(holder); 2674 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2675 impl->setActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue); 2676 } 2677 2678 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2679 { 2680 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2681 TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); 2682 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2683 } 2684 2685 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2686 { 2687 v8::Handle<v8::Object> holder = info.Holder(); 2688 TestObject* impl = V8TestObject::toNative(holder); 2689 v8SetReturnValueInt(info, impl->activityLoggingGetterPerWorldBindingsLongAttribute()); 2690 } 2691 2692 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2693 { 2694 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2695 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2696 V8PerContextData* contextData = scriptState->perContextData(); 2697 if (contextData && contextData->activityLogger()) 2698 contextData->activityLogger()->logGetter("TestObject.activityLoggingGetterPerWorldBindingsLongAttribute"); 2699 TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetter(info); 2700 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2701 } 2702 2703 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2704 { 2705 v8::Handle<v8::Object> holder = info.Holder(); 2706 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2707 TestObject* impl = V8TestObject::toNative(holder); 2708 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2709 impl->setActivityLoggingGetterPerWorldBindingsLongAttribute(cppValue); 2710 } 2711 2712 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2713 { 2714 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2715 TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); 2716 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2717 } 2718 2719 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2720 { 2721 v8::Handle<v8::Object> holder = info.Holder(); 2722 TestObject* impl = V8TestObject::toNative(holder); 2723 v8SetReturnValueInt(info, impl->activityLoggingGetterPerWorldBindingsLongAttribute()); 2724 } 2725 2726 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2727 { 2728 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2729 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2730 V8PerContextData* contextData = scriptState->perContextData(); 2731 if (contextData && contextData->activityLogger()) 2732 contextData->activityLogger()->logGetter("TestObject.activityLoggingGetterPerWorldBindingsLongAttribute"); 2733 TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); 2734 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2735 } 2736 2737 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2738 { 2739 v8::Handle<v8::Object> holder = info.Holder(); 2740 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2741 TestObject* impl = V8TestObject::toNative(holder); 2742 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2743 impl->setActivityLoggingGetterPerWorldBindingsLongAttribute(cppValue); 2744 } 2745 2746 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2747 { 2748 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2749 TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); 2750 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2751 } 2752 2753 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2754 { 2755 v8::Handle<v8::Object> holder = info.Holder(); 2756 TestObject* impl = V8TestObject::toNative(holder); 2757 v8SetReturnValueInt(info, impl->activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute()); 2758 } 2759 2760 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2761 { 2762 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2763 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2764 V8PerContextData* contextData = scriptState->perContextData(); 2765 if (contextData && contextData->activityLogger()) 2766 contextData->activityLogger()->logGetter("TestObject.activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute"); 2767 TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetter(info); 2768 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2769 } 2770 2771 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2772 { 2773 v8::Handle<v8::Object> holder = info.Holder(); 2774 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2775 TestObject* impl = V8TestObject::toNative(holder); 2776 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2777 impl->setActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue); 2778 } 2779 2780 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2781 { 2782 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2783 TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); 2784 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2785 } 2786 2787 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2788 { 2789 v8::Handle<v8::Object> holder = info.Holder(); 2790 TestObject* impl = V8TestObject::toNative(holder); 2791 v8SetReturnValueInt(info, impl->activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute()); 2792 } 2793 2794 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2795 { 2796 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2797 TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); 2798 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2799 } 2800 2801 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2802 { 2803 v8::Handle<v8::Object> holder = info.Holder(); 2804 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2805 TestObject* impl = V8TestObject::toNative(holder); 2806 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2807 impl->setActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue); 2808 } 2809 2810 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2811 { 2812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2813 TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); 2814 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2815 } 2816 2817 static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2818 { 2819 v8::Handle<v8::Object> holder = info.Holder(); 2820 TestObject* impl = V8TestObject::toNative(holder); 2821 v8SetReturnValueFast(info, WTF::getPtr(impl->location()), impl); 2822 } 2823 2824 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2825 { 2826 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2827 TestObjectV8Internal::locationAttributeGetter(info); 2828 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2829 } 2830 2831 static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2832 { 2833 v8::Handle<v8::Object> holder = info.Holder(); 2834 TestObject* proxyImpl = V8TestObject::toNative(holder); 2835 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->location()); 2836 if (!impl) 2837 return; 2838 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2839 impl->setHref(cppValue); 2840 } 2841 2842 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2843 { 2844 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2845 TestObjectV8Internal::locationAttributeSetter(v8Value, info); 2846 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2847 } 2848 2849 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2850 { 2851 v8::Handle<v8::Object> holder = info.Holder(); 2852 TestObject* impl = V8TestObject::toNative(holder); 2853 v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithException()), impl); 2854 } 2855 2856 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2857 { 2858 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2859 TestObjectV8Internal::locationWithExceptionAttributeGetter(info); 2860 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2861 } 2862 2863 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2864 { 2865 v8::Handle<v8::Object> holder = info.Holder(); 2866 TestObject* proxyImpl = V8TestObject::toNative(holder); 2867 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithException()); 2868 if (!impl) 2869 return; 2870 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2871 impl->setHrefThrows(cppValue); 2872 } 2873 2874 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2875 { 2876 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2877 TestObjectV8Internal::locationWithExceptionAttributeSetter(v8Value, info); 2878 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2879 } 2880 2881 static void locationWithCallWithAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2882 { 2883 v8::Handle<v8::Object> holder = info.Holder(); 2884 TestObject* impl = V8TestObject::toNative(holder); 2885 v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithCallWith()), impl); 2886 } 2887 2888 static void locationWithCallWithAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2889 { 2890 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2891 TestObjectV8Internal::locationWithCallWithAttributeGetter(info); 2892 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2893 } 2894 2895 static void locationWithCallWithAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2896 { 2897 v8::Handle<v8::Object> holder = info.Holder(); 2898 TestObject* proxyImpl = V8TestObject::toNative(holder); 2899 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithCallWith()); 2900 if (!impl) 2901 return; 2902 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2903 impl->setHrefCallWith(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), cppValue); 2904 } 2905 2906 static void locationWithCallWithAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2907 { 2908 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2909 TestObjectV8Internal::locationWithCallWithAttributeSetter(v8Value, info); 2910 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2911 } 2912 2913 static void locationWithPerWorldBindingsAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2914 { 2915 v8::Handle<v8::Object> holder = info.Holder(); 2916 TestObject* impl = V8TestObject::toNative(holder); 2917 v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithPerWorldBindings()), impl); 2918 } 2919 2920 static void locationWithPerWorldBindingsAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2921 { 2922 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2923 TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetter(info); 2924 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2925 } 2926 2927 static void locationWithPerWorldBindingsAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2928 { 2929 v8::Handle<v8::Object> holder = info.Holder(); 2930 TestObject* proxyImpl = V8TestObject::toNative(holder); 2931 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithPerWorldBindings()); 2932 if (!impl) 2933 return; 2934 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2935 impl->setHref(cppValue); 2936 } 2937 2938 static void locationWithPerWorldBindingsAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2939 { 2940 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2941 TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetter(v8Value, info); 2942 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2943 } 2944 2945 static void locationWithPerWorldBindingsAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2946 { 2947 v8::Handle<v8::Object> holder = info.Holder(); 2948 TestObject* impl = V8TestObject::toNative(holder); 2949 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->locationWithPerWorldBindings())); 2950 } 2951 2952 static void locationWithPerWorldBindingsAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2953 { 2954 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2955 TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetterForMainWorld(info); 2956 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2957 } 2958 2959 static void locationWithPerWorldBindingsAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2960 { 2961 v8::Handle<v8::Object> holder = info.Holder(); 2962 TestObject* proxyImpl = V8TestObject::toNative(holder); 2963 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithPerWorldBindings()); 2964 if (!impl) 2965 return; 2966 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2967 impl->setHref(cppValue); 2968 } 2969 2970 static void locationWithPerWorldBindingsAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2971 { 2972 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2973 TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetterForMainWorld(v8Value, info); 2974 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2975 } 2976 2977 static void locationGarbageCollectedAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2978 { 2979 v8::Handle<v8::Object> holder = info.Holder(); 2980 TestObject* impl = V8TestObject::toNative(holder); 2981 RawPtr<TestInterfaceGarbageCollected> result(impl->locationGarbageCollected()); 2982 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceGarbageCollected>(info.GetReturnValue(), result.get())) 2983 return; 2984 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate()); 2985 if (!wrapper.IsEmpty()) { 2986 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "locationGarbageCollected"), wrapper); 2987 v8SetReturnValue(info, wrapper); 2988 } 2989 } 2990 2991 static void locationGarbageCollectedAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2992 { 2993 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2994 TestObjectV8Internal::locationGarbageCollectedAttributeGetter(info); 2995 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 2996 } 2997 2998 static void locationGarbageCollectedAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2999 { 3000 v8::Handle<v8::Object> holder = info.Holder(); 3001 TestObject* proxyImpl = V8TestObject::toNative(holder); 3002 RawPtr<TestInterfaceGarbageCollected> impl = WTF::getPtr(proxyImpl->locationGarbageCollected()); 3003 if (!impl) 3004 return; 3005 TONATIVE_VOID(TestInterfaceGarbageCollected*, cppValue, V8TestInterfaceGarbageCollected::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 3006 impl->setAttr1(WTF::getPtr(cppValue)); 3007 } 3008 3009 static void locationGarbageCollectedAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3010 { 3011 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3012 TestObjectV8Internal::locationGarbageCollectedAttributeSetter(v8Value, info); 3013 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3014 } 3015 3016 static void locationWillBeGarbageCollectedAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3017 { 3018 v8::Handle<v8::Object> holder = info.Holder(); 3019 TestObject* impl = V8TestObject::toNative(holder); 3020 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> result(impl->locationWillBeGarbageCollected()); 3021 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceWillBeGarbageCollected>(info.GetReturnValue(), result.get())) 3022 return; 3023 v8::Handle<v8::Value> wrapper = toV8(result.get(), holder, info.GetIsolate()); 3024 if (!wrapper.IsEmpty()) { 3025 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "locationWillBeGarbageCollected"), wrapper); 3026 v8SetReturnValue(info, wrapper); 3027 } 3028 } 3029 3030 static void locationWillBeGarbageCollectedAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3031 { 3032 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3033 TestObjectV8Internal::locationWillBeGarbageCollectedAttributeGetter(info); 3034 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3035 } 3036 3037 static void locationWillBeGarbageCollectedAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3038 { 3039 v8::Handle<v8::Object> holder = info.Holder(); 3040 TestObject* proxyImpl = V8TestObject::toNative(holder); 3041 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = WTF::getPtr(proxyImpl->locationWillBeGarbageCollected()); 3042 if (!impl) 3043 return; 3044 TONATIVE_VOID(TestInterfaceWillBeGarbageCollected*, cppValue, V8TestInterfaceWillBeGarbageCollected::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 3045 impl->setAttr1(WTF::getPtr(cppValue)); 3046 } 3047 3048 static void locationWillBeGarbageCollectedAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3049 { 3050 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3051 TestObjectV8Internal::locationWillBeGarbageCollectedAttributeSetter(v8Value, info); 3052 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3053 } 3054 3055 static void raisesExceptionLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3056 { 3057 v8::Handle<v8::Object> holder = info.Holder(); 3058 TestObject* impl = V8TestObject::toNative(holder); 3059 ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate()); 3060 int v8Value = impl->raisesExceptionLongAttribute(exceptionState); 3061 if (UNLIKELY(exceptionState.throwIfNeeded())) 3062 return; 3063 v8SetReturnValueInt(info, v8Value); 3064 } 3065 3066 static void raisesExceptionLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3067 { 3068 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3069 TestObjectV8Internal::raisesExceptionLongAttributeAttributeGetter(info); 3070 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3071 } 3072 3073 static void raisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3074 { 3075 v8::Handle<v8::Object> holder = info.Holder(); 3076 ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate()); 3077 TestObject* impl = V8TestObject::toNative(holder); 3078 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3079 impl->setRaisesExceptionLongAttribute(cppValue, exceptionState); 3080 exceptionState.throwIfNeeded(); 3081 } 3082 3083 static void raisesExceptionLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3084 { 3085 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3086 TestObjectV8Internal::raisesExceptionLongAttributeAttributeSetter(v8Value, info); 3087 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3088 } 3089 3090 static void raisesExceptionGetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3091 { 3092 v8::Handle<v8::Object> holder = info.Holder(); 3093 TestObject* impl = V8TestObject::toNative(holder); 3094 ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionGetterLongAttribute", "TestObject", holder, info.GetIsolate()); 3095 int v8Value = impl->raisesExceptionGetterLongAttribute(exceptionState); 3096 if (UNLIKELY(exceptionState.throwIfNeeded())) 3097 return; 3098 v8SetReturnValueInt(info, v8Value); 3099 } 3100 3101 static void raisesExceptionGetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3102 { 3103 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3104 TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeGetter(info); 3105 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3106 } 3107 3108 static void raisesExceptionGetterLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3109 { 3110 v8::Handle<v8::Object> holder = info.Holder(); 3111 ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionGetterLongAttribute", "TestObject", holder, info.GetIsolate()); 3112 TestObject* impl = V8TestObject::toNative(holder); 3113 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3114 impl->setRaisesExceptionGetterLongAttribute(cppValue); 3115 } 3116 3117 static void raisesExceptionGetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3118 { 3119 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3120 TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeSetter(v8Value, info); 3121 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3122 } 3123 3124 static void setterRaisesExceptionLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3125 { 3126 v8::Handle<v8::Object> holder = info.Holder(); 3127 TestObject* impl = V8TestObject::toNative(holder); 3128 v8SetReturnValueInt(info, impl->setterRaisesExceptionLongAttribute()); 3129 } 3130 3131 static void setterRaisesExceptionLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3132 { 3133 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3134 TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeGetter(info); 3135 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3136 } 3137 3138 static void setterRaisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3139 { 3140 v8::Handle<v8::Object> holder = info.Holder(); 3141 ExceptionState exceptionState(ExceptionState::SetterContext, "setterRaisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate()); 3142 TestObject* impl = V8TestObject::toNative(holder); 3143 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3144 impl->setSetterRaisesExceptionLongAttribute(cppValue, exceptionState); 3145 exceptionState.throwIfNeeded(); 3146 } 3147 3148 static void setterRaisesExceptionLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3149 { 3150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3151 TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeSetter(v8Value, info); 3152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3153 } 3154 3155 static void raisesExceptionTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3156 { 3157 v8::Handle<v8::Object> holder = info.Holder(); 3158 TestObject* impl = V8TestObject::toNative(holder); 3159 ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionTestInterfaceEmptyAttribute", "TestObject", holder, info.GetIsolate()); 3160 RefPtr<TestInterfaceEmpty> v8Value = impl->raisesExceptionTestInterfaceEmptyAttribute(exceptionState); 3161 if (UNLIKELY(exceptionState.throwIfNeeded())) 3162 return; 3163 v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); 3164 } 3165 3166 static void raisesExceptionTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3167 { 3168 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3169 TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeGetter(info); 3170 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3171 } 3172 3173 static void raisesExceptionTestInterfaceEmptyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3174 { 3175 v8::Handle<v8::Object> holder = info.Holder(); 3176 ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionTestInterfaceEmptyAttribute", "TestObject", holder, info.GetIsolate()); 3177 TestObject* impl = V8TestObject::toNative(holder); 3178 TONATIVE_VOID(TestInterfaceEmpty*, cppValue, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 3179 impl->setRaisesExceptionTestInterfaceEmptyAttribute(WTF::getPtr(cppValue), exceptionState); 3180 exceptionState.throwIfNeeded(); 3181 } 3182 3183 static void raisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3184 { 3185 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3186 TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeSetter(v8Value, info); 3187 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3188 } 3189 3190 static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3191 { 3192 v8::Handle<v8::Object> holder = info.Holder(); 3193 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedAttributeRaisesExceptionGetterAnyAttribute"); 3194 TestObject* impl = V8TestObject::toNative(holder); 3195 if (!impl->isValueDirty()) { 3196 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); 3197 if (!v8Value.IsEmpty()) { 3198 v8SetReturnValue(info, v8Value); 3199 return; 3200 } 3201 } 3202 ExceptionState exceptionState(ExceptionState::GetterContext, "cachedAttributeRaisesExceptionGetterAnyAttribute", "TestObject", holder, info.GetIsolate()); 3203 ScriptValue v8Value = impl->cachedAttributeRaisesExceptionGetterAnyAttribute(exceptionState); 3204 if (UNLIKELY(exceptionState.throwIfNeeded())) 3205 return; 3206 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value.v8Value()); 3207 v8SetReturnValue(info, v8Value.v8Value()); 3208 } 3209 3210 static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3211 { 3212 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3213 TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetter(info); 3214 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3215 } 3216 3217 static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3218 { 3219 v8::Handle<v8::Object> holder = info.Holder(); 3220 ExceptionState exceptionState(ExceptionState::SetterContext, "cachedAttributeRaisesExceptionGetterAnyAttribute", "TestObject", holder, info.GetIsolate()); 3221 TestObject* impl = V8TestObject::toNative(holder); 3222 TONATIVE_VOID(ScriptValue, cppValue, ScriptValue(ScriptState::current(info.GetIsolate()), v8Value)); 3223 impl->setCachedAttributeRaisesExceptionGetterAnyAttribute(cppValue, exceptionState); 3224 exceptionState.throwIfNeeded(); 3225 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "cachedAttributeRaisesExceptionGetterAnyAttribute")); // Invalidate the cached value. 3226 } 3227 3228 static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3229 { 3230 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3231 TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetter(v8Value, info); 3232 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3233 } 3234 3235 static void reflectTestInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3236 { 3237 v8::Handle<v8::Object> holder = info.Holder(); 3238 TestObject* impl = V8TestObject::toNative(holder); 3239 v8SetReturnValueFast(info, WTF::getPtr(impl->fastGetAttribute(HTMLNames::reflecttestinterfaceattributeAttr)), impl); 3240 } 3241 3242 static void reflectTestInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3243 { 3244 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3245 TestObjectV8Internal::reflectTestInterfaceAttributeAttributeGetter(info); 3246 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3247 } 3248 3249 static void reflectTestInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3250 { 3251 v8::Handle<v8::Object> holder = info.Holder(); 3252 TestObject* impl = V8TestObject::toNative(holder); 3253 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 3254 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3255 impl->setAttribute(HTMLNames::reflecttestinterfaceattributeAttr, WTF::getPtr(cppValue)); 3256 } 3257 3258 static void reflectTestInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3259 { 3260 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3261 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3262 TestObjectV8Internal::reflectTestInterfaceAttributeAttributeSetter(v8Value, info); 3263 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3264 } 3265 3266 static void reflectReflectedNameAttributeTestAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3267 { 3268 v8::Handle<v8::Object> holder = info.Holder(); 3269 TestObject* impl = V8TestObject::toNative(holder); 3270 v8SetReturnValueFast(info, WTF::getPtr(impl->fastGetAttribute(HTMLNames::reflectedNameAttributeAttr)), impl); 3271 } 3272 3273 static void reflectReflectedNameAttributeTestAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3274 { 3275 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3276 TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeGetter(info); 3277 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3278 } 3279 3280 static void reflectReflectedNameAttributeTestAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3281 { 3282 v8::Handle<v8::Object> holder = info.Holder(); 3283 TestObject* impl = V8TestObject::toNative(holder); 3284 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 3285 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3286 impl->setAttribute(HTMLNames::reflectedNameAttributeAttr, WTF::getPtr(cppValue)); 3287 } 3288 3289 static void reflectReflectedNameAttributeTestAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3290 { 3291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3292 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3293 TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeSetter(v8Value, info); 3294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3295 } 3296 3297 static void reflectBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3298 { 3299 v8::Handle<v8::Object> holder = info.Holder(); 3300 TestObject* impl = V8TestObject::toNative(holder); 3301 v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::reflectbooleanattributeAttr)); 3302 } 3303 3304 static void reflectBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3305 { 3306 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3307 TestObjectV8Internal::reflectBooleanAttributeAttributeGetter(info); 3308 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3309 } 3310 3311 static void reflectBooleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3312 { 3313 v8::Handle<v8::Object> holder = info.Holder(); 3314 TestObject* impl = V8TestObject::toNative(holder); 3315 TONATIVE_VOID(bool, cppValue, v8Value->BooleanValue()); 3316 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3317 impl->setBooleanAttribute(HTMLNames::reflectbooleanattributeAttr, cppValue); 3318 } 3319 3320 static void reflectBooleanAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3321 { 3322 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3323 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3324 TestObjectV8Internal::reflectBooleanAttributeAttributeSetter(v8Value, info); 3325 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3326 } 3327 3328 static void reflectLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3329 { 3330 v8::Handle<v8::Object> holder = info.Holder(); 3331 TestObject* impl = V8TestObject::toNative(holder); 3332 v8SetReturnValueInt(info, impl->getIntegralAttribute(HTMLNames::reflectlongattributeAttr)); 3333 } 3334 3335 static void reflectLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3336 { 3337 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3338 TestObjectV8Internal::reflectLongAttributeAttributeGetter(info); 3339 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3340 } 3341 3342 static void reflectLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3343 { 3344 v8::Handle<v8::Object> holder = info.Holder(); 3345 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectLongAttribute", "TestObject", holder, info.GetIsolate()); 3346 TestObject* impl = V8TestObject::toNative(holder); 3347 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3348 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3349 impl->setIntegralAttribute(HTMLNames::reflectlongattributeAttr, cppValue); 3350 } 3351 3352 static void reflectLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3353 { 3354 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3355 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3356 TestObjectV8Internal::reflectLongAttributeAttributeSetter(v8Value, info); 3357 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3358 } 3359 3360 static void reflectUnsignedShortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3361 { 3362 v8::Handle<v8::Object> holder = info.Holder(); 3363 TestObject* impl = V8TestObject::toNative(holder); 3364 v8SetReturnValueUnsigned(info, std::max(0, impl->fastGetAttribute(HTMLNames::reflectunsignedshortattributeAttr))); 3365 } 3366 3367 static void reflectUnsignedShortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3368 { 3369 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3370 TestObjectV8Internal::reflectUnsignedShortAttributeAttributeGetter(info); 3371 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3372 } 3373 3374 static void reflectUnsignedShortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3375 { 3376 v8::Handle<v8::Object> holder = info.Holder(); 3377 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectUnsignedShortAttribute", "TestObject", holder, info.GetIsolate()); 3378 TestObject* impl = V8TestObject::toNative(holder); 3379 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt16(v8Value, exceptionState), exceptionState); 3380 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3381 impl->setAttribute(HTMLNames::reflectunsignedshortattributeAttr, cppValue); 3382 } 3383 3384 static void reflectUnsignedShortAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3385 { 3386 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3387 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3388 TestObjectV8Internal::reflectUnsignedShortAttributeAttributeSetter(v8Value, info); 3389 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3390 } 3391 3392 static void reflectUnsignedLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3393 { 3394 v8::Handle<v8::Object> holder = info.Holder(); 3395 TestObject* impl = V8TestObject::toNative(holder); 3396 v8SetReturnValueUnsigned(info, std::max(0, impl->getIntegralAttribute(HTMLNames::reflectunsignedlongattributeAttr))); 3397 } 3398 3399 static void reflectUnsignedLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3400 { 3401 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3402 TestObjectV8Internal::reflectUnsignedLongAttributeAttributeGetter(info); 3403 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3404 } 3405 3406 static void reflectUnsignedLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3407 { 3408 v8::Handle<v8::Object> holder = info.Holder(); 3409 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectUnsignedLongAttribute", "TestObject", holder, info.GetIsolate()); 3410 TestObject* impl = V8TestObject::toNative(holder); 3411 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt32(v8Value, exceptionState), exceptionState); 3412 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3413 impl->setUnsignedIntegralAttribute(HTMLNames::reflectunsignedlongattributeAttr, cppValue); 3414 } 3415 3416 static void reflectUnsignedLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3417 { 3418 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3419 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3420 TestObjectV8Internal::reflectUnsignedLongAttributeAttributeSetter(v8Value, info); 3421 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3422 } 3423 3424 static void idAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3425 { 3426 v8::Handle<v8::Object> holder = info.Holder(); 3427 TestObject* impl = V8TestObject::toNative(holder); 3428 v8SetReturnValueString(info, impl->getIdAttribute(), info.GetIsolate()); 3429 } 3430 3431 static void idAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3432 { 3433 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3434 TestObjectV8Internal::idAttributeGetter(info); 3435 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3436 } 3437 3438 static void idAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3439 { 3440 v8::Handle<v8::Object> holder = info.Holder(); 3441 TestObject* impl = V8TestObject::toNative(holder); 3442 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3443 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3444 impl->setAttribute(HTMLNames::idAttr, cppValue); 3445 } 3446 3447 static void idAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3448 { 3449 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3450 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3451 TestObjectV8Internal::idAttributeSetter(v8Value, info); 3452 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3453 } 3454 3455 static void nameAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3456 { 3457 v8::Handle<v8::Object> holder = info.Holder(); 3458 TestObject* impl = V8TestObject::toNative(holder); 3459 v8SetReturnValueString(info, impl->getNameAttribute(), info.GetIsolate()); 3460 } 3461 3462 static void nameAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3463 { 3464 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3465 TestObjectV8Internal::nameAttributeGetter(info); 3466 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3467 } 3468 3469 static void nameAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3470 { 3471 v8::Handle<v8::Object> holder = info.Holder(); 3472 TestObject* impl = V8TestObject::toNative(holder); 3473 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3474 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3475 impl->setAttribute(HTMLNames::nameAttr, cppValue); 3476 } 3477 3478 static void nameAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3479 { 3480 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3481 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3482 TestObjectV8Internal::nameAttributeSetter(v8Value, info); 3483 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3484 } 3485 3486 static void classAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3487 { 3488 v8::Handle<v8::Object> holder = info.Holder(); 3489 TestObject* impl = V8TestObject::toNative(holder); 3490 v8SetReturnValueString(info, impl->getClassAttribute(), info.GetIsolate()); 3491 } 3492 3493 static void classAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3494 { 3495 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3496 TestObjectV8Internal::classAttributeGetter(info); 3497 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3498 } 3499 3500 static void classAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3501 { 3502 v8::Handle<v8::Object> holder = info.Holder(); 3503 TestObject* impl = V8TestObject::toNative(holder); 3504 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3505 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3506 impl->setAttribute(HTMLNames::classAttr, cppValue); 3507 } 3508 3509 static void classAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3510 { 3511 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3512 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3513 TestObjectV8Internal::classAttributeSetter(v8Value, info); 3514 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3515 } 3516 3517 static void reflectedIdAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3518 { 3519 v8::Handle<v8::Object> holder = info.Holder(); 3520 TestObject* impl = V8TestObject::toNative(holder); 3521 v8SetReturnValueString(info, impl->getIdAttribute(), info.GetIsolate()); 3522 } 3523 3524 static void reflectedIdAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3525 { 3526 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3527 TestObjectV8Internal::reflectedIdAttributeGetter(info); 3528 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3529 } 3530 3531 static void reflectedIdAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3532 { 3533 v8::Handle<v8::Object> holder = info.Holder(); 3534 TestObject* impl = V8TestObject::toNative(holder); 3535 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3536 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3537 impl->setAttribute(HTMLNames::idAttr, cppValue); 3538 } 3539 3540 static void reflectedIdAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3541 { 3542 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3543 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3544 TestObjectV8Internal::reflectedIdAttributeSetter(v8Value, info); 3545 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3546 } 3547 3548 static void reflectedNameAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3549 { 3550 v8::Handle<v8::Object> holder = info.Holder(); 3551 TestObject* impl = V8TestObject::toNative(holder); 3552 v8SetReturnValueString(info, impl->getNameAttribute(), info.GetIsolate()); 3553 } 3554 3555 static void reflectedNameAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3556 { 3557 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3558 TestObjectV8Internal::reflectedNameAttributeGetter(info); 3559 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3560 } 3561 3562 static void reflectedNameAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3563 { 3564 v8::Handle<v8::Object> holder = info.Holder(); 3565 TestObject* impl = V8TestObject::toNative(holder); 3566 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3567 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3568 impl->setAttribute(HTMLNames::nameAttr, cppValue); 3569 } 3570 3571 static void reflectedNameAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3572 { 3573 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3574 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3575 TestObjectV8Internal::reflectedNameAttributeSetter(v8Value, info); 3576 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3577 } 3578 3579 static void reflectedClassAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3580 { 3581 v8::Handle<v8::Object> holder = info.Holder(); 3582 TestObject* impl = V8TestObject::toNative(holder); 3583 v8SetReturnValueString(info, impl->getClassAttribute(), info.GetIsolate()); 3584 } 3585 3586 static void reflectedClassAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3587 { 3588 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3589 TestObjectV8Internal::reflectedClassAttributeGetter(info); 3590 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3591 } 3592 3593 static void reflectedClassAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3594 { 3595 v8::Handle<v8::Object> holder = info.Holder(); 3596 TestObject* impl = V8TestObject::toNative(holder); 3597 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3598 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3599 impl->setAttribute(HTMLNames::classAttr, cppValue); 3600 } 3601 3602 static void reflectedClassAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3603 { 3604 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3605 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3606 TestObjectV8Internal::reflectedClassAttributeSetter(v8Value, info); 3607 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3608 } 3609 3610 static void limitedToOnlyOneAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3611 { 3612 v8::Handle<v8::Object> holder = info.Holder(); 3613 TestObject* impl = V8TestObject::toNative(holder); 3614 String v8Value = impl->fastGetAttribute(HTMLNames::limitedtoonlyoneattributeAttr); 3615 if (v8Value.isEmpty()) { 3616 ; 3617 } else if (equalIgnoringCase(v8Value, "unique")) { 3618 v8Value = "unique"; 3619 } else { 3620 v8Value = ""; 3621 } 3622 v8SetReturnValueString(info, v8Value, info.GetIsolate()); 3623 } 3624 3625 static void limitedToOnlyOneAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3626 { 3627 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3628 TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetter(info); 3629 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3630 } 3631 3632 static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3633 { 3634 v8::Handle<v8::Object> holder = info.Holder(); 3635 TestObject* impl = V8TestObject::toNative(holder); 3636 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3637 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3638 impl->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue); 3639 } 3640 3641 static void limitedToOnlyOneAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3642 { 3643 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3644 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3645 TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetter(v8Value, info); 3646 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3647 } 3648 3649 static void limitedToOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3650 { 3651 v8::Handle<v8::Object> holder = info.Holder(); 3652 TestObject* impl = V8TestObject::toNative(holder); 3653 String v8Value = impl->fastGetAttribute(HTMLNames::limitedtoonlyattributeAttr); 3654 if (v8Value.isEmpty()) { 3655 ; 3656 } else if (equalIgnoringCase(v8Value, "Per")) { 3657 v8Value = "Per"; 3658 } else if (equalIgnoringCase(v8Value, "Paal")) { 3659 v8Value = "Paal"; 3660 } else if (equalIgnoringCase(v8Value, "Espen")) { 3661 v8Value = "Espen"; 3662 } else { 3663 v8Value = ""; 3664 } 3665 v8SetReturnValueString(info, v8Value, info.GetIsolate()); 3666 } 3667 3668 static void limitedToOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3669 { 3670 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3671 TestObjectV8Internal::limitedToOnlyAttributeAttributeGetter(info); 3672 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3673 } 3674 3675 static void limitedToOnlyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3676 { 3677 v8::Handle<v8::Object> holder = info.Holder(); 3678 TestObject* impl = V8TestObject::toNative(holder); 3679 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3680 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3681 impl->setAttribute(HTMLNames::limitedtoonlyattributeAttr, cppValue); 3682 } 3683 3684 static void limitedToOnlyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3685 { 3686 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3687 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3688 TestObjectV8Internal::limitedToOnlyAttributeAttributeSetter(v8Value, info); 3689 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3690 } 3691 3692 static void limitedToOnlyOtherAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3693 { 3694 v8::Handle<v8::Object> holder = info.Holder(); 3695 TestObject* impl = V8TestObject::toNative(holder); 3696 String v8Value = impl->fastGetAttribute(HTMLNames::otherAttr); 3697 if (v8Value.isEmpty()) { 3698 ; 3699 } else if (equalIgnoringCase(v8Value, "Value1")) { 3700 v8Value = "Value1"; 3701 } else if (equalIgnoringCase(v8Value, "Value2")) { 3702 v8Value = "Value2"; 3703 } else { 3704 v8Value = ""; 3705 } 3706 v8SetReturnValueString(info, v8Value, info.GetIsolate()); 3707 } 3708 3709 static void limitedToOnlyOtherAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3710 { 3711 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3712 TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetter(info); 3713 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3714 } 3715 3716 static void limitedToOnlyOtherAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3717 { 3718 v8::Handle<v8::Object> holder = info.Holder(); 3719 TestObject* impl = V8TestObject::toNative(holder); 3720 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3721 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3722 impl->setAttribute(HTMLNames::otherAttr, cppValue); 3723 } 3724 3725 static void limitedToOnlyOtherAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3726 { 3727 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3728 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3729 TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetter(v8Value, info); 3730 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3731 } 3732 3733 static void limitedWithMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3734 { 3735 v8::Handle<v8::Object> holder = info.Holder(); 3736 TestObject* impl = V8TestObject::toNative(holder); 3737 String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr); 3738 if (v8Value.isEmpty()) { 3739 v8Value = "rsa"; 3740 } else if (equalIgnoringCase(v8Value, "rsa")) { 3741 v8Value = "rsa"; 3742 } else if (equalIgnoringCase(v8Value, "dsa")) { 3743 v8Value = "dsa"; 3744 } else { 3745 v8Value = ""; 3746 } 3747 v8SetReturnValueString(info, v8Value, info.GetIsolate()); 3748 } 3749 3750 static void limitedWithMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3751 { 3752 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3753 TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetter(info); 3754 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3755 } 3756 3757 static void limitedWithMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3758 { 3759 v8::Handle<v8::Object> holder = info.Holder(); 3760 TestObject* impl = V8TestObject::toNative(holder); 3761 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3762 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3763 impl->setAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr, cppValue); 3764 } 3765 3766 static void limitedWithMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3767 { 3768 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3769 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3770 TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetter(v8Value, info); 3771 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3772 } 3773 3774 static void limitedWithInvalidMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3775 { 3776 v8::Handle<v8::Object> holder = info.Holder(); 3777 TestObject* impl = V8TestObject::toNative(holder); 3778 String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr); 3779 if (v8Value.isEmpty()) { 3780 v8Value = "auto"; 3781 } else if (equalIgnoringCase(v8Value, "ltr")) { 3782 v8Value = "ltr"; 3783 } else if (equalIgnoringCase(v8Value, "rtl")) { 3784 v8Value = "rtl"; 3785 } else if (equalIgnoringCase(v8Value, "auto")) { 3786 v8Value = "auto"; 3787 } else { 3788 v8Value = "ltr"; 3789 } 3790 v8SetReturnValueString(info, v8Value, info.GetIsolate()); 3791 } 3792 3793 static void limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3794 { 3795 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3796 TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetter(info); 3797 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3798 } 3799 3800 static void limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3801 { 3802 v8::Handle<v8::Object> holder = info.Holder(); 3803 TestObject* impl = V8TestObject::toNative(holder); 3804 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3805 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3806 impl->setAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr, cppValue); 3807 } 3808 3809 static void limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3810 { 3811 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3812 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 3813 TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8Value, info); 3814 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3815 } 3816 3817 static void corsSettingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3818 { 3819 v8::Handle<v8::Object> holder = info.Holder(); 3820 TestObject* impl = V8TestObject::toNative(holder); 3821 String v8Value = impl->fastGetAttribute(HTMLNames::corssettingattributeAttr); 3822 if (v8Value.isNull()) { 3823 ; 3824 } else if (v8Value.isEmpty()) { 3825 v8Value = "anonymous"; 3826 } else if (equalIgnoringCase(v8Value, "anonymous")) { 3827 v8Value = "anonymous"; 3828 } else if (equalIgnoringCase(v8Value, "use-credentials")) { 3829 v8Value = "use-credentials"; 3830 } else { 3831 v8Value = "anonymous"; 3832 } 3833 v8SetReturnValueString(info, v8Value, info.GetIsolate()); 3834 } 3835 3836 static void corsSettingAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3837 { 3838 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3839 TestObjectV8Internal::corsSettingAttributeAttributeGetter(info); 3840 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3841 } 3842 3843 static void limitedWithEmptyMissingInvalidAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3844 { 3845 v8::Handle<v8::Object> holder = info.Holder(); 3846 TestObject* impl = V8TestObject::toNative(holder); 3847 String v8Value = impl->fastGetAttribute(HTMLNames::limitedwithemptymissinginvalidattributeAttr); 3848 if (v8Value.isNull()) { 3849 v8Value = "missing"; 3850 } else if (v8Value.isEmpty()) { 3851 v8Value = "empty"; 3852 } else if (equalIgnoringCase(v8Value, "empty")) { 3853 v8Value = "empty"; 3854 } else if (equalIgnoringCase(v8Value, "missing")) { 3855 v8Value = "missing"; 3856 } else if (equalIgnoringCase(v8Value, "invalid")) { 3857 v8Value = "invalid"; 3858 } else if (equalIgnoringCase(v8Value, "a-normal")) { 3859 v8Value = "a-normal"; 3860 } else { 3861 v8Value = "invalid"; 3862 } 3863 v8SetReturnValueString(info, v8Value, info.GetIsolate()); 3864 } 3865 3866 static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3867 { 3868 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3869 TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(info); 3870 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3871 } 3872 3873 static void replaceableReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3874 { 3875 v8::Handle<v8::Object> holder = info.Holder(); 3876 TestObject* impl = V8TestObject::toNative(holder); 3877 v8SetReturnValueInt(info, impl->replaceableReadonlyLongAttribute()); 3878 } 3879 3880 static void replaceableReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3881 { 3882 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3883 TestObjectV8Internal::replaceableReadonlyLongAttributeAttributeGetter(info); 3884 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3885 } 3886 3887 static void locationReplaceableAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3888 { 3889 v8::Handle<v8::Object> holder = info.Holder(); 3890 TestObject* impl = V8TestObject::toNative(holder); 3891 v8SetReturnValueFast(info, WTF::getPtr(impl->locationReplaceable()), impl); 3892 } 3893 3894 static void locationReplaceableAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3895 { 3896 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3897 TestObjectV8Internal::locationReplaceableAttributeGetter(info); 3898 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3899 } 3900 3901 static void locationReplaceableAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3902 { 3903 v8::Handle<v8::Object> holder = info.Holder(); 3904 TestObject* proxyImpl = V8TestObject::toNative(holder); 3905 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationReplaceable()); 3906 if (!impl) 3907 return; 3908 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3909 impl->setHref(cppValue); 3910 } 3911 3912 static void locationReplaceableAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3913 { 3914 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3915 TestObjectV8Internal::locationReplaceableAttributeSetter(v8Value, info); 3916 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3917 } 3918 3919 static void runtimeEnabledLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3920 { 3921 v8::Handle<v8::Object> holder = info.Holder(); 3922 TestObject* impl = V8TestObject::toNative(holder); 3923 v8SetReturnValueInt(info, impl->runtimeEnabledLongAttribute()); 3924 } 3925 3926 static void runtimeEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3927 { 3928 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3929 TestObjectV8Internal::runtimeEnabledLongAttributeAttributeGetter(info); 3930 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3931 } 3932 3933 static void runtimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3934 { 3935 v8::Handle<v8::Object> holder = info.Holder(); 3936 ExceptionState exceptionState(ExceptionState::SetterContext, "runtimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); 3937 TestObject* impl = V8TestObject::toNative(holder); 3938 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3939 impl->setRuntimeEnabledLongAttribute(cppValue); 3940 } 3941 3942 static void runtimeEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3943 { 3944 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3945 TestObjectV8Internal::runtimeEnabledLongAttributeAttributeSetter(v8Value, info); 3946 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3947 } 3948 3949 static void perContextEnabledRuntimeEnabledLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3950 { 3951 v8::Handle<v8::Object> holder = info.Holder(); 3952 TestObject* impl = V8TestObject::toNative(holder); 3953 v8SetReturnValueInt(info, impl->perContextEnabledRuntimeEnabledLongAttribute()); 3954 } 3955 3956 static void perContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3957 { 3958 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3959 TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeGetter(info); 3960 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3961 } 3962 3963 static void perContextEnabledRuntimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3964 { 3965 v8::Handle<v8::Object> holder = info.Holder(); 3966 ExceptionState exceptionState(ExceptionState::SetterContext, "perContextEnabledRuntimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); 3967 TestObject* impl = V8TestObject::toNative(holder); 3968 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3969 impl->setPerContextEnabledRuntimeEnabledLongAttribute(cppValue); 3970 } 3971 3972 static void perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3973 { 3974 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 3975 TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetter(v8Value, info); 3976 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3977 } 3978 3979 #if ENABLE(CONDITION) 3980 static void conditionalRuntimeEnabledLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3981 { 3982 v8::Handle<v8::Object> holder = info.Holder(); 3983 TestObject* impl = V8TestObject::toNative(holder); 3984 v8SetReturnValueInt(info, impl->conditionalRuntimeEnabledLongAttribute()); 3985 } 3986 #endif // ENABLE(CONDITION) 3987 3988 #if ENABLE(CONDITION) 3989 static void conditionalRuntimeEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3990 { 3991 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 3992 TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeGetter(info); 3993 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 3994 } 3995 #endif // ENABLE(CONDITION) 3996 3997 #if ENABLE(CONDITION) 3998 static void conditionalRuntimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3999 { 4000 v8::Handle<v8::Object> holder = info.Holder(); 4001 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalRuntimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); 4002 TestObject* impl = V8TestObject::toNative(holder); 4003 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 4004 impl->setConditionalRuntimeEnabledLongAttribute(cppValue); 4005 } 4006 #endif // ENABLE(CONDITION) 4007 4008 #if ENABLE(CONDITION) 4009 static void conditionalRuntimeEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4010 { 4011 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4012 TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeSetter(v8Value, info); 4013 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4014 } 4015 #endif // ENABLE(CONDITION) 4016 4017 static void setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4018 { 4019 v8::Handle<v8::Object> holder = info.Holder(); 4020 TestObject* impl = V8TestObject::toNative(holder); 4021 v8SetReturnValueString(info, impl->setterCallWithActiveWindowAndFirstWindowStringAttribute(), info.GetIsolate()); 4022 } 4023 4024 static void setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4025 { 4026 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4027 TestObjectV8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGetter(info); 4028 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4029 } 4030 4031 static void setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4032 { 4033 v8::Handle<v8::Object> holder = info.Holder(); 4034 TestObject* impl = V8TestObject::toNative(holder); 4035 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4036 impl->setSetterCallWithActiveWindowAndFirstWindowStringAttribute(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), cppValue); 4037 } 4038 4039 static void setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4040 { 4041 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4042 TestObjectV8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeSetter(v8Value, info); 4043 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4044 } 4045 4046 static void setterCallWithExecutionContextStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4047 { 4048 v8::Handle<v8::Object> holder = info.Holder(); 4049 TestObject* impl = V8TestObject::toNative(holder); 4050 v8SetReturnValueString(info, impl->setterCallWithExecutionContextStringAttribute(), info.GetIsolate()); 4051 } 4052 4053 static void setterCallWithExecutionContextStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4054 { 4055 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4056 TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeGetter(info); 4057 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4058 } 4059 4060 static void setterCallWithExecutionContextStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4061 { 4062 v8::Handle<v8::Object> holder = info.Holder(); 4063 TestObject* impl = V8TestObject::toNative(holder); 4064 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4065 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 4066 impl->setSetterCallWithExecutionContextStringAttribute(executionContext, cppValue); 4067 } 4068 4069 static void setterCallWithExecutionContextStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4070 { 4071 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4072 TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeSetter(v8Value, info); 4073 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4074 } 4075 4076 static void treatNullAsNullStringStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4077 { 4078 v8::Handle<v8::Object> holder = info.Holder(); 4079 TestObject* impl = V8TestObject::toNative(holder); 4080 v8SetReturnValueString(info, impl->treatNullAsNullStringStringAttribute(), info.GetIsolate()); 4081 } 4082 4083 static void treatNullAsNullStringStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4084 { 4085 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4086 TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeGetter(info); 4087 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4088 } 4089 4090 static void treatNullAsNullStringStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4091 { 4092 v8::Handle<v8::Object> holder = info.Holder(); 4093 TestObject* impl = V8TestObject::toNative(holder); 4094 TOSTRING_VOID(V8StringResource<WithNullCheck>, cppValue, v8Value); 4095 impl->setTreatNullAsNullStringStringAttribute(cppValue); 4096 } 4097 4098 static void treatNullAsNullStringStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4099 { 4100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4101 TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeSetter(v8Value, info); 4102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4103 } 4104 4105 static void treatReturnedNullStringAsNullStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4106 { 4107 v8::Handle<v8::Object> holder = info.Holder(); 4108 TestObject* impl = V8TestObject::toNative(holder); 4109 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullStringAttribute(), info.GetIsolate()); 4110 } 4111 4112 static void treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4113 { 4114 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4115 TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeGetter(info); 4116 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4117 } 4118 4119 static void treatReturnedNullStringAsNullStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4120 { 4121 v8::Handle<v8::Object> holder = info.Holder(); 4122 TestObject* impl = V8TestObject::toNative(holder); 4123 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4124 impl->setTreatReturnedNullStringAsNullStringAttribute(cppValue); 4125 } 4126 4127 static void treatReturnedNullStringAsNullStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4128 { 4129 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4130 TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeSetter(v8Value, info); 4131 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4132 } 4133 4134 static void treatReturnedNullStringAsUndefinedStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4135 { 4136 v8::Handle<v8::Object> holder = info.Holder(); 4137 TestObject* impl = V8TestObject::toNative(holder); 4138 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedStringAttribute(), info.GetIsolate()); 4139 } 4140 4141 static void treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4142 { 4143 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4144 TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetter(info); 4145 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4146 } 4147 4148 static void treatReturnedNullStringAsUndefinedStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4149 { 4150 v8::Handle<v8::Object> holder = info.Holder(); 4151 TestObject* impl = V8TestObject::toNative(holder); 4152 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4153 impl->setTreatReturnedNullStringAsUndefinedStringAttribute(cppValue); 4154 } 4155 4156 static void treatReturnedNullStringAsUndefinedStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4157 { 4158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4159 TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeSetter(v8Value, info); 4160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4161 } 4162 4163 static void treatReturnedNullStringAsNullByteStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4164 { 4165 v8::Handle<v8::Object> holder = info.Holder(); 4166 TestObject* impl = V8TestObject::toNative(holder); 4167 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullByteStringAttribute(), info.GetIsolate()); 4168 } 4169 4170 static void treatReturnedNullStringAsNullByteStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4171 { 4172 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4173 TestObjectV8Internal::treatReturnedNullStringAsNullByteStringAttributeAttributeGetter(info); 4174 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4175 } 4176 4177 static void treatReturnedNullStringAsNullByteStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4178 { 4179 v8::Handle<v8::Object> holder = info.Holder(); 4180 ExceptionState exceptionState(ExceptionState::SetterContext, "treatReturnedNullStringAsNullByteStringAttribute", "TestObject", holder, info.GetIsolate()); 4181 TestObject* impl = V8TestObject::toNative(holder); 4182 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toByteString(v8Value, exceptionState), exceptionState); 4183 impl->setTreatReturnedNullStringAsNullByteStringAttribute(cppValue); 4184 } 4185 4186 static void treatReturnedNullStringAsNullByteStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4187 { 4188 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4189 TestObjectV8Internal::treatReturnedNullStringAsNullByteStringAttributeAttributeSetter(v8Value, info); 4190 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4191 } 4192 4193 static void treatReturnedNullStringAsUndefinedByteStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4194 { 4195 v8::Handle<v8::Object> holder = info.Holder(); 4196 TestObject* impl = V8TestObject::toNative(holder); 4197 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedByteStringAttribute(), info.GetIsolate()); 4198 } 4199 4200 static void treatReturnedNullStringAsUndefinedByteStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4201 { 4202 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4203 TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringAttributeAttributeGetter(info); 4204 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4205 } 4206 4207 static void treatReturnedNullStringAsUndefinedByteStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4208 { 4209 v8::Handle<v8::Object> holder = info.Holder(); 4210 ExceptionState exceptionState(ExceptionState::SetterContext, "treatReturnedNullStringAsUndefinedByteStringAttribute", "TestObject", holder, info.GetIsolate()); 4211 TestObject* impl = V8TestObject::toNative(holder); 4212 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toByteString(v8Value, exceptionState), exceptionState); 4213 impl->setTreatReturnedNullStringAsUndefinedByteStringAttribute(cppValue); 4214 } 4215 4216 static void treatReturnedNullStringAsUndefinedByteStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4217 { 4218 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4219 TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringAttributeAttributeSetter(v8Value, info); 4220 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4221 } 4222 4223 static void treatReturnedNullStringAsNullScalarValueStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4224 { 4225 v8::Handle<v8::Object> holder = info.Holder(); 4226 TestObject* impl = V8TestObject::toNative(holder); 4227 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullScalarValueStringAttribute(), info.GetIsolate()); 4228 } 4229 4230 static void treatReturnedNullStringAsNullScalarValueStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4231 { 4232 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4233 TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringAttributeAttributeGetter(info); 4234 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4235 } 4236 4237 static void treatReturnedNullStringAsNullScalarValueStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4238 { 4239 v8::Handle<v8::Object> holder = info.Holder(); 4240 ExceptionState exceptionState(ExceptionState::SetterContext, "treatReturnedNullStringAsNullScalarValueStringAttribute", "TestObject", holder, info.GetIsolate()); 4241 TestObject* impl = V8TestObject::toNative(holder); 4242 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toScalarValueString(v8Value, exceptionState), exceptionState); 4243 impl->setTreatReturnedNullStringAsNullScalarValueStringAttribute(cppValue); 4244 } 4245 4246 static void treatReturnedNullStringAsNullScalarValueStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4247 { 4248 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4249 TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringAttributeAttributeSetter(v8Value, info); 4250 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4251 } 4252 4253 static void treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4254 { 4255 v8::Handle<v8::Object> holder = info.Holder(); 4256 TestObject* impl = V8TestObject::toNative(holder); 4257 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedScalarValueStringAttribute(), info.GetIsolate()); 4258 } 4259 4260 static void treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4261 { 4262 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4263 TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeGetter(info); 4264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4265 } 4266 4267 static void treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4268 { 4269 v8::Handle<v8::Object> holder = info.Holder(); 4270 ExceptionState exceptionState(ExceptionState::SetterContext, "treatReturnedNullStringAsUndefinedScalarValueStringAttribute", "TestObject", holder, info.GetIsolate()); 4271 TestObject* impl = V8TestObject::toNative(holder); 4272 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toScalarValueString(v8Value, exceptionState), exceptionState); 4273 impl->setTreatReturnedNullStringAsUndefinedScalarValueStringAttribute(cppValue); 4274 } 4275 4276 static void treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4277 { 4278 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4279 TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeSetter(v8Value, info); 4280 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4281 } 4282 4283 static void typeCheckingInterfaceNullableStringFloatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4284 { 4285 v8::Handle<v8::Object> holder = info.Holder(); 4286 TestObject* impl = V8TestObject::toNative(holder); 4287 v8SetReturnValue(info, impl->typeCheckingInterfaceNullableStringFloatAttribute()); 4288 } 4289 4290 static void typeCheckingInterfaceNullableStringFloatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4291 { 4292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4293 TestObjectV8Internal::typeCheckingInterfaceNullableStringFloatAttributeAttributeGetter(info); 4294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4295 } 4296 4297 static void typeCheckingInterfaceNullableStringFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4298 { 4299 v8::Handle<v8::Object> holder = info.Holder(); 4300 TestObject* impl = V8TestObject::toNative(holder); 4301 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue())); 4302 impl->setTypeCheckingInterfaceNullableStringFloatAttribute(cppValue); 4303 } 4304 4305 static void typeCheckingInterfaceNullableStringFloatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4306 { 4307 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4308 TestObjectV8Internal::typeCheckingInterfaceNullableStringFloatAttributeAttributeSetter(v8Value, info); 4309 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4310 } 4311 4312 static void typeCheckingInterfaceTestInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4313 { 4314 v8::Handle<v8::Object> holder = info.Holder(); 4315 TestObject* impl = V8TestObject::toNative(holder); 4316 v8SetReturnValueFast(info, WTF::getPtr(impl->typeCheckingInterfaceTestInterfaceAttribute()), impl); 4317 } 4318 4319 static void typeCheckingInterfaceTestInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4320 { 4321 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4322 TestObjectV8Internal::typeCheckingInterfaceTestInterfaceAttributeAttributeGetter(info); 4323 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4324 } 4325 4326 static void typeCheckingInterfaceTestInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4327 { 4328 v8::Handle<v8::Object> holder = info.Holder(); 4329 ExceptionState exceptionState(ExceptionState::SetterContext, "typeCheckingInterfaceTestInterfaceAttribute", "TestObject", holder, info.GetIsolate()); 4330 if (!V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { 4331 exceptionState.throwTypeError("The provided value is not of type 'TestInterface'."); 4332 exceptionState.throwIfNeeded(); 4333 return; 4334 } 4335 TestObject* impl = V8TestObject::toNative(holder); 4336 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4337 impl->setTypeCheckingInterfaceTestInterfaceAttribute(WTF::getPtr(cppValue)); 4338 } 4339 4340 static void typeCheckingInterfaceTestInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4341 { 4342 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4343 TestObjectV8Internal::typeCheckingInterfaceTestInterfaceAttributeAttributeSetter(v8Value, info); 4344 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4345 } 4346 4347 static void typeCheckingNullableTestInterfaceOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4348 { 4349 v8::Handle<v8::Object> holder = info.Holder(); 4350 TestObject* impl = V8TestObject::toNative(holder); 4351 RefPtr<TestInterfaceImplementation> v8Value = impl->typeCheckingNullableTestInterfaceOrNullAttribute(); 4352 if (!v8Value) { 4353 v8SetReturnValueNull(info); 4354 return; 4355 } 4356 v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); 4357 } 4358 4359 static void typeCheckingNullableTestInterfaceOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4360 { 4361 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4362 TestObjectV8Internal::typeCheckingNullableTestInterfaceOrNullAttributeAttributeGetter(info); 4363 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4364 } 4365 4366 static void typeCheckingNullableTestInterfaceOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4367 { 4368 v8::Handle<v8::Object> holder = info.Holder(); 4369 ExceptionState exceptionState(ExceptionState::SetterContext, "typeCheckingNullableTestInterfaceOrNullAttribute", "TestObject", holder, info.GetIsolate()); 4370 TestObject* impl = V8TestObject::toNative(holder); 4371 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4372 impl->setTypeCheckingNullableTestInterfaceOrNullAttribute(WTF::getPtr(cppValue)); 4373 } 4374 4375 static void typeCheckingNullableTestInterfaceOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4376 { 4377 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4378 TestObjectV8Internal::typeCheckingNullableTestInterfaceOrNullAttributeAttributeSetter(v8Value, info); 4379 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4380 } 4381 4382 static void typeCheckingInterfaceNullableTestInterfaceOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4383 { 4384 v8::Handle<v8::Object> holder = info.Holder(); 4385 TestObject* impl = V8TestObject::toNative(holder); 4386 RefPtr<TestInterfaceImplementation> v8Value = impl->typeCheckingInterfaceNullableTestInterfaceOrNullAttribute(); 4387 if (!v8Value) { 4388 v8SetReturnValueNull(info); 4389 return; 4390 } 4391 v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); 4392 } 4393 4394 static void typeCheckingInterfaceNullableTestInterfaceOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4395 { 4396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4397 TestObjectV8Internal::typeCheckingInterfaceNullableTestInterfaceOrNullAttributeAttributeGetter(info); 4398 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4399 } 4400 4401 static void typeCheckingInterfaceNullableTestInterfaceOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4402 { 4403 v8::Handle<v8::Object> holder = info.Holder(); 4404 ExceptionState exceptionState(ExceptionState::SetterContext, "typeCheckingInterfaceNullableTestInterfaceOrNullAttribute", "TestObject", holder, info.GetIsolate()); 4405 if (!isUndefinedOrNull(v8Value) && !V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { 4406 exceptionState.throwTypeError("The provided value is not of type 'TestInterface'."); 4407 exceptionState.throwIfNeeded(); 4408 return; 4409 } 4410 TestObject* impl = V8TestObject::toNative(holder); 4411 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4412 impl->setTypeCheckingInterfaceNullableTestInterfaceOrNullAttribute(WTF::getPtr(cppValue)); 4413 } 4414 4415 static void typeCheckingInterfaceNullableTestInterfaceOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4416 { 4417 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4418 TestObjectV8Internal::typeCheckingInterfaceNullableTestInterfaceOrNullAttributeAttributeSetter(v8Value, info); 4419 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4420 } 4421 4422 static void urlStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4423 { 4424 v8::Handle<v8::Object> holder = info.Holder(); 4425 TestObject* impl = V8TestObject::toNative(holder); 4426 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::urlstringattributeAttr), info.GetIsolate()); 4427 } 4428 4429 static void urlStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4430 { 4431 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4432 TestObjectV8Internal::urlStringAttributeAttributeGetter(info); 4433 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4434 } 4435 4436 static void urlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4437 { 4438 v8::Handle<v8::Object> holder = info.Holder(); 4439 TestObject* impl = V8TestObject::toNative(holder); 4440 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4441 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 4442 impl->setAttribute(HTMLNames::urlstringattributeAttr, cppValue); 4443 } 4444 4445 static void urlStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4446 { 4447 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4448 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 4449 TestObjectV8Internal::urlStringAttributeAttributeSetter(v8Value, info); 4450 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4451 } 4452 4453 static void urlStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4454 { 4455 v8::Handle<v8::Object> holder = info.Holder(); 4456 TestObject* impl = V8TestObject::toNative(holder); 4457 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectUrlAttributeAttr), info.GetIsolate()); 4458 } 4459 4460 static void urlStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4461 { 4462 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4463 TestObjectV8Internal::urlStringAttributeAttributeGetter(info); 4464 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4465 } 4466 4467 static void urlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4468 { 4469 v8::Handle<v8::Object> holder = info.Holder(); 4470 TestObject* impl = V8TestObject::toNative(holder); 4471 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4472 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 4473 impl->setAttribute(HTMLNames::reflectUrlAttributeAttr, cppValue); 4474 } 4475 4476 static void urlStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4477 { 4478 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4479 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 4480 TestObjectV8Internal::urlStringAttributeAttributeSetter(v8Value, info); 4481 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4482 } 4483 4484 static void unforgeableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4485 { 4486 v8::Handle<v8::Object> holder = V8TestObject::findInstanceInPrototypeChain(info.This(), info.GetIsolate()); 4487 if (holder.IsEmpty()) 4488 return; 4489 TestObject* impl = V8TestObject::toNative(holder); 4490 v8SetReturnValueInt(info, impl->unforgeableLongAttribute()); 4491 } 4492 4493 static void unforgeableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4494 { 4495 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4496 TestObjectV8Internal::unforgeableLongAttributeAttributeGetter(info); 4497 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4498 } 4499 4500 static void unforgeableLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4501 { 4502 v8::Handle<v8::Object> holder = info.Holder(); 4503 ExceptionState exceptionState(ExceptionState::SetterContext, "unforgeableLongAttribute", "TestObject", holder, info.GetIsolate()); 4504 TestObject* impl = V8TestObject::toNative(holder); 4505 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 4506 impl->setUnforgeableLongAttribute(cppValue); 4507 } 4508 4509 static void unforgeableLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4510 { 4511 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4512 TestObjectV8Internal::unforgeableLongAttributeAttributeSetter(v8Value, info); 4513 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4514 } 4515 4516 static void activityLoggingSetterOnlyLogPreviousValueAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4517 { 4518 v8::Handle<v8::Object> holder = info.Holder(); 4519 TestObject* impl = V8TestObject::toNative(holder); 4520 v8SetReturnValueInt(info, impl->activityLoggingSetterOnlyLogPreviousValueAttribute()); 4521 } 4522 4523 static void activityLoggingSetterOnlyLogPreviousValueAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4524 { 4525 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4526 TestObjectV8Internal::activityLoggingSetterOnlyLogPreviousValueAttributeAttributeGetter(info); 4527 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4528 } 4529 4530 static void activityLoggingSetterOnlyLogPreviousValueAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4531 { 4532 v8::Handle<v8::Object> holder = info.Holder(); 4533 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingSetterOnlyLogPreviousValueAttribute", "TestObject", holder, info.GetIsolate()); 4534 TestObject* impl = V8TestObject::toNative(holder); 4535 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 4536 impl->setActivityLoggingSetterOnlyLogPreviousValueAttribute(cppValue); 4537 } 4538 4539 static void activityLoggingSetterOnlyLogPreviousValueAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4540 { 4541 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4542 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 4543 V8PerContextData* contextData = scriptState->perContextData(); 4544 if (scriptState->world().isIsolatedWorld() && contextData && contextData->activityLogger()) { 4545 TestObject* impl = V8TestObject::toNative(info.Holder()); 4546 int original = impl->activityLoggingSetterOnlyLogPreviousValueAttribute(); 4547 v8::Handle<v8::Value> originalValue = v8::Integer::New(info.GetIsolate(), impl->activityLoggingSetterOnlyLogPreviousValueAttribute()); 4548 contextData->activityLogger()->logSetter("TestObject.activityLoggingSetterOnlyLogPreviousValueAttribute", v8Value, originalValue); 4549 } 4550 TestObjectV8Internal::activityLoggingSetterOnlyLogPreviousValueAttributeAttributeSetter(v8Value, info); 4551 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4552 } 4553 4554 static void activityLoggingLogPreviousValueInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4555 { 4556 v8::Handle<v8::Object> holder = info.Holder(); 4557 TestObject* impl = V8TestObject::toNative(holder); 4558 v8SetReturnValueFast(info, WTF::getPtr(impl->activityLoggingLogPreviousValueInterfaceAttribute()), impl); 4559 } 4560 4561 static void activityLoggingLogPreviousValueInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4562 { 4563 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4564 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 4565 V8PerContextData* contextData = scriptState->perContextData(); 4566 if (scriptState->world().isIsolatedWorld() && contextData && contextData->activityLogger()) 4567 contextData->activityLogger()->logGetter("TestObject.activityLoggingLogPreviousValueInterfaceAttribute"); 4568 TestObjectV8Internal::activityLoggingLogPreviousValueInterfaceAttributeAttributeGetter(info); 4569 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4570 } 4571 4572 static void activityLoggingLogPreviousValueInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4573 { 4574 v8::Handle<v8::Object> holder = info.Holder(); 4575 TestObject* impl = V8TestObject::toNative(holder); 4576 TONATIVE_VOID(TestInterfaceEmpty*, cppValue, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4577 impl->setActivityLoggingLogPreviousValueInterfaceAttribute(WTF::getPtr(cppValue)); 4578 } 4579 4580 static void activityLoggingLogPreviousValueInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4581 { 4582 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4583 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 4584 V8PerContextData* contextData = scriptState->perContextData(); 4585 if (scriptState->world().isIsolatedWorld() && contextData && contextData->activityLogger()) { 4586 TestObject* impl = V8TestObject::toNative(info.Holder()); 4587 RefPtr<TestInterfaceEmpty> original = impl->activityLoggingLogPreviousValueInterfaceAttribute(); 4588 v8::Handle<v8::Value> originalValue = toV8(impl->activityLoggingLogPreviousValueInterfaceAttribute(), info.Holder(), info.GetIsolate()); 4589 contextData->activityLogger()->logSetter("TestObject.activityLoggingLogPreviousValueInterfaceAttribute", v8Value, originalValue); 4590 } 4591 TestObjectV8Internal::activityLoggingLogPreviousValueInterfaceAttributeAttributeSetter(v8Value, info); 4592 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4593 } 4594 4595 static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4596 { 4597 v8::Handle<v8::Object> holder = info.Holder(); 4598 TestObject* impl = V8TestObject::toNative(holder); 4599 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl); 4600 } 4601 4602 static void testInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4603 { 4604 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4605 TestObjectV8Internal::testInterfaceAttributeAttributeGetter(info); 4606 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4607 } 4608 4609 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4610 { 4611 v8::Handle<v8::Object> holder = info.Holder(); 4612 TestObject* impl = V8TestObject::toNative(holder); 4613 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4614 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue)); 4615 } 4616 4617 static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4618 { 4619 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4620 TestObjectV8Internal::testInterfaceAttributeAttributeSetter(v8Value, info); 4621 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4622 } 4623 4624 static void testInterfaceGarbageCollectedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4625 { 4626 v8::Handle<v8::Object> holder = info.Holder(); 4627 TestObject* impl = V8TestObject::toNative(holder); 4628 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceGarbageCollectedAttribute()), impl); 4629 } 4630 4631 static void testInterfaceGarbageCollectedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4632 { 4633 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4634 TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeGetter(info); 4635 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4636 } 4637 4638 static void testInterfaceGarbageCollectedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4639 { 4640 v8::Handle<v8::Object> holder = info.Holder(); 4641 TestObject* impl = V8TestObject::toNative(holder); 4642 TONATIVE_VOID(TestInterfaceGarbageCollected*, cppValue, V8TestInterfaceGarbageCollected::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4643 impl->setTestInterfaceGarbageCollectedAttribute(WTF::getPtr(cppValue)); 4644 } 4645 4646 static void testInterfaceGarbageCollectedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4647 { 4648 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4649 TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeSetter(v8Value, info); 4650 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4651 } 4652 4653 static void testInterfaceGarbageCollectedOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4654 { 4655 v8::Handle<v8::Object> holder = info.Holder(); 4656 TestObject* impl = V8TestObject::toNative(holder); 4657 bool isNull = false; 4658 RawPtr<TestInterfaceGarbageCollected> v8Value = impl->testInterfaceGarbageCollectedOrNullAttribute(isNull); 4659 if (isNull) { 4660 v8SetReturnValueNull(info); 4661 return; 4662 } 4663 v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); 4664 } 4665 4666 static void testInterfaceGarbageCollectedOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4667 { 4668 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4669 TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeGetter(info); 4670 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4671 } 4672 4673 static void testInterfaceGarbageCollectedOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4674 { 4675 v8::Handle<v8::Object> holder = info.Holder(); 4676 TestObject* impl = V8TestObject::toNative(holder); 4677 TONATIVE_VOID(TestInterfaceGarbageCollected*, cppValue, V8TestInterfaceGarbageCollected::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4678 impl->setTestInterfaceGarbageCollectedOrNullAttribute(WTF::getPtr(cppValue)); 4679 } 4680 4681 static void testInterfaceGarbageCollectedOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4682 { 4683 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4684 TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeSetter(v8Value, info); 4685 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4686 } 4687 4688 static void testInterfaceWillBeGarbageCollectedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4689 { 4690 v8::Handle<v8::Object> holder = info.Holder(); 4691 TestObject* impl = V8TestObject::toNative(holder); 4692 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceWillBeGarbageCollectedAttribute()), impl); 4693 } 4694 4695 static void testInterfaceWillBeGarbageCollectedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4696 { 4697 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4698 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeGetter(info); 4699 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4700 } 4701 4702 static void testInterfaceWillBeGarbageCollectedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4703 { 4704 v8::Handle<v8::Object> holder = info.Holder(); 4705 TestObject* impl = V8TestObject::toNative(holder); 4706 TONATIVE_VOID(TestInterfaceWillBeGarbageCollected*, cppValue, V8TestInterfaceWillBeGarbageCollected::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4707 impl->setTestInterfaceWillBeGarbageCollectedAttribute(WTF::getPtr(cppValue)); 4708 } 4709 4710 static void testInterfaceWillBeGarbageCollectedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4711 { 4712 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4713 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeSetter(v8Value, info); 4714 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4715 } 4716 4717 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4718 { 4719 v8::Handle<v8::Object> holder = info.Holder(); 4720 TestObject* impl = V8TestObject::toNative(holder); 4721 bool isNull = false; 4722 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> v8Value = impl->testInterfaceWillBeGarbageCollectedOrNullAttribute(isNull); 4723 if (isNull) { 4724 v8SetReturnValueNull(info); 4725 return; 4726 } 4727 v8SetReturnValueFast(info, WTF::getPtr(v8Value.release()), impl); 4728 } 4729 4730 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4731 { 4732 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4733 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetter(info); 4734 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4735 } 4736 4737 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4738 { 4739 v8::Handle<v8::Object> holder = info.Holder(); 4740 TestObject* impl = V8TestObject::toNative(holder); 4741 TONATIVE_VOID(TestInterfaceWillBeGarbageCollected*, cppValue, V8TestInterfaceWillBeGarbageCollected::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); 4742 impl->setTestInterfaceWillBeGarbageCollectedOrNullAttribute(WTF::getPtr(cppValue)); 4743 } 4744 4745 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4746 { 4747 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 4748 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetter(v8Value, info); 4749 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4750 } 4751 4752 static void TestObjectConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4753 { 4754 v8::Handle<v8::Value> data = info.Data(); 4755 ASSERT(data->IsExternal()); 4756 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); 4757 if (!perContextData) 4758 return; 4759 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data))); 4760 } 4761 4762 static void testInterfaceEmptyConstructorAttributeConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) 4763 { 4764 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4765 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::deprecatedTestInterfaceEmptyConstructorAttribute); 4766 TestObjectV8Internal::TestObjectConstructorGetter(property, info); 4767 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4768 } 4769 4770 static void measureAsFeatureNameTestInterfaceEmptyConstructorAttributeConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) 4771 { 4772 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 4773 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::FeatureName); 4774 TestObjectV8Internal::TestObjectConstructorGetter(property, info); 4775 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4776 } 4777 4778 static void TestObjectReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4779 { 4780 if (info.This()->IsObject()) 4781 v8::Handle<v8::Object>::Cast(info.This())->ForceSet(name, v8Value); 4782 } 4783 4784 static void TestObjectReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4785 { 4786 TestObjectV8Internal::TestObjectReplaceableAttributeSetter(name, v8Value, info); 4787 } 4788 4789 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4790 { 4791 TestObject* impl = V8TestObject::toNative(info.Holder()); 4792 impl->voidMethod(); 4793 } 4794 4795 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4796 { 4797 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4798 TestObjectV8Internal::voidMethodMethod(info); 4799 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4800 } 4801 4802 static void staticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4803 { 4804 TestObject::staticVoidMethod(); 4805 } 4806 4807 static void staticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4808 { 4809 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4810 TestObjectV8Internal::staticVoidMethodMethod(info); 4811 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4812 } 4813 4814 static void dateMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4815 { 4816 TestObject* impl = V8TestObject::toNative(info.Holder()); 4817 v8SetReturnValue(info, v8DateOrNaN(impl->dateMethod(), info.GetIsolate())); 4818 } 4819 4820 static void dateMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4821 { 4822 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4823 TestObjectV8Internal::dateMethodMethod(info); 4824 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4825 } 4826 4827 static void stringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4828 { 4829 TestObject* impl = V8TestObject::toNative(info.Holder()); 4830 v8SetReturnValueString(info, impl->stringMethod(), info.GetIsolate()); 4831 } 4832 4833 static void stringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4834 { 4835 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4836 TestObjectV8Internal::stringMethodMethod(info); 4837 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4838 } 4839 4840 static void byteStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4841 { 4842 TestObject* impl = V8TestObject::toNative(info.Holder()); 4843 v8SetReturnValueString(info, impl->byteStringMethod(), info.GetIsolate()); 4844 } 4845 4846 static void byteStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4847 { 4848 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4849 TestObjectV8Internal::byteStringMethodMethod(info); 4850 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4851 } 4852 4853 static void scalarValueStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4854 { 4855 TestObject* impl = V8TestObject::toNative(info.Holder()); 4856 v8SetReturnValueString(info, impl->scalarValueStringMethod(), info.GetIsolate()); 4857 } 4858 4859 static void scalarValueStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4860 { 4861 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4862 TestObjectV8Internal::scalarValueStringMethodMethod(info); 4863 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4864 } 4865 4866 static void readonlyDOMTimeStampMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4867 { 4868 TestObject* impl = V8TestObject::toNative(info.Holder()); 4869 v8SetReturnValue(info, static_cast<double>(impl->readonlyDOMTimeStampMethod())); 4870 } 4871 4872 static void readonlyDOMTimeStampMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4873 { 4874 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4875 TestObjectV8Internal::readonlyDOMTimeStampMethodMethod(info); 4876 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4877 } 4878 4879 static void booleanMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4880 { 4881 TestObject* impl = V8TestObject::toNative(info.Holder()); 4882 v8SetReturnValueBool(info, impl->booleanMethod()); 4883 } 4884 4885 static void booleanMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4886 { 4887 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4888 TestObjectV8Internal::booleanMethodMethod(info); 4889 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4890 } 4891 4892 static void byteMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4893 { 4894 TestObject* impl = V8TestObject::toNative(info.Holder()); 4895 v8SetReturnValueInt(info, impl->byteMethod()); 4896 } 4897 4898 static void byteMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4899 { 4900 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4901 TestObjectV8Internal::byteMethodMethod(info); 4902 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4903 } 4904 4905 static void doubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4906 { 4907 TestObject* impl = V8TestObject::toNative(info.Holder()); 4908 v8SetReturnValue(info, impl->doubleMethod()); 4909 } 4910 4911 static void doubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4912 { 4913 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4914 TestObjectV8Internal::doubleMethodMethod(info); 4915 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4916 } 4917 4918 static void floatMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4919 { 4920 TestObject* impl = V8TestObject::toNative(info.Holder()); 4921 v8SetReturnValue(info, impl->floatMethod()); 4922 } 4923 4924 static void floatMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4925 { 4926 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4927 TestObjectV8Internal::floatMethodMethod(info); 4928 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4929 } 4930 4931 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4932 { 4933 TestObject* impl = V8TestObject::toNative(info.Holder()); 4934 v8SetReturnValueInt(info, impl->longMethod()); 4935 } 4936 4937 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4938 { 4939 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4940 TestObjectV8Internal::longMethodMethod(info); 4941 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4942 } 4943 4944 static void longLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4945 { 4946 TestObject* impl = V8TestObject::toNative(info.Holder()); 4947 v8SetReturnValue(info, static_cast<double>(impl->longLongMethod())); 4948 } 4949 4950 static void longLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4951 { 4952 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4953 TestObjectV8Internal::longLongMethodMethod(info); 4954 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4955 } 4956 4957 static void octetMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4958 { 4959 TestObject* impl = V8TestObject::toNative(info.Holder()); 4960 v8SetReturnValueUnsigned(info, impl->octetMethod()); 4961 } 4962 4963 static void octetMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4964 { 4965 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4966 TestObjectV8Internal::octetMethodMethod(info); 4967 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4968 } 4969 4970 static void shortMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4971 { 4972 TestObject* impl = V8TestObject::toNative(info.Holder()); 4973 v8SetReturnValueInt(info, impl->shortMethod()); 4974 } 4975 4976 static void shortMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4977 { 4978 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4979 TestObjectV8Internal::shortMethodMethod(info); 4980 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4981 } 4982 4983 static void unsignedLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4984 { 4985 TestObject* impl = V8TestObject::toNative(info.Holder()); 4986 v8SetReturnValueUnsigned(info, impl->unsignedLongMethod()); 4987 } 4988 4989 static void unsignedLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4990 { 4991 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4992 TestObjectV8Internal::unsignedLongMethodMethod(info); 4993 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 4994 } 4995 4996 static void unsignedLongLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4997 { 4998 TestObject* impl = V8TestObject::toNative(info.Holder()); 4999 v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongMethod())); 5000 } 5001 5002 static void unsignedLongLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5003 { 5004 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5005 TestObjectV8Internal::unsignedLongLongMethodMethod(info); 5006 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5007 } 5008 5009 static void unsignedShortMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5010 { 5011 TestObject* impl = V8TestObject::toNative(info.Holder()); 5012 v8SetReturnValueUnsigned(info, impl->unsignedShortMethod()); 5013 } 5014 5015 static void unsignedShortMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5016 { 5017 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5018 TestObjectV8Internal::unsignedShortMethodMethod(info); 5019 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5020 } 5021 5022 static void voidMethodDateArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5023 { 5024 if (UNLIKELY(info.Length() < 1)) { 5025 throwMinimumArityTypeErrorForMethod("voidMethodDateArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5026 return; 5027 } 5028 TestObject* impl = V8TestObject::toNative(info.Holder()); 5029 double dateArg; 5030 { 5031 v8::TryCatch block; 5032 V8RethrowTryCatchScope rethrow(block); 5033 TONATIVE_VOID_INTERNAL(dateArg, toCoreDate(info[0])); 5034 } 5035 impl->voidMethodDateArg(dateArg); 5036 } 5037 5038 static void voidMethodDateArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5039 { 5040 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5041 TestObjectV8Internal::voidMethodDateArgMethod(info); 5042 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5043 } 5044 5045 static void voidMethodStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5046 { 5047 if (UNLIKELY(info.Length() < 1)) { 5048 throwMinimumArityTypeErrorForMethod("voidMethodStringArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5049 return; 5050 } 5051 TestObject* impl = V8TestObject::toNative(info.Holder()); 5052 V8StringResource<> stringArg; 5053 { 5054 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 5055 } 5056 impl->voidMethodStringArg(stringArg); 5057 } 5058 5059 static void voidMethodStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5060 { 5061 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5062 TestObjectV8Internal::voidMethodStringArgMethod(info); 5063 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5064 } 5065 5066 static void voidMethodByteStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5067 { 5068 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodByteStringArg", "TestObject", info.Holder(), info.GetIsolate()); 5069 if (UNLIKELY(info.Length() < 1)) { 5070 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5071 return; 5072 } 5073 TestObject* impl = V8TestObject::toNative(info.Holder()); 5074 V8StringResource<> stringArg; 5075 { 5076 v8::TryCatch block; 5077 V8RethrowTryCatchScope rethrow(block); 5078 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(stringArg, toByteString(info[0], exceptionState), exceptionState); 5079 } 5080 impl->voidMethodByteStringArg(stringArg); 5081 } 5082 5083 static void voidMethodByteStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5084 { 5085 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5086 TestObjectV8Internal::voidMethodByteStringArgMethod(info); 5087 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5088 } 5089 5090 static void voidMethodScalarValueStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5091 { 5092 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodScalarValueStringArg", "TestObject", info.Holder(), info.GetIsolate()); 5093 if (UNLIKELY(info.Length() < 1)) { 5094 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5095 return; 5096 } 5097 TestObject* impl = V8TestObject::toNative(info.Holder()); 5098 V8StringResource<> scalarValueStringArg; 5099 { 5100 v8::TryCatch block; 5101 V8RethrowTryCatchScope rethrow(block); 5102 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(scalarValueStringArg, toScalarValueString(info[0], exceptionState), exceptionState); 5103 } 5104 impl->voidMethodScalarValueStringArg(scalarValueStringArg); 5105 } 5106 5107 static void voidMethodScalarValueStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5108 { 5109 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5110 TestObjectV8Internal::voidMethodScalarValueStringArgMethod(info); 5111 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5112 } 5113 5114 static void voidMethodDOMTimeStampArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5115 { 5116 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDOMTimeStampArg", "TestObject", info.Holder(), info.GetIsolate()); 5117 if (UNLIKELY(info.Length() < 1)) { 5118 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5119 return; 5120 } 5121 TestObject* impl = V8TestObject::toNative(info.Holder()); 5122 unsigned long long domTimeStampArg; 5123 { 5124 v8::TryCatch block; 5125 V8RethrowTryCatchScope rethrow(block); 5126 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(domTimeStampArg, toUInt64(info[0], exceptionState), exceptionState); 5127 } 5128 impl->voidMethodDOMTimeStampArg(domTimeStampArg); 5129 } 5130 5131 static void voidMethodDOMTimeStampArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5132 { 5133 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5134 TestObjectV8Internal::voidMethodDOMTimeStampArgMethod(info); 5135 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5136 } 5137 5138 static void voidMethodBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5139 { 5140 if (UNLIKELY(info.Length() < 1)) { 5141 throwMinimumArityTypeErrorForMethod("voidMethodBooleanArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5142 return; 5143 } 5144 TestObject* impl = V8TestObject::toNative(info.Holder()); 5145 bool booleanArg; 5146 { 5147 v8::TryCatch block; 5148 V8RethrowTryCatchScope rethrow(block); 5149 TONATIVE_VOID_INTERNAL(booleanArg, info[0]->BooleanValue()); 5150 } 5151 impl->voidMethodBooleanArg(booleanArg); 5152 } 5153 5154 static void voidMethodBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5155 { 5156 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5157 TestObjectV8Internal::voidMethodBooleanArgMethod(info); 5158 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5159 } 5160 5161 static void voidMethodByteArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5162 { 5163 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodByteArg", "TestObject", info.Holder(), info.GetIsolate()); 5164 if (UNLIKELY(info.Length() < 1)) { 5165 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5166 return; 5167 } 5168 TestObject* impl = V8TestObject::toNative(info.Holder()); 5169 int byteArg; 5170 { 5171 v8::TryCatch block; 5172 V8RethrowTryCatchScope rethrow(block); 5173 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(byteArg, toInt8(info[0], exceptionState), exceptionState); 5174 } 5175 impl->voidMethodByteArg(byteArg); 5176 } 5177 5178 static void voidMethodByteArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5179 { 5180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5181 TestObjectV8Internal::voidMethodByteArgMethod(info); 5182 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5183 } 5184 5185 static void voidMethodDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5186 { 5187 if (UNLIKELY(info.Length() < 1)) { 5188 throwMinimumArityTypeErrorForMethod("voidMethodDoubleArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5189 return; 5190 } 5191 TestObject* impl = V8TestObject::toNative(info.Holder()); 5192 double doubleArg; 5193 { 5194 v8::TryCatch block; 5195 V8RethrowTryCatchScope rethrow(block); 5196 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberValue())); 5197 } 5198 impl->voidMethodDoubleArg(doubleArg); 5199 } 5200 5201 static void voidMethodDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5202 { 5203 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5204 TestObjectV8Internal::voidMethodDoubleArgMethod(info); 5205 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5206 } 5207 5208 static void voidMethodFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5209 { 5210 if (UNLIKELY(info.Length() < 1)) { 5211 throwMinimumArityTypeErrorForMethod("voidMethodFloatArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5212 return; 5213 } 5214 TestObject* impl = V8TestObject::toNative(info.Holder()); 5215 float floatArg; 5216 { 5217 v8::TryCatch block; 5218 V8RethrowTryCatchScope rethrow(block); 5219 TONATIVE_VOID_INTERNAL(floatArg, static_cast<float>(info[0]->NumberValue())); 5220 } 5221 impl->voidMethodFloatArg(floatArg); 5222 } 5223 5224 static void voidMethodFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5225 { 5226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5227 TestObjectV8Internal::voidMethodFloatArgMethod(info); 5228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5229 } 5230 5231 static void voidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5232 { 5233 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArg", "TestObject", info.Holder(), info.GetIsolate()); 5234 if (UNLIKELY(info.Length() < 1)) { 5235 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5236 return; 5237 } 5238 TestObject* impl = V8TestObject::toNative(info.Holder()); 5239 int longArg; 5240 { 5241 v8::TryCatch block; 5242 V8RethrowTryCatchScope rethrow(block); 5243 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 5244 } 5245 impl->voidMethodLongArg(longArg); 5246 } 5247 5248 static void voidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5249 { 5250 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5251 TestObjectV8Internal::voidMethodLongArgMethod(info); 5252 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5253 } 5254 5255 static void voidMethodLongLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5256 { 5257 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongLongArg", "TestObject", info.Holder(), info.GetIsolate()); 5258 if (UNLIKELY(info.Length() < 1)) { 5259 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5260 return; 5261 } 5262 TestObject* impl = V8TestObject::toNative(info.Holder()); 5263 long long longLongArg; 5264 { 5265 v8::TryCatch block; 5266 V8RethrowTryCatchScope rethrow(block); 5267 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longLongArg, toInt64(info[0], exceptionState), exceptionState); 5268 } 5269 impl->voidMethodLongLongArg(longLongArg); 5270 } 5271 5272 static void voidMethodLongLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5273 { 5274 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5275 TestObjectV8Internal::voidMethodLongLongArgMethod(info); 5276 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5277 } 5278 5279 static void voidMethodOctetArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5280 { 5281 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodOctetArg", "TestObject", info.Holder(), info.GetIsolate()); 5282 if (UNLIKELY(info.Length() < 1)) { 5283 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5284 return; 5285 } 5286 TestObject* impl = V8TestObject::toNative(info.Holder()); 5287 unsigned octetArg; 5288 { 5289 v8::TryCatch block; 5290 V8RethrowTryCatchScope rethrow(block); 5291 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(octetArg, toUInt8(info[0], exceptionState), exceptionState); 5292 } 5293 impl->voidMethodOctetArg(octetArg); 5294 } 5295 5296 static void voidMethodOctetArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5297 { 5298 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5299 TestObjectV8Internal::voidMethodOctetArgMethod(info); 5300 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5301 } 5302 5303 static void voidMethodShortArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5304 { 5305 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodShortArg", "TestObject", info.Holder(), info.GetIsolate()); 5306 if (UNLIKELY(info.Length() < 1)) { 5307 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5308 return; 5309 } 5310 TestObject* impl = V8TestObject::toNative(info.Holder()); 5311 int shortArg; 5312 { 5313 v8::TryCatch block; 5314 V8RethrowTryCatchScope rethrow(block); 5315 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(shortArg, toInt16(info[0], exceptionState), exceptionState); 5316 } 5317 impl->voidMethodShortArg(shortArg); 5318 } 5319 5320 static void voidMethodShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5321 { 5322 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5323 TestObjectV8Internal::voidMethodShortArgMethod(info); 5324 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5325 } 5326 5327 static void voidMethodUnsignedLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5328 { 5329 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedLongArg", "TestObject", info.Holder(), info.GetIsolate()); 5330 if (UNLIKELY(info.Length() < 1)) { 5331 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5332 return; 5333 } 5334 TestObject* impl = V8TestObject::toNative(info.Holder()); 5335 unsigned unsignedLongArg; 5336 { 5337 v8::TryCatch block; 5338 V8RethrowTryCatchScope rethrow(block); 5339 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(unsignedLongArg, toUInt32(info[0], exceptionState), exceptionState); 5340 } 5341 impl->voidMethodUnsignedLongArg(unsignedLongArg); 5342 } 5343 5344 static void voidMethodUnsignedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5345 { 5346 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5347 TestObjectV8Internal::voidMethodUnsignedLongArgMethod(info); 5348 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5349 } 5350 5351 static void voidMethodUnsignedLongLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5352 { 5353 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedLongLongArg", "TestObject", info.Holder(), info.GetIsolate()); 5354 if (UNLIKELY(info.Length() < 1)) { 5355 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5356 return; 5357 } 5358 TestObject* impl = V8TestObject::toNative(info.Holder()); 5359 unsigned long long unsignedLongLongArg; 5360 { 5361 v8::TryCatch block; 5362 V8RethrowTryCatchScope rethrow(block); 5363 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(unsignedLongLongArg, toUInt64(info[0], exceptionState), exceptionState); 5364 } 5365 impl->voidMethodUnsignedLongLongArg(unsignedLongLongArg); 5366 } 5367 5368 static void voidMethodUnsignedLongLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5369 { 5370 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5371 TestObjectV8Internal::voidMethodUnsignedLongLongArgMethod(info); 5372 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5373 } 5374 5375 static void voidMethodUnsignedShortArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5376 { 5377 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedShortArg", "TestObject", info.Holder(), info.GetIsolate()); 5378 if (UNLIKELY(info.Length() < 1)) { 5379 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 5380 return; 5381 } 5382 TestObject* impl = V8TestObject::toNative(info.Holder()); 5383 unsigned unsignedShortArg; 5384 { 5385 v8::TryCatch block; 5386 V8RethrowTryCatchScope rethrow(block); 5387 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(unsignedShortArg, toUInt16(info[0], exceptionState), exceptionState); 5388 } 5389 impl->voidMethodUnsignedShortArg(unsignedShortArg); 5390 } 5391 5392 static void voidMethodUnsignedShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5393 { 5394 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5395 TestObjectV8Internal::voidMethodUnsignedShortArgMethod(info); 5396 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5397 } 5398 5399 static void testInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5400 { 5401 TestObject* impl = V8TestObject::toNative(info.Holder()); 5402 v8SetReturnValue(info, impl->testInterfaceEmptyMethod()); 5403 } 5404 5405 static void testInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5406 { 5407 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5408 TestObjectV8Internal::testInterfaceEmptyMethodMethod(info); 5409 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5410 } 5411 5412 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5413 { 5414 if (UNLIKELY(info.Length() < 1)) { 5415 throwMinimumArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5416 return; 5417 } 5418 TestObject* impl = V8TestObject::toNative(info.Holder()); 5419 TestInterfaceEmpty* testInterfaceEmptyArg; 5420 { 5421 v8::TryCatch block; 5422 V8RethrowTryCatchScope rethrow(block); 5423 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 5424 } 5425 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 5426 } 5427 5428 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5429 { 5430 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5431 TestObjectV8Internal::voidMethodTestInterfaceEmptyArgMethod(info); 5432 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5433 } 5434 5435 static void voidMethodLongArgTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5436 { 5437 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate()); 5438 if (UNLIKELY(info.Length() < 2)) { 5439 throwMinimumArityTypeError(exceptionState, 2, info.Length()); 5440 return; 5441 } 5442 TestObject* impl = V8TestObject::toNative(info.Holder()); 5443 int longArg; 5444 TestInterfaceEmpty* testInterfaceEmptyArg; 5445 { 5446 v8::TryCatch block; 5447 V8RethrowTryCatchScope rethrow(block); 5448 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 5449 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[1])); 5450 } 5451 impl->voidMethodLongArgTestInterfaceEmptyArg(longArg, testInterfaceEmptyArg); 5452 } 5453 5454 static void voidMethodLongArgTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5455 { 5456 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5457 TestObjectV8Internal::voidMethodLongArgTestInterfaceEmptyArgMethod(info); 5458 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5459 } 5460 5461 static void voidCallbackFunctionMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5462 { 5463 TestObject* impl = V8TestObject::toNative(info.Holder()); 5464 v8SetReturnValue(info, impl->voidCallbackFunctionMethod().v8Value()); 5465 } 5466 5467 static void voidCallbackFunctionMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5468 { 5469 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5470 TestObjectV8Internal::voidCallbackFunctionMethodMethod(info); 5471 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5472 } 5473 5474 static void anyCallbackFunctionOptionalAnyArgMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5475 { 5476 TestObject* impl = V8TestObject::toNative(info.Holder()); 5477 v8SetReturnValue(info, impl->anyCallbackFunctionOptionalAnyArgMethod().v8Value()); 5478 } 5479 5480 static void anyCallbackFunctionOptionalAnyArgMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5481 { 5482 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5483 TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgMethodMethod(info); 5484 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5485 } 5486 5487 static void voidMethodVoidCallbackFunctionArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5488 { 5489 if (UNLIKELY(info.Length() < 1)) { 5490 throwMinimumArityTypeErrorForMethod("voidMethodVoidCallbackFunctionArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5491 return; 5492 } 5493 TestObject* impl = V8TestObject::toNative(info.Holder()); 5494 ScriptValue voidCallbackFunctionArg; 5495 { 5496 v8::TryCatch block; 5497 V8RethrowTryCatchScope rethrow(block); 5498 TONATIVE_VOID_INTERNAL(voidCallbackFunctionArg, ScriptValue(ScriptState::current(info.GetIsolate()), info[0])); 5499 } 5500 impl->voidMethodVoidCallbackFunctionArg(voidCallbackFunctionArg); 5501 } 5502 5503 static void voidMethodVoidCallbackFunctionArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5504 { 5505 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5506 TestObjectV8Internal::voidMethodVoidCallbackFunctionArgMethod(info); 5507 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5508 } 5509 5510 static void voidMethodAnyCallbackFunctionOptionalAnyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5511 { 5512 if (UNLIKELY(info.Length() < 1)) { 5513 throwMinimumArityTypeErrorForMethod("voidMethodAnyCallbackFunctionOptionalAnyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5514 return; 5515 } 5516 TestObject* impl = V8TestObject::toNative(info.Holder()); 5517 ScriptValue anyCallbackFunctionOptionalAnyArgArg; 5518 { 5519 v8::TryCatch block; 5520 V8RethrowTryCatchScope rethrow(block); 5521 TONATIVE_VOID_INTERNAL(anyCallbackFunctionOptionalAnyArgArg, ScriptValue(ScriptState::current(info.GetIsolate()), info[0])); 5522 } 5523 impl->voidMethodAnyCallbackFunctionOptionalAnyArg(anyCallbackFunctionOptionalAnyArgArg); 5524 } 5525 5526 static void voidMethodAnyCallbackFunctionOptionalAnyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5527 { 5528 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5529 TestObjectV8Internal::voidMethodAnyCallbackFunctionOptionalAnyArgMethod(info); 5530 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5531 } 5532 5533 static void compareHowMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5534 { 5535 TestObject* impl = V8TestObject::toNative(info.Holder()); 5536 v8SetReturnValue(info, impl->compareHowMethod()); 5537 } 5538 5539 static void compareHowMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5540 { 5541 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5542 TestObjectV8Internal::compareHowMethodMethod(info); 5543 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5544 } 5545 5546 static void anyMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5547 { 5548 TestObject* impl = V8TestObject::toNative(info.Holder()); 5549 v8SetReturnValue(info, impl->anyMethod().v8Value()); 5550 } 5551 5552 static void anyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5553 { 5554 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5555 TestObjectV8Internal::anyMethodMethod(info); 5556 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5557 } 5558 5559 static void voidMethodCompareHowArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5560 { 5561 if (UNLIKELY(info.Length() < 1)) { 5562 throwMinimumArityTypeErrorForMethod("voidMethodCompareHowArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5563 return; 5564 } 5565 TestObject* impl = V8TestObject::toNative(info.Holder()); 5566 Range::CompareHow compareHowArg; 5567 { 5568 v8::TryCatch block; 5569 V8RethrowTryCatchScope rethrow(block); 5570 TONATIVE_VOID_INTERNAL(compareHowArg, static_cast<Range::CompareHow>(info[0]->Int32Value())); 5571 } 5572 impl->voidMethodCompareHowArg(compareHowArg); 5573 } 5574 5575 static void voidMethodCompareHowArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5576 { 5577 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5578 TestObjectV8Internal::voidMethodCompareHowArgMethod(info); 5579 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5580 } 5581 5582 static void voidMethodEventTargetArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5583 { 5584 if (UNLIKELY(info.Length() < 1)) { 5585 throwMinimumArityTypeErrorForMethod("voidMethodEventTargetArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5586 return; 5587 } 5588 TestObject* impl = V8TestObject::toNative(info.Holder()); 5589 EventTarget* eventTargetArg; 5590 { 5591 v8::TryCatch block; 5592 V8RethrowTryCatchScope rethrow(block); 5593 TONATIVE_VOID_INTERNAL(eventTargetArg, V8DOMWrapper::isDOMWrapper(info[0]) ? toWrapperTypeInfo(v8::Handle<v8::Object>::Cast(info[0]))->toEventTarget(v8::Handle<v8::Object>::Cast(info[0])) : 0); 5594 } 5595 impl->voidMethodEventTargetArg(eventTargetArg); 5596 } 5597 5598 static void voidMethodEventTargetArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5599 { 5600 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5601 TestObjectV8Internal::voidMethodEventTargetArgMethod(info); 5602 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5603 } 5604 5605 static void voidMethodMediaQueryListListenerArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5606 { 5607 if (UNLIKELY(info.Length() < 1)) { 5608 throwMinimumArityTypeErrorForMethod("voidMethodMediaQueryListListenerArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5609 return; 5610 } 5611 TestObject* impl = V8TestObject::toNative(info.Holder()); 5612 RefPtrWillBeRawPtr<MediaQueryListListener> mediaQueryListListenerArg; 5613 { 5614 v8::TryCatch block; 5615 V8RethrowTryCatchScope rethrow(block); 5616 TONATIVE_VOID_INTERNAL(mediaQueryListListenerArg, MediaQueryListListener::create(ScriptState::current(info.GetIsolate()), ScriptValue(ScriptState::current(info.GetIsolate()), info[0]))); 5617 } 5618 impl->voidMethodMediaQueryListListenerArg(mediaQueryListListenerArg); 5619 } 5620 5621 static void voidMethodMediaQueryListListenerArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5622 { 5623 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5624 TestObjectV8Internal::voidMethodMediaQueryListListenerArgMethod(info); 5625 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5626 } 5627 5628 static void voidMethodAnyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5629 { 5630 if (UNLIKELY(info.Length() < 1)) { 5631 throwMinimumArityTypeErrorForMethod("voidMethodAnyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5632 return; 5633 } 5634 TestObject* impl = V8TestObject::toNative(info.Holder()); 5635 ScriptValue anyArg; 5636 { 5637 v8::TryCatch block; 5638 V8RethrowTryCatchScope rethrow(block); 5639 TONATIVE_VOID_INTERNAL(anyArg, ScriptValue(ScriptState::current(info.GetIsolate()), info[0])); 5640 } 5641 impl->voidMethodAnyArg(anyArg); 5642 } 5643 5644 static void voidMethodAnyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5645 { 5646 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5647 TestObjectV8Internal::voidMethodAnyArgMethod(info); 5648 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5649 } 5650 5651 static void voidMethodAttrArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5652 { 5653 if (UNLIKELY(info.Length() < 1)) { 5654 throwMinimumArityTypeErrorForMethod("voidMethodAttrArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5655 return; 5656 } 5657 TestObject* impl = V8TestObject::toNative(info.Holder()); 5658 Attr* attrArg; 5659 { 5660 v8::TryCatch block; 5661 V8RethrowTryCatchScope rethrow(block); 5662 TONATIVE_VOID_INTERNAL(attrArg, V8Attr::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 5663 } 5664 impl->voidMethodAttrArg(attrArg); 5665 } 5666 5667 static void voidMethodAttrArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5668 { 5669 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5670 TestObjectV8Internal::voidMethodAttrArgMethod(info); 5671 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5672 } 5673 5674 static void voidMethodDocumentArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5675 { 5676 if (UNLIKELY(info.Length() < 1)) { 5677 throwMinimumArityTypeErrorForMethod("voidMethodDocumentArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5678 return; 5679 } 5680 TestObject* impl = V8TestObject::toNative(info.Holder()); 5681 Document* documentArg; 5682 { 5683 v8::TryCatch block; 5684 V8RethrowTryCatchScope rethrow(block); 5685 TONATIVE_VOID_INTERNAL(documentArg, V8Document::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 5686 } 5687 impl->voidMethodDocumentArg(documentArg); 5688 } 5689 5690 static void voidMethodDocumentArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5691 { 5692 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5693 TestObjectV8Internal::voidMethodDocumentArgMethod(info); 5694 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5695 } 5696 5697 static void voidMethodDocumentTypeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5698 { 5699 if (UNLIKELY(info.Length() < 1)) { 5700 throwMinimumArityTypeErrorForMethod("voidMethodDocumentTypeArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5701 return; 5702 } 5703 TestObject* impl = V8TestObject::toNative(info.Holder()); 5704 DocumentType* documentTypeArg; 5705 { 5706 v8::TryCatch block; 5707 V8RethrowTryCatchScope rethrow(block); 5708 TONATIVE_VOID_INTERNAL(documentTypeArg, V8DocumentType::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 5709 } 5710 impl->voidMethodDocumentTypeArg(documentTypeArg); 5711 } 5712 5713 static void voidMethodDocumentTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5714 { 5715 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5716 TestObjectV8Internal::voidMethodDocumentTypeArgMethod(info); 5717 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5718 } 5719 5720 static void voidMethodElementArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5721 { 5722 if (UNLIKELY(info.Length() < 1)) { 5723 throwMinimumArityTypeErrorForMethod("voidMethodElementArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5724 return; 5725 } 5726 TestObject* impl = V8TestObject::toNative(info.Holder()); 5727 Element* elementArg; 5728 { 5729 v8::TryCatch block; 5730 V8RethrowTryCatchScope rethrow(block); 5731 TONATIVE_VOID_INTERNAL(elementArg, V8Element::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 5732 } 5733 impl->voidMethodElementArg(elementArg); 5734 } 5735 5736 static void voidMethodElementArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5737 { 5738 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5739 TestObjectV8Internal::voidMethodElementArgMethod(info); 5740 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5741 } 5742 5743 static void voidMethodNodeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5744 { 5745 if (UNLIKELY(info.Length() < 1)) { 5746 throwMinimumArityTypeErrorForMethod("voidMethodNodeArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5747 return; 5748 } 5749 TestObject* impl = V8TestObject::toNative(info.Holder()); 5750 Node* nodeArg; 5751 { 5752 v8::TryCatch block; 5753 V8RethrowTryCatchScope rethrow(block); 5754 TONATIVE_VOID_INTERNAL(nodeArg, V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 5755 } 5756 impl->voidMethodNodeArg(nodeArg); 5757 } 5758 5759 static void voidMethodNodeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5760 { 5761 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5762 TestObjectV8Internal::voidMethodNodeArgMethod(info); 5763 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5764 } 5765 5766 static void arrayBufferMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5767 { 5768 TestObject* impl = V8TestObject::toNative(info.Holder()); 5769 v8SetReturnValue(info, impl->arrayBufferMethod()); 5770 } 5771 5772 static void arrayBufferMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5773 { 5774 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5775 TestObjectV8Internal::arrayBufferMethodMethod(info); 5776 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5777 } 5778 5779 static void arrayBufferViewMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5780 { 5781 TestObject* impl = V8TestObject::toNative(info.Holder()); 5782 v8SetReturnValue(info, impl->arrayBufferViewMethod()); 5783 } 5784 5785 static void arrayBufferViewMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5786 { 5787 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5788 TestObjectV8Internal::arrayBufferViewMethodMethod(info); 5789 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5790 } 5791 5792 static void float32ArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5793 { 5794 TestObject* impl = V8TestObject::toNative(info.Holder()); 5795 v8SetReturnValue(info, impl->float32ArrayMethod()); 5796 } 5797 5798 static void float32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5799 { 5800 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5801 TestObjectV8Internal::float32ArrayMethodMethod(info); 5802 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5803 } 5804 5805 static void int32ArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5806 { 5807 TestObject* impl = V8TestObject::toNative(info.Holder()); 5808 v8SetReturnValue(info, impl->int32ArrayMethod()); 5809 } 5810 5811 static void int32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5812 { 5813 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5814 TestObjectV8Internal::int32ArrayMethodMethod(info); 5815 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5816 } 5817 5818 static void uint8ArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5819 { 5820 TestObject* impl = V8TestObject::toNative(info.Holder()); 5821 v8SetReturnValue(info, impl->uint8ArrayMethod()); 5822 } 5823 5824 static void uint8ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5825 { 5826 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5827 TestObjectV8Internal::uint8ArrayMethodMethod(info); 5828 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5829 } 5830 5831 static void voidMethodArrayBufferArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5832 { 5833 if (UNLIKELY(info.Length() < 1)) { 5834 throwMinimumArityTypeErrorForMethod("voidMethodArrayBufferArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5835 return; 5836 } 5837 TestObject* impl = V8TestObject::toNative(info.Holder()); 5838 ArrayBuffer* arrayBufferArg; 5839 { 5840 v8::TryCatch block; 5841 V8RethrowTryCatchScope rethrow(block); 5842 TONATIVE_VOID_INTERNAL(arrayBufferArg, info[0]->IsArrayBuffer() ? V8ArrayBuffer::toNative(v8::Handle<v8::ArrayBuffer>::Cast(info[0])) : 0); 5843 } 5844 impl->voidMethodArrayBufferArg(arrayBufferArg); 5845 } 5846 5847 static void voidMethodArrayBufferArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5848 { 5849 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5850 TestObjectV8Internal::voidMethodArrayBufferArgMethod(info); 5851 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5852 } 5853 5854 static void voidMethodArrayBufferOrNullArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5855 { 5856 if (UNLIKELY(info.Length() < 1)) { 5857 throwMinimumArityTypeErrorForMethod("voidMethodArrayBufferOrNullArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5858 return; 5859 } 5860 TestObject* impl = V8TestObject::toNative(info.Holder()); 5861 ArrayBuffer* arrayBufferArg; 5862 { 5863 v8::TryCatch block; 5864 V8RethrowTryCatchScope rethrow(block); 5865 TONATIVE_VOID_INTERNAL(arrayBufferArg, info[0]->IsArrayBuffer() ? V8ArrayBuffer::toNative(v8::Handle<v8::ArrayBuffer>::Cast(info[0])) : 0); 5866 } 5867 impl->voidMethodArrayBufferOrNullArg(arrayBufferArg); 5868 } 5869 5870 static void voidMethodArrayBufferOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5871 { 5872 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5873 TestObjectV8Internal::voidMethodArrayBufferOrNullArgMethod(info); 5874 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5875 } 5876 5877 static void voidMethodArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5878 { 5879 if (UNLIKELY(info.Length() < 1)) { 5880 throwMinimumArityTypeErrorForMethod("voidMethodArrayBufferViewArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5881 return; 5882 } 5883 TestObject* impl = V8TestObject::toNative(info.Holder()); 5884 ArrayBufferView* arrayBufferViewArg; 5885 { 5886 v8::TryCatch block; 5887 V8RethrowTryCatchScope rethrow(block); 5888 TONATIVE_VOID_INTERNAL(arrayBufferViewArg, info[0]->IsArrayBufferView() ? V8ArrayBufferView::toNative(v8::Handle<v8::ArrayBufferView>::Cast(info[0])) : 0); 5889 } 5890 impl->voidMethodArrayBufferViewArg(arrayBufferViewArg); 5891 } 5892 5893 static void voidMethodArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5894 { 5895 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5896 TestObjectV8Internal::voidMethodArrayBufferViewArgMethod(info); 5897 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5898 } 5899 5900 static void voidMethodFloat32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5901 { 5902 if (UNLIKELY(info.Length() < 1)) { 5903 throwMinimumArityTypeErrorForMethod("voidMethodFloat32ArrayArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5904 return; 5905 } 5906 TestObject* impl = V8TestObject::toNative(info.Holder()); 5907 Float32Array* float32ArrayArg; 5908 { 5909 v8::TryCatch block; 5910 V8RethrowTryCatchScope rethrow(block); 5911 TONATIVE_VOID_INTERNAL(float32ArrayArg, info[0]->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(info[0])) : 0); 5912 } 5913 impl->voidMethodFloat32ArrayArg(float32ArrayArg); 5914 } 5915 5916 static void voidMethodFloat32ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5917 { 5918 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5919 TestObjectV8Internal::voidMethodFloat32ArrayArgMethod(info); 5920 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5921 } 5922 5923 static void voidMethodInt32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5924 { 5925 if (UNLIKELY(info.Length() < 1)) { 5926 throwMinimumArityTypeErrorForMethod("voidMethodInt32ArrayArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5927 return; 5928 } 5929 TestObject* impl = V8TestObject::toNative(info.Holder()); 5930 Int32Array* int32ArrayArg; 5931 { 5932 v8::TryCatch block; 5933 V8RethrowTryCatchScope rethrow(block); 5934 TONATIVE_VOID_INTERNAL(int32ArrayArg, info[0]->IsInt32Array() ? V8Int32Array::toNative(v8::Handle<v8::Int32Array>::Cast(info[0])) : 0); 5935 } 5936 impl->voidMethodInt32ArrayArg(int32ArrayArg); 5937 } 5938 5939 static void voidMethodInt32ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5940 { 5941 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5942 TestObjectV8Internal::voidMethodInt32ArrayArgMethod(info); 5943 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5944 } 5945 5946 static void voidMethodUint8ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5947 { 5948 if (UNLIKELY(info.Length() < 1)) { 5949 throwMinimumArityTypeErrorForMethod("voidMethodUint8ArrayArg", "TestObject", 1, info.Length(), info.GetIsolate()); 5950 return; 5951 } 5952 TestObject* impl = V8TestObject::toNative(info.Holder()); 5953 Uint8Array* uint8ArrayArg; 5954 { 5955 v8::TryCatch block; 5956 V8RethrowTryCatchScope rethrow(block); 5957 TONATIVE_VOID_INTERNAL(uint8ArrayArg, info[0]->IsUint8Array() ? V8Uint8Array::toNative(v8::Handle<v8::Uint8Array>::Cast(info[0])) : 0); 5958 } 5959 impl->voidMethodUint8ArrayArg(uint8ArrayArg); 5960 } 5961 5962 static void voidMethodUint8ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5963 { 5964 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5965 TestObjectV8Internal::voidMethodUint8ArrayArgMethod(info); 5966 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5967 } 5968 5969 static void longArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5970 { 5971 TestObject* impl = V8TestObject::toNative(info.Holder()); 5972 v8SetReturnValue(info, v8Array(impl->longArrayMethod(), info.Holder(), info.GetIsolate())); 5973 } 5974 5975 static void longArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5976 { 5977 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5978 TestObjectV8Internal::longArrayMethodMethod(info); 5979 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5980 } 5981 5982 static void stringArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5983 { 5984 TestObject* impl = V8TestObject::toNative(info.Holder()); 5985 v8SetReturnValue(info, v8Array(impl->stringArrayMethod(), info.Holder(), info.GetIsolate())); 5986 } 5987 5988 static void stringArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5989 { 5990 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5991 TestObjectV8Internal::stringArrayMethodMethod(info); 5992 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5993 } 5994 5995 static void testInterfaceEmptyArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5996 { 5997 TestObject* impl = V8TestObject::toNative(info.Holder()); 5998 v8SetReturnValue(info, v8Array(impl->testInterfaceEmptyArrayMethod(), info.Holder(), info.GetIsolate())); 5999 } 6000 6001 static void testInterfaceEmptyArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6002 { 6003 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6004 TestObjectV8Internal::testInterfaceEmptyArrayMethodMethod(info); 6005 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6006 } 6007 6008 static void voidMethodArrayLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6009 { 6010 if (UNLIKELY(info.Length() < 1)) { 6011 throwMinimumArityTypeErrorForMethod("voidMethodArrayLongArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6012 return; 6013 } 6014 TestObject* impl = V8TestObject::toNative(info.Holder()); 6015 Vector<int> arrayLongArg; 6016 { 6017 v8::TryCatch block; 6018 V8RethrowTryCatchScope rethrow(block); 6019 TONATIVE_VOID_INTERNAL(arrayLongArg, toNativeArray<int>(info[0], 1, info.GetIsolate())); 6020 } 6021 impl->voidMethodArrayLongArg(arrayLongArg); 6022 } 6023 6024 static void voidMethodArrayLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6025 { 6026 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6027 TestObjectV8Internal::voidMethodArrayLongArgMethod(info); 6028 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6029 } 6030 6031 static void voidMethodArrayStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6032 { 6033 if (UNLIKELY(info.Length() < 1)) { 6034 throwMinimumArityTypeErrorForMethod("voidMethodArrayStringArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6035 return; 6036 } 6037 TestObject* impl = V8TestObject::toNative(info.Holder()); 6038 Vector<String> arrayStringArg; 6039 { 6040 v8::TryCatch block; 6041 V8RethrowTryCatchScope rethrow(block); 6042 TONATIVE_VOID_INTERNAL(arrayStringArg, toNativeArray<String>(info[0], 1, info.GetIsolate())); 6043 } 6044 impl->voidMethodArrayStringArg(arrayStringArg); 6045 } 6046 6047 static void voidMethodArrayStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6048 { 6049 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6050 TestObjectV8Internal::voidMethodArrayStringArgMethod(info); 6051 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6052 } 6053 6054 static void voidMethodArrayTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6055 { 6056 if (UNLIKELY(info.Length() < 1)) { 6057 throwMinimumArityTypeErrorForMethod("voidMethodArrayTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6058 return; 6059 } 6060 TestObject* impl = V8TestObject::toNative(info.Holder()); 6061 Vector<RefPtr<TestInterfaceEmpty> > arrayTestInterfaceEmptyArg; 6062 { 6063 v8::TryCatch block; 6064 V8RethrowTryCatchScope rethrow(block); 6065 TONATIVE_VOID_INTERNAL(arrayTestInterfaceEmptyArg, (toRefPtrNativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(info[0], 1, info.GetIsolate()))); 6066 } 6067 impl->voidMethodArrayTestInterfaceEmptyArg(arrayTestInterfaceEmptyArg); 6068 } 6069 6070 static void voidMethodArrayTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6071 { 6072 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6073 TestObjectV8Internal::voidMethodArrayTestInterfaceEmptyArgMethod(info); 6074 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6075 } 6076 6077 static void longSequenceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6078 { 6079 TestObject* impl = V8TestObject::toNative(info.Holder()); 6080 v8SetReturnValue(info, v8Array(impl->longSequenceMethod(), info.Holder(), info.GetIsolate())); 6081 } 6082 6083 static void longSequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6084 { 6085 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6086 TestObjectV8Internal::longSequenceMethodMethod(info); 6087 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6088 } 6089 6090 static void stringSequenceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6091 { 6092 TestObject* impl = V8TestObject::toNative(info.Holder()); 6093 v8SetReturnValue(info, v8Array(impl->stringSequenceMethod(), info.Holder(), info.GetIsolate())); 6094 } 6095 6096 static void stringSequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6097 { 6098 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6099 TestObjectV8Internal::stringSequenceMethodMethod(info); 6100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6101 } 6102 6103 static void testInterfaceEmptySequenceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6104 { 6105 TestObject* impl = V8TestObject::toNative(info.Holder()); 6106 v8SetReturnValue(info, v8Array(impl->testInterfaceEmptySequenceMethod(), info.Holder(), info.GetIsolate())); 6107 } 6108 6109 static void testInterfaceEmptySequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6110 { 6111 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6112 TestObjectV8Internal::testInterfaceEmptySequenceMethodMethod(info); 6113 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6114 } 6115 6116 static void voidMethodSequenceLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6117 { 6118 if (UNLIKELY(info.Length() < 1)) { 6119 throwMinimumArityTypeErrorForMethod("voidMethodSequenceLongArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6120 return; 6121 } 6122 TestObject* impl = V8TestObject::toNative(info.Holder()); 6123 Vector<int> longSequenceArg; 6124 { 6125 v8::TryCatch block; 6126 V8RethrowTryCatchScope rethrow(block); 6127 TONATIVE_VOID_INTERNAL(longSequenceArg, toNativeArray<int>(info[0], 1, info.GetIsolate())); 6128 } 6129 impl->voidMethodSequenceLongArg(longSequenceArg); 6130 } 6131 6132 static void voidMethodSequenceLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6133 { 6134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6135 TestObjectV8Internal::voidMethodSequenceLongArgMethod(info); 6136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6137 } 6138 6139 static void voidMethodSequenceStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6140 { 6141 if (UNLIKELY(info.Length() < 1)) { 6142 throwMinimumArityTypeErrorForMethod("voidMethodSequenceStringArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6143 return; 6144 } 6145 TestObject* impl = V8TestObject::toNative(info.Holder()); 6146 Vector<String> stringSequenceArg; 6147 { 6148 v8::TryCatch block; 6149 V8RethrowTryCatchScope rethrow(block); 6150 TONATIVE_VOID_INTERNAL(stringSequenceArg, toNativeArray<String>(info[0], 1, info.GetIsolate())); 6151 } 6152 impl->voidMethodSequenceStringArg(stringSequenceArg); 6153 } 6154 6155 static void voidMethodSequenceStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6156 { 6157 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6158 TestObjectV8Internal::voidMethodSequenceStringArgMethod(info); 6159 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6160 } 6161 6162 static void voidMethodSequenceTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6163 { 6164 if (UNLIKELY(info.Length() < 1)) { 6165 throwMinimumArityTypeErrorForMethod("voidMethodSequenceTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6166 return; 6167 } 6168 TestObject* impl = V8TestObject::toNative(info.Holder()); 6169 Vector<RefPtr<TestInterfaceEmpty> > testInterfaceEmptySequenceArg; 6170 { 6171 v8::TryCatch block; 6172 V8RethrowTryCatchScope rethrow(block); 6173 TONATIVE_VOID_INTERNAL(testInterfaceEmptySequenceArg, (toRefPtrNativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(info[0], 1, info.GetIsolate()))); 6174 } 6175 impl->voidMethodSequenceTestInterfaceEmptyArg(testInterfaceEmptySequenceArg); 6176 } 6177 6178 static void voidMethodSequenceTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6179 { 6180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6181 TestObjectV8Internal::voidMethodSequenceTestInterfaceEmptyArgMethod(info); 6182 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6183 } 6184 6185 static void voidMethodTestInterfaceEmptyOrNullArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6186 { 6187 if (UNLIKELY(info.Length() < 1)) { 6188 throwMinimumArityTypeErrorForMethod("voidMethodTestInterfaceEmptyOrNullArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6189 return; 6190 } 6191 TestObject* impl = V8TestObject::toNative(info.Holder()); 6192 TestInterfaceEmpty* nullableTestInterfaceEmptyArg; 6193 { 6194 v8::TryCatch block; 6195 V8RethrowTryCatchScope rethrow(block); 6196 TONATIVE_VOID_INTERNAL(nullableTestInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 6197 } 6198 impl->voidMethodTestInterfaceEmptyOrNullArg(nullableTestInterfaceEmptyArg); 6199 } 6200 6201 static void voidMethodTestInterfaceEmptyOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6202 { 6203 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6204 TestObjectV8Internal::voidMethodTestInterfaceEmptyOrNullArgMethod(info); 6205 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6206 } 6207 6208 static void voidMethodTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6209 { 6210 if (UNLIKELY(info.Length() < 1)) { 6211 throwMinimumArityTypeErrorForMethod("voidMethodTestCallbackInterfaceArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6212 return; 6213 } 6214 TestObject* impl = V8TestObject::toNative(info.Holder()); 6215 OwnPtr<TestCallbackInterface> testCallbackInterfaceArg; 6216 { 6217 if (info.Length() <= 0 || !info[0]->IsFunction()) { 6218 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestCallbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); 6219 return; 6220 } 6221 testCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 6222 } 6223 impl->voidMethodTestCallbackInterfaceArg(testCallbackInterfaceArg.release()); 6224 } 6225 6226 static void voidMethodTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6227 { 6228 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6229 TestObjectV8Internal::voidMethodTestCallbackInterfaceArgMethod(info); 6230 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6231 } 6232 6233 static void voidMethodOptionalTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6234 { 6235 TestObject* impl = V8TestObject::toNative(info.Holder()); 6236 OwnPtr<TestCallbackInterface> optionalTestCallbackInterfaceArg; 6237 { 6238 if (info.Length() > 0 && !isUndefinedOrNull(info[0])) { 6239 if (!info[0]->IsFunction()) { 6240 throwTypeError(ExceptionMessages::failedToExecute("voidMethodOptionalTestCallbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); 6241 return; 6242 } 6243 optionalTestCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 6244 } 6245 } 6246 impl->voidMethodOptionalTestCallbackInterfaceArg(optionalTestCallbackInterfaceArg.release()); 6247 } 6248 6249 static void voidMethodOptionalTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6250 { 6251 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6252 TestObjectV8Internal::voidMethodOptionalTestCallbackInterfaceArgMethod(info); 6253 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6254 } 6255 6256 static void voidMethodTestCallbackInterfaceOrNullArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6257 { 6258 if (UNLIKELY(info.Length() < 1)) { 6259 throwMinimumArityTypeErrorForMethod("voidMethodTestCallbackInterfaceOrNullArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6260 return; 6261 } 6262 TestObject* impl = V8TestObject::toNative(info.Holder()); 6263 OwnPtr<TestCallbackInterface> testCallbackInterfaceArg; 6264 { 6265 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { 6266 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestCallbackInterfaceOrNullArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); 6267 return; 6268 } 6269 testCallbackInterfaceArg = info[0]->IsNull() ? nullptr : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 6270 } 6271 impl->voidMethodTestCallbackInterfaceOrNullArg(testCallbackInterfaceArg.release()); 6272 } 6273 6274 static void voidMethodTestCallbackInterfaceOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6275 { 6276 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6277 TestObjectV8Internal::voidMethodTestCallbackInterfaceOrNullArgMethod(info); 6278 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6279 } 6280 6281 static void testEnumMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6282 { 6283 TestObject* impl = V8TestObject::toNative(info.Holder()); 6284 v8SetReturnValueString(info, impl->testEnumMethod(), info.GetIsolate()); 6285 } 6286 6287 static void testEnumMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6288 { 6289 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6290 TestObjectV8Internal::testEnumMethodMethod(info); 6291 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6292 } 6293 6294 static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6295 { 6296 if (UNLIKELY(info.Length() < 1)) { 6297 throwMinimumArityTypeErrorForMethod("voidMethodTestEnumArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6298 return; 6299 } 6300 TestObject* impl = V8TestObject::toNative(info.Holder()); 6301 V8StringResource<> testEnumTypeArg; 6302 { 6303 v8::TryCatch block; 6304 V8RethrowTryCatchScope rethrow(block); 6305 TOSTRING_VOID_INTERNAL(testEnumTypeArg, info[0]); 6306 String string = testEnumTypeArg; 6307 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { 6308 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestEnumArg", "TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.GetIsolate()); 6309 return; 6310 } 6311 } 6312 impl->voidMethodTestEnumArg(testEnumTypeArg); 6313 } 6314 6315 static void voidMethodTestEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6316 { 6317 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6318 TestObjectV8Internal::voidMethodTestEnumArgMethod(info); 6319 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6320 } 6321 6322 static void dictionaryMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6323 { 6324 TestObject* impl = V8TestObject::toNative(info.Holder()); 6325 v8SetReturnValue(info, impl->dictionaryMethod()); 6326 } 6327 6328 static void dictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6329 { 6330 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6331 TestObjectV8Internal::dictionaryMethodMethod(info); 6332 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6333 } 6334 6335 static void nodeFilterMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6336 { 6337 TestObject* impl = V8TestObject::toNative(info.Holder()); 6338 v8SetReturnValue(info, impl->nodeFilterMethod()); 6339 } 6340 6341 static void nodeFilterMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6342 { 6343 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6344 TestObjectV8Internal::nodeFilterMethodMethod(info); 6345 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6346 } 6347 6348 static void promiseMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6349 { 6350 TestObject* impl = V8TestObject::toNative(info.Holder()); 6351 v8SetReturnValue(info, impl->promiseMethod().v8Value()); 6352 } 6353 6354 static void promiseMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6355 { 6356 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6357 TestObjectV8Internal::promiseMethodMethod(info); 6358 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6359 } 6360 6361 static void serializedScriptValueMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6362 { 6363 TestObject* impl = V8TestObject::toNative(info.Holder()); 6364 v8SetReturnValue(info, impl->serializedScriptValueMethod() ? impl->serializedScriptValueMethod()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()))); 6365 } 6366 6367 static void serializedScriptValueMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6368 { 6369 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6370 TestObjectV8Internal::serializedScriptValueMethodMethod(info); 6371 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6372 } 6373 6374 static void xPathNSResolverMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6375 { 6376 TestObject* impl = V8TestObject::toNative(info.Holder()); 6377 v8SetReturnValue(info, impl->xPathNSResolverMethod()); 6378 } 6379 6380 static void xPathNSResolverMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6381 { 6382 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6383 TestObjectV8Internal::xPathNSResolverMethodMethod(info); 6384 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6385 } 6386 6387 static void voidMethodDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6388 { 6389 if (UNLIKELY(info.Length() < 1)) { 6390 throwMinimumArityTypeErrorForMethod("voidMethodDictionaryArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6391 return; 6392 } 6393 TestObject* impl = V8TestObject::toNative(info.Holder()); 6394 Dictionary dictionaryArg; 6395 { 6396 v8::TryCatch block; 6397 V8RethrowTryCatchScope rethrow(block); 6398 TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[0], info.GetIsolate())); 6399 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { 6400 throwTypeError(ExceptionMessages::failedToExecute("voidMethodDictionaryArg", "TestObject", "parameter 1 ('dictionaryArg') is not an object."), info.GetIsolate()); 6401 return; 6402 } 6403 } 6404 impl->voidMethodDictionaryArg(dictionaryArg); 6405 } 6406 6407 static void voidMethodDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6408 { 6409 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6410 TestObjectV8Internal::voidMethodDictionaryArgMethod(info); 6411 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6412 } 6413 6414 static void voidMethodEventListenerArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6415 { 6416 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodEventListenerArg", "TestObject", info.Holder(), info.GetIsolate()); 6417 if (UNLIKELY(info.Length() < 1)) { 6418 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 6419 return; 6420 } 6421 TestObject* impl = V8TestObject::toNative(info.Holder()); 6422 RefPtr<EventListener> eventListenerArg; 6423 { 6424 eventListenerArg = V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), info[1], false, ListenerFindOrCreate); 6425 } 6426 impl->voidMethodEventListenerArg(eventListenerArg); 6427 if (listener && !impl->toNode()) 6428 removeHiddenValueFromArray(info.Holder(), info[1], V8TestObject::eventListenerCacheIndex, info.GetIsolate()); 6429 } 6430 6431 static void voidMethodEventListenerArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6432 { 6433 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6434 TestObjectV8Internal::voidMethodEventListenerArgMethod(info); 6435 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6436 } 6437 6438 static void voidMethodNodeFilterArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6439 { 6440 if (UNLIKELY(info.Length() < 1)) { 6441 throwMinimumArityTypeErrorForMethod("voidMethodNodeFilterArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6442 return; 6443 } 6444 TestObject* impl = V8TestObject::toNative(info.Holder()); 6445 RefPtrWillBeRawPtr<NodeFilter> nodeFilterArg; 6446 { 6447 v8::TryCatch block; 6448 V8RethrowTryCatchScope rethrow(block); 6449 TONATIVE_VOID_INTERNAL(nodeFilterArg, toNodeFilter(info[0], info.Holder(), ScriptState::current(info.GetIsolate()))); 6450 } 6451 impl->voidMethodNodeFilterArg(nodeFilterArg.release()); 6452 } 6453 6454 static void voidMethodNodeFilterArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6455 { 6456 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6457 TestObjectV8Internal::voidMethodNodeFilterArgMethod(info); 6458 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6459 } 6460 6461 static void voidMethodPromiseArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6462 { 6463 if (UNLIKELY(info.Length() < 1)) { 6464 throwMinimumArityTypeErrorForMethod("voidMethodPromiseArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6465 return; 6466 } 6467 TestObject* impl = V8TestObject::toNative(info.Holder()); 6468 ScriptPromise promiseArg; 6469 { 6470 v8::TryCatch block; 6471 V8RethrowTryCatchScope rethrow(block); 6472 TONATIVE_VOID_INTERNAL(promiseArg, ScriptPromise::cast(ScriptState::current(info.GetIsolate()), info[0])); 6473 if (!promiseArg.isUndefinedOrNull() && !promiseArg.isObject()) { 6474 throwTypeError(ExceptionMessages::failedToExecute("voidMethodPromiseArg", "TestObject", "parameter 1 ('promiseArg') is not an object."), info.GetIsolate()); 6475 return; 6476 } 6477 } 6478 impl->voidMethodPromiseArg(promiseArg); 6479 } 6480 6481 static void voidMethodPromiseArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6482 { 6483 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6484 TestObjectV8Internal::voidMethodPromiseArgMethod(info); 6485 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6486 } 6487 6488 static void voidMethodSerializedScriptValueArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6489 { 6490 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSerializedScriptValueArg", "TestObject", info.Holder(), info.GetIsolate()); 6491 if (UNLIKELY(info.Length() < 1)) { 6492 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 6493 return; 6494 } 6495 TestObject* impl = V8TestObject::toNative(info.Holder()); 6496 RefPtr<SerializedScriptValue> serializedScriptValueArg; 6497 { 6498 serializedScriptValueArg = SerializedScriptValue::create(info[0], 0, 0, exceptionState, info.GetIsolate()); 6499 if (exceptionState.hadException()) { 6500 exceptionState.throwIfNeeded(); 6501 return; 6502 } 6503 } 6504 impl->voidMethodSerializedScriptValueArg(serializedScriptValueArg); 6505 } 6506 6507 static void voidMethodSerializedScriptValueArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6508 { 6509 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6510 TestObjectV8Internal::voidMethodSerializedScriptValueArgMethod(info); 6511 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6512 } 6513 6514 static void voidMethodXPathNSResolverArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6515 { 6516 if (UNLIKELY(info.Length() < 1)) { 6517 throwMinimumArityTypeErrorForMethod("voidMethodXPathNSResolverArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6518 return; 6519 } 6520 TestObject* impl = V8TestObject::toNative(info.Holder()); 6521 RefPtrWillBeRawPtr<XPathNSResolver> xPathNSResolverArg; 6522 { 6523 v8::TryCatch block; 6524 V8RethrowTryCatchScope rethrow(block); 6525 TONATIVE_VOID_INTERNAL(xPathNSResolverArg, toXPathNSResolver(info[0], info.GetIsolate())); 6526 } 6527 impl->voidMethodXPathNSResolverArg(xPathNSResolverArg.release()); 6528 } 6529 6530 static void voidMethodXPathNSResolverArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6531 { 6532 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6533 TestObjectV8Internal::voidMethodXPathNSResolverArgMethod(info); 6534 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6535 } 6536 6537 static void voidMethodDictionarySequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6538 { 6539 if (UNLIKELY(info.Length() < 1)) { 6540 throwMinimumArityTypeErrorForMethod("voidMethodDictionarySequenceArg", "TestObject", 1, info.Length(), info.GetIsolate()); 6541 return; 6542 } 6543 TestObject* impl = V8TestObject::toNative(info.Holder()); 6544 Vector<Dictionary> dictionarySequenceArg; 6545 { 6546 v8::TryCatch block; 6547 V8RethrowTryCatchScope rethrow(block); 6548 TONATIVE_VOID_INTERNAL(dictionarySequenceArg, toNativeArray<Dictionary>(info[0], 1, info.GetIsolate())); 6549 } 6550 impl->voidMethodDictionarySequenceArg(dictionarySequenceArg); 6551 } 6552 6553 static void voidMethodDictionarySequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6554 { 6555 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6556 TestObjectV8Internal::voidMethodDictionarySequenceArgMethod(info); 6557 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6558 } 6559 6560 static void voidMethodStringArgLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6561 { 6562 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodStringArgLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6563 if (UNLIKELY(info.Length() < 2)) { 6564 throwMinimumArityTypeError(exceptionState, 2, info.Length()); 6565 return; 6566 } 6567 TestObject* impl = V8TestObject::toNative(info.Holder()); 6568 V8StringResource<> stringArg; 6569 int longArg; 6570 { 6571 v8::TryCatch block; 6572 V8RethrowTryCatchScope rethrow(block); 6573 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 6574 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptionState), exceptionState); 6575 } 6576 impl->voidMethodStringArgLongArg(stringArg, longArg); 6577 } 6578 6579 static void voidMethodStringArgLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6580 { 6581 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6582 TestObjectV8Internal::voidMethodStringArgLongArgMethod(info); 6583 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6584 } 6585 6586 static void voidMethodOptionalStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6587 { 6588 TestObject* impl = V8TestObject::toNative(info.Holder()); 6589 V8StringResource<> optionalStringArg; 6590 { 6591 if (UNLIKELY(info.Length() <= 0)) { 6592 impl->voidMethodOptionalStringArg(); 6593 return; 6594 } 6595 TOSTRING_VOID_INTERNAL(optionalStringArg, info[0]); 6596 } 6597 impl->voidMethodOptionalStringArg(optionalStringArg); 6598 } 6599 6600 static void voidMethodOptionalStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6601 { 6602 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6603 TestObjectV8Internal::voidMethodOptionalStringArgMethod(info); 6604 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6605 } 6606 6607 static void voidMethodOptionalTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6608 { 6609 TestObject* impl = V8TestObject::toNative(info.Holder()); 6610 TestInterfaceEmpty* optionalTestInterfaceEmptyArg; 6611 { 6612 v8::TryCatch block; 6613 V8RethrowTryCatchScope rethrow(block); 6614 if (UNLIKELY(info.Length() <= 0)) { 6615 impl->voidMethodOptionalTestInterfaceEmptyArg(); 6616 return; 6617 } 6618 TONATIVE_VOID_INTERNAL(optionalTestInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 6619 } 6620 impl->voidMethodOptionalTestInterfaceEmptyArg(optionalTestInterfaceEmptyArg); 6621 } 6622 6623 static void voidMethodOptionalTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6624 { 6625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6626 TestObjectV8Internal::voidMethodOptionalTestInterfaceEmptyArgMethod(info); 6627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6628 } 6629 6630 static void voidMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6631 { 6632 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6633 TestObject* impl = V8TestObject::toNative(info.Holder()); 6634 int optionalLongArg; 6635 { 6636 v8::TryCatch block; 6637 V8RethrowTryCatchScope rethrow(block); 6638 if (UNLIKELY(info.Length() <= 0)) { 6639 impl->voidMethodOptionalLongArg(); 6640 return; 6641 } 6642 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 6643 } 6644 impl->voidMethodOptionalLongArg(optionalLongArg); 6645 } 6646 6647 static void voidMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6648 { 6649 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6650 TestObjectV8Internal::voidMethodOptionalLongArgMethod(info); 6651 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6652 } 6653 6654 static void stringMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6655 { 6656 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6657 TestObject* impl = V8TestObject::toNative(info.Holder()); 6658 int optionalLongArg; 6659 { 6660 v8::TryCatch block; 6661 V8RethrowTryCatchScope rethrow(block); 6662 if (UNLIKELY(info.Length() <= 0)) { 6663 v8SetReturnValueString(info, impl->stringMethodOptionalLongArg(), info.GetIsolate()); 6664 return; 6665 } 6666 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 6667 } 6668 v8SetReturnValueString(info, impl->stringMethodOptionalLongArg(optionalLongArg), info.GetIsolate()); 6669 } 6670 6671 static void stringMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6672 { 6673 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6674 TestObjectV8Internal::stringMethodOptionalLongArgMethod(info); 6675 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6676 } 6677 6678 static void testInterfaceEmptyMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6679 { 6680 ExceptionState exceptionState(ExceptionState::ExecutionContext, "testInterfaceEmptyMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6681 TestObject* impl = V8TestObject::toNative(info.Holder()); 6682 int optionalLongArg; 6683 { 6684 v8::TryCatch block; 6685 V8RethrowTryCatchScope rethrow(block); 6686 if (UNLIKELY(info.Length() <= 0)) { 6687 v8SetReturnValue(info, impl->testInterfaceEmptyMethodOptionalLongArg()); 6688 return; 6689 } 6690 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 6691 } 6692 v8SetReturnValue(info, impl->testInterfaceEmptyMethodOptionalLongArg(optionalLongArg)); 6693 } 6694 6695 static void testInterfaceEmptyMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6696 { 6697 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6698 TestObjectV8Internal::testInterfaceEmptyMethodOptionalLongArgMethod(info); 6699 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6700 } 6701 6702 static void longMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6703 { 6704 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6705 TestObject* impl = V8TestObject::toNative(info.Holder()); 6706 int optionalLongArg; 6707 { 6708 v8::TryCatch block; 6709 V8RethrowTryCatchScope rethrow(block); 6710 if (UNLIKELY(info.Length() <= 0)) { 6711 v8SetReturnValueInt(info, impl->longMethodOptionalLongArg()); 6712 return; 6713 } 6714 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 6715 } 6716 v8SetReturnValueInt(info, impl->longMethodOptionalLongArg(optionalLongArg)); 6717 } 6718 6719 static void longMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6720 { 6721 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6722 TestObjectV8Internal::longMethodOptionalLongArgMethod(info); 6723 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6724 } 6725 6726 static void voidMethodLongArgOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6727 { 6728 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6729 if (UNLIKELY(info.Length() < 1)) { 6730 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 6731 return; 6732 } 6733 TestObject* impl = V8TestObject::toNative(info.Holder()); 6734 int longArg; 6735 int optionalLongArg; 6736 { 6737 v8::TryCatch block; 6738 V8RethrowTryCatchScope rethrow(block); 6739 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 6740 if (UNLIKELY(info.Length() <= 1)) { 6741 impl->voidMethodLongArgOptionalLongArg(longArg); 6742 return; 6743 } 6744 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[1], exceptionState), exceptionState); 6745 } 6746 impl->voidMethodLongArgOptionalLongArg(longArg, optionalLongArg); 6747 } 6748 6749 static void voidMethodLongArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6750 { 6751 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6752 TestObjectV8Internal::voidMethodLongArgOptionalLongArgMethod(info); 6753 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6754 } 6755 6756 static void voidMethodLongArgOptionalLongArgOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6757 { 6758 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalLongArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6759 if (UNLIKELY(info.Length() < 1)) { 6760 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 6761 return; 6762 } 6763 TestObject* impl = V8TestObject::toNative(info.Holder()); 6764 int longArg; 6765 int optionalLongArg1; 6766 int optionalLongArg2; 6767 { 6768 v8::TryCatch block; 6769 V8RethrowTryCatchScope rethrow(block); 6770 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 6771 if (UNLIKELY(info.Length() <= 1)) { 6772 impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg); 6773 return; 6774 } 6775 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg1, toInt32(info[1], exceptionState), exceptionState); 6776 if (UNLIKELY(info.Length() <= 2)) { 6777 impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg, optionalLongArg1); 6778 return; 6779 } 6780 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg2, toInt32(info[2], exceptionState), exceptionState); 6781 } 6782 impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg, optionalLongArg1, optionalLongArg2); 6783 } 6784 6785 static void voidMethodLongArgOptionalLongArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6786 { 6787 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6788 TestObjectV8Internal::voidMethodLongArgOptionalLongArgOptionalLongArgMethod(info); 6789 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6790 } 6791 6792 static void voidMethodLongArgOptionalTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6793 { 6794 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate()); 6795 if (UNLIKELY(info.Length() < 1)) { 6796 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 6797 return; 6798 } 6799 TestObject* impl = V8TestObject::toNative(info.Holder()); 6800 int longArg; 6801 TestInterfaceEmpty* optionalTestInterfaceEmpty; 6802 { 6803 v8::TryCatch block; 6804 V8RethrowTryCatchScope rethrow(block); 6805 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 6806 if (UNLIKELY(info.Length() <= 1)) { 6807 impl->voidMethodLongArgOptionalTestInterfaceEmptyArg(longArg); 6808 return; 6809 } 6810 TONATIVE_VOID_INTERNAL(optionalTestInterfaceEmpty, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[1])); 6811 } 6812 impl->voidMethodLongArgOptionalTestInterfaceEmptyArg(longArg, optionalTestInterfaceEmpty); 6813 } 6814 6815 static void voidMethodLongArgOptionalTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6816 { 6817 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6818 TestObjectV8Internal::voidMethodLongArgOptionalTestInterfaceEmptyArgMethod(info); 6819 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6820 } 6821 6822 static void voidMethodTestInterfaceEmptyArgOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6823 { 6824 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceEmptyArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6825 if (UNLIKELY(info.Length() < 1)) { 6826 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 6827 return; 6828 } 6829 TestObject* impl = V8TestObject::toNative(info.Holder()); 6830 TestInterfaceEmpty* optionalTestInterfaceEmpty; 6831 int longArg; 6832 { 6833 v8::TryCatch block; 6834 V8RethrowTryCatchScope rethrow(block); 6835 TONATIVE_VOID_INTERNAL(optionalTestInterfaceEmpty, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 6836 if (UNLIKELY(info.Length() <= 1)) { 6837 impl->voidMethodTestInterfaceEmptyArgOptionalLongArg(optionalTestInterfaceEmpty); 6838 return; 6839 } 6840 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptionState), exceptionState); 6841 } 6842 impl->voidMethodTestInterfaceEmptyArgOptionalLongArg(optionalTestInterfaceEmpty, longArg); 6843 } 6844 6845 static void voidMethodTestInterfaceEmptyArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6846 { 6847 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6848 TestObjectV8Internal::voidMethodTestInterfaceEmptyArgOptionalLongArgMethod(info); 6849 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6850 } 6851 6852 static void voidMethodOptionalDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6853 { 6854 TestObject* impl = V8TestObject::toNative(info.Holder()); 6855 Dictionary optionalDictionaryArg; 6856 { 6857 v8::TryCatch block; 6858 V8RethrowTryCatchScope rethrow(block); 6859 TONATIVE_VOID_INTERNAL(optionalDictionaryArg, Dictionary(info[0], info.GetIsolate())); 6860 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isObject()) { 6861 throwTypeError(ExceptionMessages::failedToExecute("voidMethodOptionalDictionaryArg", "TestObject", "parameter 1 ('optionalDictionaryArg') is not an object."), info.GetIsolate()); 6862 return; 6863 } 6864 } 6865 impl->voidMethodOptionalDictionaryArg(optionalDictionaryArg); 6866 } 6867 6868 static void voidMethodOptionalDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6869 { 6870 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6871 TestObjectV8Internal::voidMethodOptionalDictionaryArgMethod(info); 6872 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6873 } 6874 6875 static void voidMethodDefaultStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6876 { 6877 TestObject* impl = V8TestObject::toNative(info.Holder()); 6878 V8StringResource<> defaultStringArg; 6879 { 6880 TOSTRING_VOID_INTERNAL(defaultStringArg, info[0]); 6881 } 6882 impl->voidMethodDefaultStringArg(defaultStringArg); 6883 } 6884 6885 static void voidMethodDefaultStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6886 { 6887 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6888 TestObjectV8Internal::voidMethodDefaultStringArgMethod(info); 6889 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6890 } 6891 6892 static void voidMethodDefaultNullStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6893 { 6894 TestObject* impl = V8TestObject::toNative(info.Holder()); 6895 V8StringResource<> defaultStringArg; 6896 { 6897 TOSTRING_VOID_INTERNAL(defaultStringArg, argumentOrNull(info, 0)); 6898 } 6899 impl->voidMethodDefaultNullStringArg(defaultStringArg); 6900 } 6901 6902 static void voidMethodDefaultNullStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6903 { 6904 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6905 TestObjectV8Internal::voidMethodDefaultNullStringArgMethod(info); 6906 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6907 } 6908 6909 static void voidMethodDefaultLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6910 { 6911 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDefaultLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6912 TestObject* impl = V8TestObject::toNative(info.Holder()); 6913 int defaultLongArg; 6914 { 6915 v8::TryCatch block; 6916 V8RethrowTryCatchScope rethrow(block); 6917 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultLongArg, toInt32(info[0], exceptionState), exceptionState); 6918 } 6919 impl->voidMethodDefaultLongArg(defaultLongArg); 6920 } 6921 6922 static void voidMethodDefaultLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6923 { 6924 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6925 TestObjectV8Internal::voidMethodDefaultLongArgMethod(info); 6926 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6927 } 6928 6929 static void voidMethodDefaultDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6930 { 6931 TestObject* impl = V8TestObject::toNative(info.Holder()); 6932 double defaultDoubleArg; 6933 { 6934 v8::TryCatch block; 6935 V8RethrowTryCatchScope rethrow(block); 6936 TONATIVE_VOID_INTERNAL(defaultDoubleArg, static_cast<double>(info[0]->NumberValue())); 6937 } 6938 impl->voidMethodDefaultDoubleArg(defaultDoubleArg); 6939 } 6940 6941 static void voidMethodDefaultDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6942 { 6943 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6944 TestObjectV8Internal::voidMethodDefaultDoubleArgMethod(info); 6945 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6946 } 6947 6948 static void voidMethodDefaultTrueBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6949 { 6950 TestObject* impl = V8TestObject::toNative(info.Holder()); 6951 bool defaultBooleanArg; 6952 { 6953 v8::TryCatch block; 6954 V8RethrowTryCatchScope rethrow(block); 6955 TONATIVE_VOID_INTERNAL(defaultBooleanArg, info[0]->BooleanValue()); 6956 } 6957 impl->voidMethodDefaultTrueBooleanArg(defaultBooleanArg); 6958 } 6959 6960 static void voidMethodDefaultTrueBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6961 { 6962 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6963 TestObjectV8Internal::voidMethodDefaultTrueBooleanArgMethod(info); 6964 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6965 } 6966 6967 static void voidMethodDefaultFalseBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6968 { 6969 TestObject* impl = V8TestObject::toNative(info.Holder()); 6970 bool defaultBooleanArg; 6971 { 6972 v8::TryCatch block; 6973 V8RethrowTryCatchScope rethrow(block); 6974 TONATIVE_VOID_INTERNAL(defaultBooleanArg, info[0]->BooleanValue()); 6975 } 6976 impl->voidMethodDefaultFalseBooleanArg(defaultBooleanArg); 6977 } 6978 6979 static void voidMethodDefaultFalseBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6980 { 6981 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6982 TestObjectV8Internal::voidMethodDefaultFalseBooleanArgMethod(info); 6983 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6984 } 6985 6986 static void voidMethodDefaultNullableStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6987 { 6988 TestObject* impl = V8TestObject::toNative(info.Holder()); 6989 V8StringResource<> defaultStringArg; 6990 { 6991 TOSTRING_VOID_INTERNAL(defaultStringArg, info[0]); 6992 } 6993 impl->voidMethodDefaultNullableStringArg(defaultStringArg); 6994 } 6995 6996 static void voidMethodDefaultNullableStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6997 { 6998 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6999 TestObjectV8Internal::voidMethodDefaultNullableStringArgMethod(info); 7000 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7001 } 7002 7003 static void voidMethodDefaultNullableTestInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7004 { 7005 TestObject* impl = V8TestObject::toNative(info.Holder()); 7006 TestInterfaceImplementation* defaultTestInterfaceArg; 7007 { 7008 v8::TryCatch block; 7009 V8RethrowTryCatchScope rethrow(block); 7010 TONATIVE_VOID_INTERNAL(defaultTestInterfaceArg, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 7011 } 7012 impl->voidMethodDefaultNullableTestInterfaceArg(defaultTestInterfaceArg); 7013 } 7014 7015 static void voidMethodDefaultNullableTestInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7016 { 7017 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7018 TestObjectV8Internal::voidMethodDefaultNullableTestInterfaceArgMethod(info); 7019 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7020 } 7021 7022 static void voidMethodVariadicStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7023 { 7024 TestObject* impl = V8TestObject::toNative(info.Holder()); 7025 Vector<String> variadicStringArgs; 7026 { 7027 v8::TryCatch block; 7028 V8RethrowTryCatchScope rethrow(block); 7029 TONATIVE_VOID_INTERNAL(variadicStringArgs, toNativeArguments<String>(info, 0)); 7030 } 7031 impl->voidMethodVariadicStringArg(variadicStringArgs); 7032 } 7033 7034 static void voidMethodVariadicStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7035 { 7036 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7037 TestObjectV8Internal::voidMethodVariadicStringArgMethod(info); 7038 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7039 } 7040 7041 static void voidMethodStringArgVariadicStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7042 { 7043 if (UNLIKELY(info.Length() < 1)) { 7044 throwMinimumArityTypeErrorForMethod("voidMethodStringArgVariadicStringArg", "TestObject", 1, info.Length(), info.GetIsolate()); 7045 return; 7046 } 7047 TestObject* impl = V8TestObject::toNative(info.Holder()); 7048 V8StringResource<> stringArg; 7049 Vector<String> variadicStringArgs; 7050 { 7051 v8::TryCatch block; 7052 V8RethrowTryCatchScope rethrow(block); 7053 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7054 TONATIVE_VOID_INTERNAL(variadicStringArgs, toNativeArguments<String>(info, 1)); 7055 } 7056 impl->voidMethodStringArgVariadicStringArg(stringArg, variadicStringArgs); 7057 } 7058 7059 static void voidMethodStringArgVariadicStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7060 { 7061 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7062 TestObjectV8Internal::voidMethodStringArgVariadicStringArgMethod(info); 7063 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7064 } 7065 7066 static void voidMethodVariadicTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7067 { 7068 TestObject* impl = V8TestObject::toNative(info.Holder()); 7069 Vector<RefPtr<TestInterfaceEmpty> > variadicTestInterfaceEmptyArgs; 7070 { 7071 for (int i = 0; i < info.Length(); ++i) { 7072 if (!V8TestInterfaceEmpty::hasInstance(info[i], info.GetIsolate())) { 7073 throwTypeError(ExceptionMessages::failedToExecute("voidMethodVariadicTestInterfaceEmptyArg", "TestObject", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate()); 7074 return; 7075 } 7076 variadicTestInterfaceEmptyArgs.append(V8TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[i]))); 7077 } 7078 } 7079 impl->voidMethodVariadicTestInterfaceEmptyArg(variadicTestInterfaceEmptyArgs); 7080 } 7081 7082 static void voidMethodVariadicTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7083 { 7084 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7085 TestObjectV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethod(info); 7086 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7087 } 7088 7089 static void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7090 { 7091 if (UNLIKELY(info.Length() < 1)) { 7092 throwMinimumArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 7093 return; 7094 } 7095 TestObject* impl = V8TestObject::toNative(info.Holder()); 7096 TestInterfaceEmpty* testInterfaceEmptyArg; 7097 Vector<RefPtr<TestInterfaceEmpty> > variadicTestInterfaceEmptyArgs; 7098 { 7099 v8::TryCatch block; 7100 V8RethrowTryCatchScope rethrow(block); 7101 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 7102 for (int i = 1; i < info.Length(); ++i) { 7103 if (!V8TestInterfaceEmpty::hasInstance(info[i], info.GetIsolate())) { 7104 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg", "TestObject", "parameter 2 is not of type 'TestInterfaceEmpty'."), info.GetIsolate()); 7105 return; 7106 } 7107 variadicTestInterfaceEmptyArgs.append(V8TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[i]))); 7108 } 7109 } 7110 impl->voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg(testInterfaceEmptyArg, variadicTestInterfaceEmptyArgs); 7111 } 7112 7113 static void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7114 { 7115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7116 TestObjectV8Internal::voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethod(info); 7117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7118 } 7119 7120 static void voidMethodVariadicTestInterfaceGarbageCollectedArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7121 { 7122 TestObject* impl = V8TestObject::toNative(info.Holder()); 7123 HeapVector<Member<TestInterfaceGarbageCollected> > variadicTestInterfaceGarbageCollectedArg; 7124 { 7125 for (int i = 0; i < info.Length(); ++i) { 7126 if (!V8TestInterfaceGarbageCollected::hasInstance(info[i], info.GetIsolate())) { 7127 throwTypeError(ExceptionMessages::failedToExecute("voidMethodVariadicTestInterfaceGarbageCollectedArg", "TestObject", "parameter 1 is not of type 'TestInterfaceGarbageCollected'."), info.GetIsolate()); 7128 return; 7129 } 7130 variadicTestInterfaceGarbageCollectedArg.append(V8TestInterfaceGarbageCollected::toNative(v8::Handle<v8::Object>::Cast(info[i]))); 7131 } 7132 } 7133 impl->voidMethodVariadicTestInterfaceGarbageCollectedArg(variadicTestInterfaceGarbageCollectedArg); 7134 } 7135 7136 static void voidMethodVariadicTestInterfaceGarbageCollectedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7137 { 7138 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7139 TestObjectV8Internal::voidMethodVariadicTestInterfaceGarbageCollectedArgMethod(info); 7140 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7141 } 7142 7143 static void voidMethodVariadicTestInterfaceWillBeGarbageCollectedArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7144 { 7145 TestObject* impl = V8TestObject::toNative(info.Holder()); 7146 WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected> > variadicTestInterfaceWillBeGarbageCollectedArg; 7147 { 7148 for (int i = 0; i < info.Length(); ++i) { 7149 if (!V8TestInterfaceWillBeGarbageCollected::hasInstance(info[i], info.GetIsolate())) { 7150 throwTypeError(ExceptionMessages::failedToExecute("voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg", "TestObject", "parameter 1 is not of type 'TestInterfaceWillBeGarbageCollected'."), info.GetIsolate()); 7151 return; 7152 } 7153 variadicTestInterfaceWillBeGarbageCollectedArg.append(V8TestInterfaceWillBeGarbageCollected::toNative(v8::Handle<v8::Object>::Cast(info[i]))); 7154 } 7155 } 7156 impl->voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg(variadicTestInterfaceWillBeGarbageCollectedArg); 7157 } 7158 7159 static void voidMethodVariadicTestInterfaceWillBeGarbageCollectedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7160 { 7161 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7162 TestObjectV8Internal::voidMethodVariadicTestInterfaceWillBeGarbageCollectedArgMethod(info); 7163 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7164 } 7165 7166 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7167 { 7168 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate()); 7169 TestObject* impl = V8TestObject::toNative(info.Holder()); 7170 int longArg; 7171 { 7172 v8::TryCatch block; 7173 V8RethrowTryCatchScope rethrow(block); 7174 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7175 } 7176 impl->overloadedMethodA(longArg); 7177 } 7178 7179 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7180 { 7181 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate()); 7182 TestObject* impl = V8TestObject::toNative(info.Holder()); 7183 int longArg1; 7184 int longArg2; 7185 { 7186 v8::TryCatch block; 7187 V8RethrowTryCatchScope rethrow(block); 7188 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg1, toInt32(info[0], exceptionState), exceptionState); 7189 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg2, toInt32(info[1], exceptionState), exceptionState); 7190 } 7191 impl->overloadedMethodA(longArg1, longArg2); 7192 } 7193 7194 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7195 { 7196 v8::Isolate* isolate = info.GetIsolate(); 7197 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), isolate); 7198 switch (std::min(2, info.Length())) { 7199 case 1: 7200 if (true) { 7201 overloadedMethodA1Method(info); 7202 return; 7203 } 7204 break; 7205 case 2: 7206 if (true) { 7207 overloadedMethodA2Method(info); 7208 return; 7209 } 7210 break; 7211 default: 7212 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7213 exceptionState.throwIfNeeded(); 7214 return; 7215 } 7216 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7217 exceptionState.throwIfNeeded(); 7218 } 7219 7220 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7221 { 7222 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7223 TestObjectV8Internal::overloadedMethodAMethod(info); 7224 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7225 } 7226 7227 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7228 { 7229 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate()); 7230 TestObject* impl = V8TestObject::toNative(info.Holder()); 7231 int longArg; 7232 { 7233 v8::TryCatch block; 7234 V8RethrowTryCatchScope rethrow(block); 7235 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7236 } 7237 impl->overloadedMethodB(longArg); 7238 } 7239 7240 static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7241 { 7242 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate()); 7243 TestObject* impl = V8TestObject::toNative(info.Holder()); 7244 V8StringResource<> stringArg; 7245 int longArg; 7246 { 7247 v8::TryCatch block; 7248 V8RethrowTryCatchScope rethrow(block); 7249 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7250 if (UNLIKELY(info.Length() <= 1)) { 7251 impl->overloadedMethodB(stringArg); 7252 return; 7253 } 7254 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptionState), exceptionState); 7255 } 7256 impl->overloadedMethodB(stringArg, longArg); 7257 } 7258 7259 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7260 { 7261 v8::Isolate* isolate = info.GetIsolate(); 7262 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), isolate); 7263 switch (std::min(2, info.Length())) { 7264 case 1: 7265 if (info[0]->IsNumber()) { 7266 overloadedMethodB1Method(info); 7267 return; 7268 } 7269 if (true) { 7270 overloadedMethodB2Method(info); 7271 return; 7272 } 7273 if (true) { 7274 overloadedMethodB1Method(info); 7275 return; 7276 } 7277 break; 7278 case 2: 7279 if (true) { 7280 overloadedMethodB2Method(info); 7281 return; 7282 } 7283 break; 7284 default: 7285 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7286 exceptionState.throwIfNeeded(); 7287 return; 7288 } 7289 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7290 exceptionState.throwIfNeeded(); 7291 } 7292 7293 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7294 { 7295 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7296 TestObjectV8Internal::overloadedMethodBMethod(info); 7297 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7298 } 7299 7300 static void overloadedMethodC1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7301 { 7302 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObject", info.Holder(), info.GetIsolate()); 7303 TestObject* impl = V8TestObject::toNative(info.Holder()); 7304 int longArg; 7305 { 7306 v8::TryCatch block; 7307 V8RethrowTryCatchScope rethrow(block); 7308 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7309 } 7310 impl->overloadedMethodC(longArg); 7311 } 7312 7313 static void overloadedMethodC2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7314 { 7315 TestObject* impl = V8TestObject::toNative(info.Holder()); 7316 TestInterfaceEmpty* testInterfaceEmptyArg; 7317 { 7318 v8::TryCatch block; 7319 V8RethrowTryCatchScope rethrow(block); 7320 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 7321 } 7322 impl->overloadedMethodC(testInterfaceEmptyArg); 7323 } 7324 7325 static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7326 { 7327 v8::Isolate* isolate = info.GetIsolate(); 7328 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObject", info.Holder(), isolate); 7329 switch (std::min(1, info.Length())) { 7330 case 1: 7331 if (V8TestInterfaceEmpty::hasInstance(info[0], isolate)) { 7332 overloadedMethodC2Method(info); 7333 return; 7334 } 7335 if (true) { 7336 overloadedMethodC1Method(info); 7337 return; 7338 } 7339 break; 7340 default: 7341 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7342 exceptionState.throwIfNeeded(); 7343 return; 7344 } 7345 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7346 exceptionState.throwIfNeeded(); 7347 } 7348 7349 static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7350 { 7351 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7352 TestObjectV8Internal::overloadedMethodCMethod(info); 7353 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7354 } 7355 7356 static void overloadedMethodD1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7357 { 7358 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodD", "TestObject", info.Holder(), info.GetIsolate()); 7359 TestObject* impl = V8TestObject::toNative(info.Holder()); 7360 int longArg; 7361 { 7362 v8::TryCatch block; 7363 V8RethrowTryCatchScope rethrow(block); 7364 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7365 } 7366 impl->overloadedMethodD(longArg); 7367 } 7368 7369 static void overloadedMethodD2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7370 { 7371 TestObject* impl = V8TestObject::toNative(info.Holder()); 7372 Vector<int> longArrayArg; 7373 { 7374 v8::TryCatch block; 7375 V8RethrowTryCatchScope rethrow(block); 7376 TONATIVE_VOID_INTERNAL(longArrayArg, toNativeArray<int>(info[0], 1, info.GetIsolate())); 7377 } 7378 impl->overloadedMethodD(longArrayArg); 7379 } 7380 7381 static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7382 { 7383 v8::Isolate* isolate = info.GetIsolate(); 7384 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodD", "TestObject", info.Holder(), isolate); 7385 switch (std::min(1, info.Length())) { 7386 case 1: 7387 if (info[0]->IsArray()) { 7388 overloadedMethodD2Method(info); 7389 return; 7390 } 7391 if (true) { 7392 overloadedMethodD1Method(info); 7393 return; 7394 } 7395 break; 7396 default: 7397 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7398 exceptionState.throwIfNeeded(); 7399 return; 7400 } 7401 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7402 exceptionState.throwIfNeeded(); 7403 } 7404 7405 static void overloadedMethodDMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7406 { 7407 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7408 TestObjectV8Internal::overloadedMethodDMethod(info); 7409 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7410 } 7411 7412 static void overloadedMethodE1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7413 { 7414 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodE", "TestObject", info.Holder(), info.GetIsolate()); 7415 TestObject* impl = V8TestObject::toNative(info.Holder()); 7416 int longArg; 7417 { 7418 v8::TryCatch block; 7419 V8RethrowTryCatchScope rethrow(block); 7420 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7421 } 7422 impl->overloadedMethodE(longArg); 7423 } 7424 7425 static void overloadedMethodE2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7426 { 7427 TestObject* impl = V8TestObject::toNative(info.Holder()); 7428 TestInterfaceEmpty* testInterfaceEmptyOrNullArg; 7429 { 7430 v8::TryCatch block; 7431 V8RethrowTryCatchScope rethrow(block); 7432 TONATIVE_VOID_INTERNAL(testInterfaceEmptyOrNullArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 7433 } 7434 impl->overloadedMethodE(testInterfaceEmptyOrNullArg); 7435 } 7436 7437 static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7438 { 7439 v8::Isolate* isolate = info.GetIsolate(); 7440 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodE", "TestObject", info.Holder(), isolate); 7441 switch (std::min(1, info.Length())) { 7442 case 1: 7443 if (isUndefinedOrNull(info[0])) { 7444 overloadedMethodE2Method(info); 7445 return; 7446 } 7447 if (V8TestInterfaceEmpty::hasInstance(info[0], isolate)) { 7448 overloadedMethodE2Method(info); 7449 return; 7450 } 7451 if (true) { 7452 overloadedMethodE1Method(info); 7453 return; 7454 } 7455 break; 7456 default: 7457 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7458 exceptionState.throwIfNeeded(); 7459 return; 7460 } 7461 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7462 exceptionState.throwIfNeeded(); 7463 } 7464 7465 static void overloadedMethodEMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7466 { 7467 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7468 TestObjectV8Internal::overloadedMethodEMethod(info); 7469 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7470 } 7471 7472 static void overloadedMethodF1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7473 { 7474 TestObject* impl = V8TestObject::toNative(info.Holder()); 7475 V8StringResource<> stringArg; 7476 { 7477 if (UNLIKELY(info.Length() <= 0)) { 7478 impl->overloadedMethodF(); 7479 return; 7480 } 7481 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7482 } 7483 impl->overloadedMethodF(stringArg); 7484 } 7485 7486 static void overloadedMethodF2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7487 { 7488 TestObject* impl = V8TestObject::toNative(info.Holder()); 7489 double doubleArg; 7490 { 7491 v8::TryCatch block; 7492 V8RethrowTryCatchScope rethrow(block); 7493 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberValue())); 7494 } 7495 impl->overloadedMethodF(doubleArg); 7496 } 7497 7498 static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7499 { 7500 v8::Isolate* isolate = info.GetIsolate(); 7501 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodF", "TestObject", info.Holder(), isolate); 7502 switch (std::min(1, info.Length())) { 7503 case 0: 7504 if (true) { 7505 overloadedMethodF1Method(info); 7506 return; 7507 } 7508 break; 7509 case 1: 7510 if (info[0]->IsUndefined()) { 7511 overloadedMethodF1Method(info); 7512 return; 7513 } 7514 if (info[0]->IsNumber()) { 7515 overloadedMethodF2Method(info); 7516 return; 7517 } 7518 if (true) { 7519 overloadedMethodF1Method(info); 7520 return; 7521 } 7522 if (true) { 7523 overloadedMethodF2Method(info); 7524 return; 7525 } 7526 break; 7527 default: 7528 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 7529 exceptionState.throwIfNeeded(); 7530 return; 7531 } 7532 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7533 exceptionState.throwIfNeeded(); 7534 } 7535 7536 static void overloadedMethodFMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7537 { 7538 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7539 TestObjectV8Internal::overloadedMethodFMethod(info); 7540 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7541 } 7542 7543 static void overloadedMethodG1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7544 { 7545 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodG", "TestObject", info.Holder(), info.GetIsolate()); 7546 TestObject* impl = V8TestObject::toNative(info.Holder()); 7547 int longArg; 7548 { 7549 v8::TryCatch block; 7550 V8RethrowTryCatchScope rethrow(block); 7551 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7552 } 7553 impl->overloadedMethodG(longArg); 7554 } 7555 7556 static void overloadedMethodG2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7557 { 7558 TestObject* impl = V8TestObject::toNative(info.Holder()); 7559 TestInterfaceEmpty* testInterfaceEmptyOrNullArg; 7560 { 7561 v8::TryCatch block; 7562 V8RethrowTryCatchScope rethrow(block); 7563 TONATIVE_VOID_INTERNAL(testInterfaceEmptyOrNullArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 7564 } 7565 impl->overloadedMethodG(testInterfaceEmptyOrNullArg); 7566 } 7567 7568 static void overloadedMethodGMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7569 { 7570 v8::Isolate* isolate = info.GetIsolate(); 7571 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodG", "TestObject", info.Holder(), isolate); 7572 switch (std::min(1, info.Length())) { 7573 case 0: 7574 if (true) { 7575 overloadedMethodG2Method(info); 7576 return; 7577 } 7578 break; 7579 case 1: 7580 if (info[0]->IsUndefined()) { 7581 overloadedMethodG2Method(info); 7582 return; 7583 } 7584 if (isUndefinedOrNull(info[0])) { 7585 overloadedMethodG2Method(info); 7586 return; 7587 } 7588 if (V8TestInterfaceEmpty::hasInstance(info[0], isolate)) { 7589 overloadedMethodG2Method(info); 7590 return; 7591 } 7592 if (true) { 7593 overloadedMethodG1Method(info); 7594 return; 7595 } 7596 break; 7597 default: 7598 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 7599 exceptionState.throwIfNeeded(); 7600 return; 7601 } 7602 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7603 exceptionState.throwIfNeeded(); 7604 } 7605 7606 static void overloadedMethodGMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7607 { 7608 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7609 TestObjectV8Internal::overloadedMethodGMethod(info); 7610 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7611 } 7612 7613 static void overloadedMethodH1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7614 { 7615 TestObject* impl = V8TestObject::toNative(info.Holder()); 7616 TestInterfaceImplementation* testInterfaceArg; 7617 { 7618 v8::TryCatch block; 7619 V8RethrowTryCatchScope rethrow(block); 7620 TONATIVE_VOID_INTERNAL(testInterfaceArg, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 7621 } 7622 impl->overloadedMethodH(testInterfaceArg); 7623 } 7624 7625 static void overloadedMethodH2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7626 { 7627 TestObject* impl = V8TestObject::toNative(info.Holder()); 7628 TestInterfaceEmpty* testInterfaceEmptyArg; 7629 { 7630 v8::TryCatch block; 7631 V8RethrowTryCatchScope rethrow(block); 7632 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 7633 } 7634 impl->overloadedMethodH(testInterfaceEmptyArg); 7635 } 7636 7637 static void overloadedMethodHMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7638 { 7639 v8::Isolate* isolate = info.GetIsolate(); 7640 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodH", "TestObject", info.Holder(), isolate); 7641 switch (std::min(1, info.Length())) { 7642 case 1: 7643 if (V8TestInterface::hasInstance(info[0], isolate)) { 7644 overloadedMethodH1Method(info); 7645 return; 7646 } 7647 if (V8TestInterfaceEmpty::hasInstance(info[0], isolate)) { 7648 overloadedMethodH2Method(info); 7649 return; 7650 } 7651 break; 7652 default: 7653 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7654 exceptionState.throwIfNeeded(); 7655 return; 7656 } 7657 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7658 exceptionState.throwIfNeeded(); 7659 } 7660 7661 static void overloadedMethodHMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7662 { 7663 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7664 TestObjectV8Internal::overloadedMethodHMethod(info); 7665 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7666 } 7667 7668 static void overloadedMethodI1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7669 { 7670 TestObject* impl = V8TestObject::toNative(info.Holder()); 7671 V8StringResource<> stringArg; 7672 { 7673 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7674 } 7675 impl->overloadedMethodI(stringArg); 7676 } 7677 7678 static void overloadedMethodI2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7679 { 7680 TestObject* impl = V8TestObject::toNative(info.Holder()); 7681 double doubleArg; 7682 { 7683 v8::TryCatch block; 7684 V8RethrowTryCatchScope rethrow(block); 7685 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberValue())); 7686 } 7687 impl->overloadedMethodI(doubleArg); 7688 } 7689 7690 static void overloadedMethodIMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7691 { 7692 v8::Isolate* isolate = info.GetIsolate(); 7693 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodI", "TestObject", info.Holder(), isolate); 7694 switch (std::min(1, info.Length())) { 7695 case 1: 7696 if (info[0]->IsNumber()) { 7697 overloadedMethodI2Method(info); 7698 return; 7699 } 7700 if (true) { 7701 overloadedMethodI1Method(info); 7702 return; 7703 } 7704 if (true) { 7705 overloadedMethodI2Method(info); 7706 return; 7707 } 7708 break; 7709 default: 7710 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7711 exceptionState.throwIfNeeded(); 7712 return; 7713 } 7714 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7715 exceptionState.throwIfNeeded(); 7716 } 7717 7718 static void overloadedMethodIMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7719 { 7720 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7721 TestObjectV8Internal::overloadedMethodIMethod(info); 7722 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7723 } 7724 7725 static void overloadedPerWorldBindingsMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7726 { 7727 TestObject* impl = V8TestObject::toNative(info.Holder()); 7728 impl->overloadedPerWorldBindingsMethod(); 7729 } 7730 7731 static void overloadedPerWorldBindingsMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 7732 { 7733 TestObject* impl = V8TestObject::toNative(info.Holder()); 7734 impl->overloadedPerWorldBindingsMethod(); 7735 } 7736 7737 static void overloadedPerWorldBindingsMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7738 { 7739 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), info.GetIsolate()); 7740 TestObject* impl = V8TestObject::toNative(info.Holder()); 7741 int longArg; 7742 { 7743 v8::TryCatch block; 7744 V8RethrowTryCatchScope rethrow(block); 7745 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7746 } 7747 impl->overloadedPerWorldBindingsMethod(longArg); 7748 } 7749 7750 static void overloadedPerWorldBindingsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7751 { 7752 v8::Isolate* isolate = info.GetIsolate(); 7753 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), isolate); 7754 switch (std::min(1, info.Length())) { 7755 case 0: 7756 if (true) { 7757 overloadedPerWorldBindingsMethod1Method(info); 7758 return; 7759 } 7760 break; 7761 case 1: 7762 if (true) { 7763 overloadedPerWorldBindingsMethod2Method(info); 7764 return; 7765 } 7766 break; 7767 default: 7768 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 7769 exceptionState.throwIfNeeded(); 7770 return; 7771 } 7772 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7773 exceptionState.throwIfNeeded(); 7774 } 7775 7776 static void overloadedPerWorldBindingsMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7777 { 7778 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7779 TestObjectV8Internal::overloadedPerWorldBindingsMethodMethod(info); 7780 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7781 } 7782 7783 static void overloadedPerWorldBindingsMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 7784 { 7785 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), info.GetIsolate()); 7786 TestObject* impl = V8TestObject::toNative(info.Holder()); 7787 int longArg; 7788 { 7789 v8::TryCatch block; 7790 V8RethrowTryCatchScope rethrow(block); 7791 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7792 } 7793 impl->overloadedPerWorldBindingsMethod(longArg); 7794 } 7795 7796 static void overloadedPerWorldBindingsMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 7797 { 7798 v8::Isolate* isolate = info.GetIsolate(); 7799 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), isolate); 7800 switch (std::min(1, info.Length())) { 7801 case 0: 7802 if (true) { 7803 overloadedPerWorldBindingsMethod1MethodForMainWorld(info); 7804 return; 7805 } 7806 break; 7807 case 1: 7808 if (true) { 7809 overloadedPerWorldBindingsMethod2MethodForMainWorld(info); 7810 return; 7811 } 7812 break; 7813 default: 7814 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 7815 exceptionState.throwIfNeeded(); 7816 return; 7817 } 7818 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7819 exceptionState.throwIfNeeded(); 7820 } 7821 7822 static void overloadedPerWorldBindingsMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 7823 { 7824 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7825 TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodForMainWorld(info); 7826 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7827 } 7828 7829 static void overloadedStaticMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7830 { 7831 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObject", info.Holder(), info.GetIsolate()); 7832 int longArg; 7833 { 7834 v8::TryCatch block; 7835 V8RethrowTryCatchScope rethrow(block); 7836 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7837 } 7838 TestObject::overloadedStaticMethod(longArg); 7839 } 7840 7841 static void overloadedStaticMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7842 { 7843 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObject", info.Holder(), info.GetIsolate()); 7844 int longArg1; 7845 int longArg2; 7846 { 7847 v8::TryCatch block; 7848 V8RethrowTryCatchScope rethrow(block); 7849 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg1, toInt32(info[0], exceptionState), exceptionState); 7850 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg2, toInt32(info[1], exceptionState), exceptionState); 7851 } 7852 TestObject::overloadedStaticMethod(longArg1, longArg2); 7853 } 7854 7855 static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7856 { 7857 v8::Isolate* isolate = info.GetIsolate(); 7858 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObject", info.Holder(), isolate); 7859 switch (std::min(2, info.Length())) { 7860 case 1: 7861 if (true) { 7862 overloadedStaticMethod1Method(info); 7863 return; 7864 } 7865 break; 7866 case 2: 7867 if (true) { 7868 overloadedStaticMethod2Method(info); 7869 return; 7870 } 7871 break; 7872 default: 7873 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7874 exceptionState.throwIfNeeded(); 7875 return; 7876 } 7877 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7878 exceptionState.throwIfNeeded(); 7879 } 7880 7881 static void overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7882 { 7883 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7884 TestObjectV8Internal::overloadedStaticMethodMethod(info); 7885 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7886 } 7887 7888 static void voidMethodClampUnsignedShortArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7889 { 7890 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodClampUnsignedShortArg", "TestObject", info.Holder(), info.GetIsolate()); 7891 if (UNLIKELY(info.Length() < 1)) { 7892 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 7893 return; 7894 } 7895 TestObject* impl = V8TestObject::toNative(info.Holder()); 7896 unsigned clampUnsignedShortArg = 0; 7897 { 7898 v8::TryCatch block; 7899 V8RethrowTryCatchScope rethrow(block); 7900 double clampUnsignedShortArgNativeValue; 7901 TONATIVE_VOID_INTERNAL(clampUnsignedShortArgNativeValue, info[0]->NumberValue()); 7902 if (!std::isnan(clampUnsignedShortArgNativeValue)) 7903 clampUnsignedShortArg = clampTo<unsigned short>(clampUnsignedShortArgNativeValue); 7904 } 7905 impl->voidMethodClampUnsignedShortArg(clampUnsignedShortArg); 7906 } 7907 7908 static void voidMethodClampUnsignedShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7909 { 7910 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7911 TestObjectV8Internal::voidMethodClampUnsignedShortArgMethod(info); 7912 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7913 } 7914 7915 static void voidMethodClampUnsignedLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7916 { 7917 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodClampUnsignedLongArg", "TestObject", info.Holder(), info.GetIsolate()); 7918 if (UNLIKELY(info.Length() < 1)) { 7919 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 7920 return; 7921 } 7922 TestObject* impl = V8TestObject::toNative(info.Holder()); 7923 unsigned clampUnsignedLongArg = 0; 7924 { 7925 v8::TryCatch block; 7926 V8RethrowTryCatchScope rethrow(block); 7927 double clampUnsignedLongArgNativeValue; 7928 TONATIVE_VOID_INTERNAL(clampUnsignedLongArgNativeValue, info[0]->NumberValue()); 7929 if (!std::isnan(clampUnsignedLongArgNativeValue)) 7930 clampUnsignedLongArg = clampTo<unsigned long>(clampUnsignedLongArgNativeValue); 7931 } 7932 impl->voidMethodClampUnsignedLongArg(clampUnsignedLongArg); 7933 } 7934 7935 static void voidMethodClampUnsignedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7936 { 7937 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7938 TestObjectV8Internal::voidMethodClampUnsignedLongArgMethod(info); 7939 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7940 } 7941 7942 static void voidMethodDefaultUndefinedTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7943 { 7944 TestObject* impl = V8TestObject::toNative(info.Holder()); 7945 TestInterfaceEmpty* defaultUndefinedTestInterfaceEmptyArg; 7946 { 7947 v8::TryCatch block; 7948 V8RethrowTryCatchScope rethrow(block); 7949 TONATIVE_VOID_INTERNAL(defaultUndefinedTestInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 7950 } 7951 impl->voidMethodDefaultUndefinedTestInterfaceEmptyArg(defaultUndefinedTestInterfaceEmptyArg); 7952 } 7953 7954 static void voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7955 { 7956 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7957 TestObjectV8Internal::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethod(info); 7958 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7959 } 7960 7961 static void voidMethodDefaultUndefinedLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7962 { 7963 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDefaultUndefinedLongArg", "TestObject", info.Holder(), info.GetIsolate()); 7964 TestObject* impl = V8TestObject::toNative(info.Holder()); 7965 int defaultUndefinedLongArg; 7966 { 7967 v8::TryCatch block; 7968 V8RethrowTryCatchScope rethrow(block); 7969 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultUndefinedLongArg, toInt32(info[0], exceptionState), exceptionState); 7970 } 7971 impl->voidMethodDefaultUndefinedLongArg(defaultUndefinedLongArg); 7972 } 7973 7974 static void voidMethodDefaultUndefinedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7975 { 7976 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7977 TestObjectV8Internal::voidMethodDefaultUndefinedLongArgMethod(info); 7978 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7979 } 7980 7981 static void voidMethodDefaultUndefinedStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7982 { 7983 TestObject* impl = V8TestObject::toNative(info.Holder()); 7984 V8StringResource<> defaultUndefinedStringArg; 7985 { 7986 TOSTRING_VOID_INTERNAL(defaultUndefinedStringArg, info[0]); 7987 } 7988 impl->voidMethodDefaultUndefinedStringArg(defaultUndefinedStringArg); 7989 } 7990 7991 static void voidMethodDefaultUndefinedStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7992 { 7993 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 7994 TestObjectV8Internal::voidMethodDefaultUndefinedStringArgMethod(info); 7995 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 7996 } 7997 7998 static void voidMethodEnforceRangeLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7999 { 8000 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodEnforceRangeLongArg", "TestObject", info.Holder(), info.GetIsolate()); 8001 if (UNLIKELY(info.Length() < 1)) { 8002 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 8003 return; 8004 } 8005 TestObject* impl = V8TestObject::toNative(info.Holder()); 8006 int enforceRangeLongArg; 8007 { 8008 v8::TryCatch block; 8009 V8RethrowTryCatchScope rethrow(block); 8010 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(enforceRangeLongArg, toInt32(info[0], EnforceRange, exceptionState), exceptionState); 8011 } 8012 impl->voidMethodEnforceRangeLongArg(enforceRangeLongArg); 8013 } 8014 8015 static void voidMethodEnforceRangeLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8016 { 8017 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8018 TestObjectV8Internal::voidMethodEnforceRangeLongArgMethod(info); 8019 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8020 } 8021 8022 static void voidMethodTreatNullAsNullStringStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8023 { 8024 if (UNLIKELY(info.Length() < 1)) { 8025 throwMinimumArityTypeErrorForMethod("voidMethodTreatNullAsNullStringStringArg", "TestObject", 1, info.Length(), info.GetIsolate()); 8026 return; 8027 } 8028 TestObject* impl = V8TestObject::toNative(info.Holder()); 8029 V8StringResource<WithNullCheck> treatNullAsNullStringStringArg; 8030 { 8031 TOSTRING_VOID_INTERNAL(treatNullAsNullStringStringArg, info[0]); 8032 } 8033 impl->voidMethodTreatNullAsNullStringStringArg(treatNullAsNullStringStringArg); 8034 } 8035 8036 static void voidMethodTreatNullAsNullStringStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8037 { 8038 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8039 TestObjectV8Internal::voidMethodTreatNullAsNullStringStringArgMethod(info); 8040 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8041 } 8042 8043 static void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8044 { 8045 if (UNLIKELY(info.Length() < 1)) { 8046 throwMinimumArityTypeErrorForMethod("voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", "TestObject", 1, info.Length(), info.GetIsolate()); 8047 return; 8048 } 8049 TestObject* impl = V8TestObject::toNative(info.Holder()); 8050 V8StringResource<WithUndefinedOrNullCheck> treatNullAsNullStringStringArg; 8051 { 8052 TOSTRING_VOID_INTERNAL(treatNullAsNullStringStringArg, info[0]); 8053 } 8054 impl->voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg(treatNullAsNullStringStringArg); 8055 } 8056 8057 static void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8058 { 8059 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8060 TestObjectV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethod(info); 8061 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8062 } 8063 8064 static void activityLoggingAccessForAllWorldsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8065 { 8066 TestObject* impl = V8TestObject::toNative(info.Holder()); 8067 impl->activityLoggingAccessForAllWorldsMethod(); 8068 } 8069 8070 static void activityLoggingAccessForAllWorldsMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8071 { 8072 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8073 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 8074 V8PerContextData* contextData = scriptState->perContextData(); 8075 if (contextData && contextData->activityLogger()) { 8076 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); 8077 contextData->activityLogger()->logMethod("TestObject.activityLoggingAccessForAllWorldsMethod", info.Length(), loggerArgs.data()); 8078 } 8079 TestObjectV8Internal::activityLoggingAccessForAllWorldsMethodMethod(info); 8080 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8081 } 8082 8083 static void callWithExecutionContextVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8084 { 8085 TestObject* impl = V8TestObject::toNative(info.Holder()); 8086 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 8087 impl->callWithExecutionContextVoidMethod(executionContext); 8088 } 8089 8090 static void callWithExecutionContextVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8091 { 8092 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8093 TestObjectV8Internal::callWithExecutionContextVoidMethodMethod(info); 8094 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8095 } 8096 8097 static void callWithScriptStateVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8098 { 8099 TestObject* impl = V8TestObject::toNative(info.Holder()); 8100 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8101 impl->callWithScriptStateVoidMethod(scriptState); 8102 } 8103 8104 static void callWithScriptStateVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8105 { 8106 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8107 TestObjectV8Internal::callWithScriptStateVoidMethodMethod(info); 8108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8109 } 8110 8111 static void callWithScriptStateLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8112 { 8113 TestObject* impl = V8TestObject::toNative(info.Holder()); 8114 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8115 int result = impl->callWithScriptStateLongMethod(scriptState); 8116 v8SetReturnValueInt(info, result); 8117 } 8118 8119 static void callWithScriptStateLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8120 { 8121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8122 TestObjectV8Internal::callWithScriptStateLongMethodMethod(info); 8123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8124 } 8125 8126 static void callWithScriptStateExecutionContextVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8127 { 8128 TestObject* impl = V8TestObject::toNative(info.Holder()); 8129 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8130 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 8131 impl->callWithScriptStateExecutionContextVoidMethod(scriptState, executionContext); 8132 } 8133 8134 static void callWithScriptStateExecutionContextVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8135 { 8136 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8137 TestObjectV8Internal::callWithScriptStateExecutionContextVoidMethodMethod(info); 8138 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8139 } 8140 8141 static void callWithScriptStateScriptArgumentsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8142 { 8143 TestObject* impl = V8TestObject::toNative(info.Holder()); 8144 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8145 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArguments(scriptState, info, 0)); 8146 impl->callWithScriptStateScriptArgumentsVoidMethod(scriptState, scriptArguments.release()); 8147 } 8148 8149 static void callWithScriptStateScriptArgumentsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8150 { 8151 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8152 TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodMethod(info); 8153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8154 } 8155 8156 static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8157 { 8158 TestObject* impl = V8TestObject::toNative(info.Holder()); 8159 bool optionalBooleanArg; 8160 { 8161 v8::TryCatch block; 8162 V8RethrowTryCatchScope rethrow(block); 8163 if (UNLIKELY(info.Length() <= 0)) { 8164 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8165 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArguments(scriptState, info, 1)); 8166 impl->callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(scriptState, scriptArguments.release()); 8167 return; 8168 } 8169 TONATIVE_VOID_INTERNAL(optionalBooleanArg, info[0]->BooleanValue()); 8170 } 8171 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8172 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArguments(scriptState, info, 1)); 8173 impl->callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(scriptState, scriptArguments.release(), optionalBooleanArg); 8174 } 8175 8176 static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8177 { 8178 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8179 TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod(info); 8180 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8181 } 8182 8183 static void callWithActiveWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8184 { 8185 TestObject* impl = V8TestObject::toNative(info.Holder()); 8186 impl->callWithActiveWindow(callingDOMWindow(info.GetIsolate())); 8187 } 8188 8189 static void callWithActiveWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8190 { 8191 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8192 TestObjectV8Internal::callWithActiveWindowMethod(info); 8193 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8194 } 8195 8196 static void callWithActiveWindowScriptWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8197 { 8198 TestObject* impl = V8TestObject::toNative(info.Holder()); 8199 impl->callWithActiveWindowScriptWindow(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate())); 8200 } 8201 8202 static void callWithActiveWindowScriptWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8203 { 8204 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8205 TestObjectV8Internal::callWithActiveWindowScriptWindowMethod(info); 8206 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8207 } 8208 8209 static void checkSecurityForNodeVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8210 { 8211 TestObject* impl = V8TestObject::toNative(info.Holder()); 8212 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->checkSecurityForNodeVoidMethod(exceptionState), exceptionState)) { 8213 v8SetReturnValueNull(info); 8214 exceptionState.throwIfNeeded(); 8215 return; 8216 } 8217 impl->checkSecurityForNodeVoidMethod(); 8218 } 8219 8220 static void checkSecurityForNodeVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8221 { 8222 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8223 TestObjectV8Internal::checkSecurityForNodeVoidMethodMethod(info); 8224 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8225 } 8226 8227 #if ENABLE(CONDITION) 8228 static void conditionalConditionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8229 { 8230 TestObject* impl = V8TestObject::toNative(info.Holder()); 8231 impl->conditionalConditionVoidMethod(); 8232 } 8233 #endif // ENABLE(CONDITION) 8234 8235 #if ENABLE(CONDITION) 8236 static void conditionalConditionVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8237 { 8238 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8239 TestObjectV8Internal::conditionalConditionVoidMethodMethod(info); 8240 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8241 } 8242 #endif // ENABLE(CONDITION) 8243 8244 #if ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 8245 static void conditionalCondition1AndCondition2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8246 { 8247 TestObject* impl = V8TestObject::toNative(info.Holder()); 8248 impl->conditionalCondition1AndCondition2VoidMethod(); 8249 } 8250 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 8251 8252 #if ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 8253 static void conditionalCondition1AndCondition2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8254 { 8255 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8256 TestObjectV8Internal::conditionalCondition1AndCondition2VoidMethodMethod(info); 8257 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8258 } 8259 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 8260 8261 #if ENABLE(CONDITION) 8262 static void conditionalConditionStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8263 { 8264 TestObject::conditionalConditionStaticVoidMethod(); 8265 } 8266 #endif // ENABLE(CONDITION) 8267 8268 #if ENABLE(CONDITION) 8269 static void conditionalConditionStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8270 { 8271 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8272 TestObjectV8Internal::conditionalConditionStaticVoidMethodMethod(info); 8273 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8274 } 8275 #endif // ENABLE(CONDITION) 8276 8277 static void customVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8278 { 8279 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8280 V8TestObject::customVoidMethodMethodCustom(info); 8281 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8282 } 8283 8284 #if ENABLE(CONDITION) 8285 static void conditionalConditionCustomVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8286 { 8287 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8288 V8TestObject::conditionalConditionCustomVoidMethodMethodCustom(info); 8289 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8290 } 8291 #endif // ENABLE(CONDITION) 8292 8293 static void customElementCallbacksVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8294 { 8295 TestObject* impl = V8TestObject::toNative(info.Holder()); 8296 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 8297 impl->customElementCallbacksVoidMethod(); 8298 } 8299 8300 static void customElementCallbacksVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8301 { 8302 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8303 TestObjectV8Internal::customElementCallbacksVoidMethodMethod(info); 8304 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8305 } 8306 8307 static void deprecatedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8308 { 8309 TestObject* impl = V8TestObject::toNative(info.Holder()); 8310 impl->deprecatedVoidMethod(); 8311 } 8312 8313 static void deprecatedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8314 { 8315 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8316 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::voidMethod); 8317 TestObjectV8Internal::deprecatedVoidMethodMethod(info); 8318 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8319 } 8320 8321 static void doNotCheckSignatureVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8322 { 8323 TestObject* impl = V8TestObject::toNative(info.Holder()); 8324 impl->doNotCheckSignatureVoidMethod(); 8325 } 8326 8327 static void doNotCheckSignatureVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8328 { 8329 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8330 TestObjectV8Internal::doNotCheckSignatureVoidMethodMethod(info); 8331 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8332 } 8333 8334 static void implementedAsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8335 { 8336 TestObject* impl = V8TestObject::toNative(info.Holder()); 8337 impl->implementedAsMethodName(); 8338 } 8339 8340 static void implementedAsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8341 { 8342 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8343 TestObjectV8Internal::implementedAsVoidMethodMethod(info); 8344 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8345 } 8346 8347 static void measureAsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8348 { 8349 TestObject* impl = V8TestObject::toNative(info.Holder()); 8350 impl->measureAsVoidMethod(); 8351 } 8352 8353 static void measureAsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8354 { 8355 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8356 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 8357 TestObjectV8Internal::measureAsVoidMethodMethod(info); 8358 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8359 } 8360 8361 static void DeprecateAsOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8362 { 8363 TestObject* impl = V8TestObject::toNative(info.Holder()); 8364 impl->DeprecateAsOverloadedMethod(); 8365 } 8366 8367 static void DeprecateAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8368 { 8369 ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8370 TestObject* impl = V8TestObject::toNative(info.Holder()); 8371 int arg; 8372 { 8373 v8::TryCatch block; 8374 V8RethrowTryCatchScope rethrow(block); 8375 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8376 } 8377 impl->DeprecateAsOverloadedMethod(arg); 8378 } 8379 8380 static void DeprecateAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8381 { 8382 v8::Isolate* isolate = info.GetIsolate(); 8383 ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsOverloadedMethod", "TestObject", info.Holder(), isolate); 8384 switch (std::min(1, info.Length())) { 8385 case 0: 8386 if (true) { 8387 UseCounter::countDeprecation(callingExecutionContext(isolate), UseCounter::TestFeatureA); 8388 DeprecateAsOverloadedMethod1Method(info); 8389 return; 8390 } 8391 break; 8392 case 1: 8393 if (true) { 8394 UseCounter::countDeprecation(callingExecutionContext(isolate), UseCounter::TestFeatureB); 8395 DeprecateAsOverloadedMethod2Method(info); 8396 return; 8397 } 8398 break; 8399 default: 8400 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8401 exceptionState.throwIfNeeded(); 8402 return; 8403 } 8404 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8405 exceptionState.throwIfNeeded(); 8406 } 8407 8408 static void DeprecateAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8409 { 8410 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8411 TestObjectV8Internal::DeprecateAsOverloadedMethodMethod(info); 8412 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8413 } 8414 8415 static void DeprecateAsSameValueOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8416 { 8417 TestObject* impl = V8TestObject::toNative(info.Holder()); 8418 impl->DeprecateAsSameValueOverloadedMethod(); 8419 } 8420 8421 static void DeprecateAsSameValueOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8422 { 8423 ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8424 TestObject* impl = V8TestObject::toNative(info.Holder()); 8425 int arg; 8426 { 8427 v8::TryCatch block; 8428 V8RethrowTryCatchScope rethrow(block); 8429 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8430 } 8431 impl->DeprecateAsSameValueOverloadedMethod(arg); 8432 } 8433 8434 static void DeprecateAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8435 { 8436 v8::Isolate* isolate = info.GetIsolate(); 8437 ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsSameValueOverloadedMethod", "TestObject", info.Holder(), isolate); 8438 UseCounter::countDeprecation(callingExecutionContext(isolate), UseCounter::TestFeature); 8439 switch (std::min(1, info.Length())) { 8440 case 0: 8441 if (true) { 8442 DeprecateAsSameValueOverloadedMethod1Method(info); 8443 return; 8444 } 8445 break; 8446 case 1: 8447 if (true) { 8448 DeprecateAsSameValueOverloadedMethod2Method(info); 8449 return; 8450 } 8451 break; 8452 default: 8453 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8454 exceptionState.throwIfNeeded(); 8455 return; 8456 } 8457 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8458 exceptionState.throwIfNeeded(); 8459 } 8460 8461 static void DeprecateAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8462 { 8463 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8464 TestObjectV8Internal::DeprecateAsSameValueOverloadedMethodMethod(info); 8465 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8466 } 8467 8468 static void measureAsOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8469 { 8470 TestObject* impl = V8TestObject::toNative(info.Holder()); 8471 impl->measureAsOverloadedMethod(); 8472 } 8473 8474 static void measureAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8475 { 8476 ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8477 TestObject* impl = V8TestObject::toNative(info.Holder()); 8478 int arg; 8479 { 8480 v8::TryCatch block; 8481 V8RethrowTryCatchScope rethrow(block); 8482 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8483 } 8484 impl->measureAsOverloadedMethod(arg); 8485 } 8486 8487 static void measureAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8488 { 8489 v8::Isolate* isolate = info.GetIsolate(); 8490 ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsOverloadedMethod", "TestObject", info.Holder(), isolate); 8491 switch (std::min(1, info.Length())) { 8492 case 0: 8493 if (true) { 8494 UseCounter::count(callingExecutionContext(isolate), UseCounter::TestFeatureA); 8495 measureAsOverloadedMethod1Method(info); 8496 return; 8497 } 8498 break; 8499 case 1: 8500 if (true) { 8501 UseCounter::count(callingExecutionContext(isolate), UseCounter::TestFeatureB); 8502 measureAsOverloadedMethod2Method(info); 8503 return; 8504 } 8505 break; 8506 default: 8507 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8508 exceptionState.throwIfNeeded(); 8509 return; 8510 } 8511 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8512 exceptionState.throwIfNeeded(); 8513 } 8514 8515 static void measureAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8516 { 8517 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8518 TestObjectV8Internal::measureAsOverloadedMethodMethod(info); 8519 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8520 } 8521 8522 static void measureAsSameValueOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8523 { 8524 TestObject* impl = V8TestObject::toNative(info.Holder()); 8525 impl->measureAsSameValueOverloadedMethod(); 8526 } 8527 8528 static void measureAsSameValueOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8529 { 8530 ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8531 TestObject* impl = V8TestObject::toNative(info.Holder()); 8532 int arg; 8533 { 8534 v8::TryCatch block; 8535 V8RethrowTryCatchScope rethrow(block); 8536 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8537 } 8538 impl->measureAsSameValueOverloadedMethod(arg); 8539 } 8540 8541 static void measureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8542 { 8543 v8::Isolate* isolate = info.GetIsolate(); 8544 ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsSameValueOverloadedMethod", "TestObject", info.Holder(), isolate); 8545 UseCounter::count(callingExecutionContext(isolate), UseCounter::TestFeature); 8546 switch (std::min(1, info.Length())) { 8547 case 0: 8548 if (true) { 8549 measureAsSameValueOverloadedMethod1Method(info); 8550 return; 8551 } 8552 break; 8553 case 1: 8554 if (true) { 8555 measureAsSameValueOverloadedMethod2Method(info); 8556 return; 8557 } 8558 break; 8559 default: 8560 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8561 exceptionState.throwIfNeeded(); 8562 return; 8563 } 8564 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8565 exceptionState.throwIfNeeded(); 8566 } 8567 8568 static void measureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8569 { 8570 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8571 TestObjectV8Internal::measureAsSameValueOverloadedMethodMethod(info); 8572 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8573 } 8574 8575 static void deprecateAsMeasureAsSameValueOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8576 { 8577 TestObject* impl = V8TestObject::toNative(info.Holder()); 8578 impl->deprecateAsMeasureAsSameValueOverloadedMethod(); 8579 } 8580 8581 static void deprecateAsMeasureAsSameValueOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8582 { 8583 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8584 TestObject* impl = V8TestObject::toNative(info.Holder()); 8585 int arg; 8586 { 8587 v8::TryCatch block; 8588 V8RethrowTryCatchScope rethrow(block); 8589 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8590 } 8591 impl->deprecateAsMeasureAsSameValueOverloadedMethod(arg); 8592 } 8593 8594 static void deprecateAsMeasureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8595 { 8596 v8::Isolate* isolate = info.GetIsolate(); 8597 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), isolate); 8598 UseCounter::count(callingExecutionContext(isolate), UseCounter::TestFeature); 8599 switch (std::min(1, info.Length())) { 8600 case 0: 8601 if (true) { 8602 UseCounter::countDeprecation(callingExecutionContext(isolate), UseCounter::TestFeatureA); 8603 deprecateAsMeasureAsSameValueOverloadedMethod1Method(info); 8604 return; 8605 } 8606 break; 8607 case 1: 8608 if (true) { 8609 UseCounter::countDeprecation(callingExecutionContext(isolate), UseCounter::TestFeatureB); 8610 deprecateAsMeasureAsSameValueOverloadedMethod2Method(info); 8611 return; 8612 } 8613 break; 8614 default: 8615 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8616 exceptionState.throwIfNeeded(); 8617 return; 8618 } 8619 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8620 exceptionState.throwIfNeeded(); 8621 } 8622 8623 static void deprecateAsMeasureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8624 { 8625 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8626 TestObjectV8Internal::deprecateAsMeasureAsSameValueOverloadedMethodMethod(info); 8627 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8628 } 8629 8630 static void deprecateAsSameValueMeasureAsOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8631 { 8632 TestObject* impl = V8TestObject::toNative(info.Holder()); 8633 impl->deprecateAsSameValueMeasureAsOverloadedMethod(); 8634 } 8635 8636 static void deprecateAsSameValueMeasureAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8637 { 8638 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8639 TestObject* impl = V8TestObject::toNative(info.Holder()); 8640 int arg; 8641 { 8642 v8::TryCatch block; 8643 V8RethrowTryCatchScope rethrow(block); 8644 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8645 } 8646 impl->deprecateAsSameValueMeasureAsOverloadedMethod(arg); 8647 } 8648 8649 static void deprecateAsSameValueMeasureAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8650 { 8651 v8::Isolate* isolate = info.GetIsolate(); 8652 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsOverloadedMethod", "TestObject", info.Holder(), isolate); 8653 UseCounter::countDeprecation(callingExecutionContext(isolate), UseCounter::TestFeature); 8654 switch (std::min(1, info.Length())) { 8655 case 0: 8656 if (true) { 8657 UseCounter::count(callingExecutionContext(isolate), UseCounter::TestFeatureA); 8658 deprecateAsSameValueMeasureAsOverloadedMethod1Method(info); 8659 return; 8660 } 8661 break; 8662 case 1: 8663 if (true) { 8664 UseCounter::count(callingExecutionContext(isolate), UseCounter::TestFeatureB); 8665 deprecateAsSameValueMeasureAsOverloadedMethod2Method(info); 8666 return; 8667 } 8668 break; 8669 default: 8670 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8671 exceptionState.throwIfNeeded(); 8672 return; 8673 } 8674 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8675 exceptionState.throwIfNeeded(); 8676 } 8677 8678 static void deprecateAsSameValueMeasureAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8679 { 8680 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8681 TestObjectV8Internal::deprecateAsSameValueMeasureAsOverloadedMethodMethod(info); 8682 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8683 } 8684 8685 static void deprecateAsSameValueMeasureAsSameValueOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8686 { 8687 TestObject* impl = V8TestObject::toNative(info.Holder()); 8688 impl->deprecateAsSameValueMeasureAsSameValueOverloadedMethod(); 8689 } 8690 8691 static void deprecateAsSameValueMeasureAsSameValueOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8692 { 8693 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8694 TestObject* impl = V8TestObject::toNative(info.Holder()); 8695 int arg; 8696 { 8697 v8::TryCatch block; 8698 V8RethrowTryCatchScope rethrow(block); 8699 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8700 } 8701 impl->deprecateAsSameValueMeasureAsSameValueOverloadedMethod(arg); 8702 } 8703 8704 static void deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8705 { 8706 v8::Isolate* isolate = info.GetIsolate(); 8707 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), isolate); 8708 UseCounter::count(callingExecutionContext(isolate), UseCounter::TestFeatureB); 8709 UseCounter::countDeprecation(callingExecutionContext(isolate), UseCounter::TestFeatureA); 8710 switch (std::min(1, info.Length())) { 8711 case 0: 8712 if (true) { 8713 deprecateAsSameValueMeasureAsSameValueOverloadedMethod1Method(info); 8714 return; 8715 } 8716 break; 8717 case 1: 8718 if (true) { 8719 deprecateAsSameValueMeasureAsSameValueOverloadedMethod2Method(info); 8720 return; 8721 } 8722 break; 8723 default: 8724 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8725 exceptionState.throwIfNeeded(); 8726 return; 8727 } 8728 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8729 exceptionState.throwIfNeeded(); 8730 } 8731 8732 static void deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8733 { 8734 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8735 TestObjectV8Internal::deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethod(info); 8736 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8737 } 8738 8739 static void notEnumerableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8740 { 8741 TestObject* impl = V8TestObject::toNative(info.Holder()); 8742 impl->notEnumerableVoidMethod(); 8743 } 8744 8745 static void notEnumerableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8746 { 8747 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8748 TestObjectV8Internal::notEnumerableVoidMethodMethod(info); 8749 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8750 } 8751 8752 static void perContextEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8753 { 8754 TestObject* impl = V8TestObject::toNative(info.Holder()); 8755 impl->perContextEnabledVoidMethod(); 8756 } 8757 8758 static void perContextEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8759 { 8760 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8761 TestObjectV8Internal::perContextEnabledVoidMethodMethod(info); 8762 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8763 } 8764 8765 static void perWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8766 { 8767 TestObject* impl = V8TestObject::toNative(info.Holder()); 8768 impl->perWorldBindingsVoidMethod(); 8769 } 8770 8771 static void perWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8772 { 8773 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8774 TestObjectV8Internal::perWorldBindingsVoidMethodMethod(info); 8775 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8776 } 8777 8778 static void perWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8779 { 8780 TestObject* impl = V8TestObject::toNative(info.Holder()); 8781 impl->perWorldBindingsVoidMethod(); 8782 } 8783 8784 static void perWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8785 { 8786 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8787 TestObjectV8Internal::perWorldBindingsVoidMethodMethodForMainWorld(info); 8788 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8789 } 8790 8791 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8792 { 8793 if (UNLIKELY(info.Length() < 1)) { 8794 throwMinimumArityTypeErrorForMethod("perWorldBindingsVoidMethodTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 8795 return; 8796 } 8797 TestObject* impl = V8TestObject::toNative(info.Holder()); 8798 TestInterfaceEmpty* testInterfaceEmptyArg; 8799 { 8800 v8::TryCatch block; 8801 V8RethrowTryCatchScope rethrow(block); 8802 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 8803 } 8804 impl->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 8805 } 8806 8807 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8808 { 8809 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8810 TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethod(info); 8811 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8812 } 8813 8814 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8815 { 8816 if (UNLIKELY(info.Length() < 1)) { 8817 throwMinimumArityTypeErrorForMethod("perWorldBindingsVoidMethodTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 8818 return; 8819 } 8820 TestObject* impl = V8TestObject::toNative(info.Holder()); 8821 TestInterfaceEmpty* testInterfaceEmptyArg; 8822 { 8823 v8::TryCatch block; 8824 V8RethrowTryCatchScope rethrow(block); 8825 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 8826 } 8827 impl->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 8828 } 8829 8830 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8831 { 8832 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8833 TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodForMainWorld(info); 8834 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8835 } 8836 8837 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8838 { 8839 TestObject* impl = V8TestObject::toNative(info.Holder()); 8840 impl->activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); 8841 } 8842 8843 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8844 { 8845 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8846 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 8847 V8PerContextData* contextData = scriptState->perContextData(); 8848 if (contextData && contextData->activityLogger()) { 8849 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); 8850 contextData->activityLogger()->logMethod("TestObject.activityLoggingForAllWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); 8851 } 8852 TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(info); 8853 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8854 } 8855 8856 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8857 { 8858 TestObject* impl = V8TestObject::toNative(info.Holder()); 8859 impl->activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); 8860 } 8861 8862 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8863 { 8864 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8865 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 8866 V8PerContextData* contextData = scriptState->perContextData(); 8867 if (contextData && contextData->activityLogger()) { 8868 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); 8869 contextData->activityLogger()->logMethod("TestObject.activityLoggingForAllWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); 8870 } 8871 TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodForMainWorld(info); 8872 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8873 } 8874 8875 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8876 { 8877 TestObject* impl = V8TestObject::toNative(info.Holder()); 8878 impl->activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod(); 8879 } 8880 8881 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8882 { 8883 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8884 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 8885 V8PerContextData* contextData = scriptState->perContextData(); 8886 if (contextData && contextData->activityLogger()) { 8887 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0); 8888 contextData->activityLogger()->logMethod("TestObject.activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); 8889 } 8890 TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethod(info); 8891 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8892 } 8893 8894 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8895 { 8896 TestObject* impl = V8TestObject::toNative(info.Holder()); 8897 impl->activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod(); 8898 } 8899 8900 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8901 { 8902 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8903 TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodForMainWorld(info); 8904 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8905 } 8906 8907 static void raisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8908 { 8909 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 8910 TestObject* impl = V8TestObject::toNative(info.Holder()); 8911 impl->raisesExceptionVoidMethod(exceptionState); 8912 if (exceptionState.hadException()) { 8913 exceptionState.throwIfNeeded(); 8914 return; 8915 } 8916 } 8917 8918 static void raisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8919 { 8920 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8921 TestObjectV8Internal::raisesExceptionVoidMethodMethod(info); 8922 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8923 } 8924 8925 static void raisesExceptionStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8926 { 8927 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionStringMethod", "TestObject", info.Holder(), info.GetIsolate()); 8928 TestObject* impl = V8TestObject::toNative(info.Holder()); 8929 String result = impl->raisesExceptionStringMethod(exceptionState); 8930 if (exceptionState.hadException()) { 8931 exceptionState.throwIfNeeded(); 8932 return; 8933 } 8934 v8SetReturnValueString(info, result, info.GetIsolate()); 8935 } 8936 8937 static void raisesExceptionStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8938 { 8939 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8940 TestObjectV8Internal::raisesExceptionStringMethodMethod(info); 8941 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8942 } 8943 8944 static void raisesExceptionVoidMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8945 { 8946 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 8947 TestObject* impl = V8TestObject::toNative(info.Holder()); 8948 int optionalLongArg; 8949 { 8950 v8::TryCatch block; 8951 V8RethrowTryCatchScope rethrow(block); 8952 if (UNLIKELY(info.Length() <= 0)) { 8953 impl->raisesExceptionVoidMethodOptionalLongArg(exceptionState); 8954 if (exceptionState.hadException()) { 8955 exceptionState.throwIfNeeded(); 8956 return; 8957 } 8958 return; 8959 } 8960 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 8961 } 8962 impl->raisesExceptionVoidMethodOptionalLongArg(optionalLongArg, exceptionState); 8963 if (exceptionState.hadException()) { 8964 exceptionState.throwIfNeeded(); 8965 return; 8966 } 8967 } 8968 8969 static void raisesExceptionVoidMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8970 { 8971 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 8972 TestObjectV8Internal::raisesExceptionVoidMethodOptionalLongArgMethod(info); 8973 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 8974 } 8975 8976 static void raisesExceptionVoidMethodTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8977 { 8978 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethodTestCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsolate()); 8979 if (UNLIKELY(info.Length() < 1)) { 8980 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 8981 return; 8982 } 8983 TestObject* impl = V8TestObject::toNative(info.Holder()); 8984 OwnPtr<TestCallbackInterface> testCallbackInterfaceArg; 8985 { 8986 if (info.Length() <= 0 || !info[0]->IsFunction()) { 8987 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function."); 8988 exceptionState.throwIfNeeded(); 8989 return; 8990 } 8991 testCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 8992 } 8993 impl->raisesExceptionVoidMethodTestCallbackInterfaceArg(testCallbackInterfaceArg.release(), exceptionState); 8994 if (exceptionState.hadException()) { 8995 exceptionState.throwIfNeeded(); 8996 return; 8997 } 8998 } 8999 9000 static void raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9001 { 9002 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9003 TestObjectV8Internal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethod(info); 9004 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9005 } 9006 9007 static void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9008 { 9009 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsolate()); 9010 TestObject* impl = V8TestObject::toNative(info.Holder()); 9011 OwnPtr<TestCallbackInterface> optionalTestCallbackInterfaceArg; 9012 { 9013 if (info.Length() > 0 && !isUndefinedOrNull(info[0])) { 9014 if (!info[0]->IsFunction()) { 9015 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function."); 9016 exceptionState.throwIfNeeded(); 9017 return; 9018 } 9019 optionalTestCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 9020 } 9021 } 9022 impl->raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg(optionalTestCallbackInterfaceArg.release(), exceptionState); 9023 if (exceptionState.hadException()) { 9024 exceptionState.throwIfNeeded(); 9025 return; 9026 } 9027 } 9028 9029 static void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9030 { 9031 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9032 TestObjectV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(info); 9033 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9034 } 9035 9036 static void raisesExceptionTestInterfaceEmptyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9037 { 9038 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionTestInterfaceEmptyVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9039 TestObject* impl = V8TestObject::toNative(info.Holder()); 9040 RefPtr<TestInterfaceEmpty> result = impl->raisesExceptionTestInterfaceEmptyVoidMethod(exceptionState); 9041 if (exceptionState.hadException()) { 9042 exceptionState.throwIfNeeded(); 9043 return; 9044 } 9045 v8SetReturnValue(info, result.release()); 9046 } 9047 9048 static void raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9049 { 9050 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9051 TestObjectV8Internal::raisesExceptionTestInterfaceEmptyVoidMethodMethod(info); 9052 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9053 } 9054 9055 static void callWithExecutionContextRaisesExceptionVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9056 { 9057 ExceptionState exceptionState(ExceptionState::ExecutionContext, "callWithExecutionContextRaisesExceptionVoidMethodLongArg", "TestObject", info.Holder(), info.GetIsolate()); 9058 if (UNLIKELY(info.Length() < 1)) { 9059 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 9060 return; 9061 } 9062 TestObject* impl = V8TestObject::toNative(info.Holder()); 9063 int longArg; 9064 { 9065 v8::TryCatch block; 9066 V8RethrowTryCatchScope rethrow(block); 9067 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 9068 } 9069 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 9070 impl->callWithExecutionContextRaisesExceptionVoidMethodLongArg(executionContext, longArg, exceptionState); 9071 if (exceptionState.hadException()) { 9072 exceptionState.throwIfNeeded(); 9073 return; 9074 } 9075 } 9076 9077 static void callWithExecutionContextRaisesExceptionVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9078 { 9079 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9080 TestObjectV8Internal::callWithExecutionContextRaisesExceptionVoidMethodLongArgMethod(info); 9081 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9082 } 9083 9084 static void readOnlyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9085 { 9086 TestObject* impl = V8TestObject::toNative(info.Holder()); 9087 impl->readOnlyVoidMethod(); 9088 } 9089 9090 static void readOnlyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9091 { 9092 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9093 TestObjectV8Internal::readOnlyVoidMethodMethod(info); 9094 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9095 } 9096 9097 static void notEnumerableReadOnlyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9098 { 9099 TestObject* impl = V8TestObject::toNative(info.Holder()); 9100 impl->notEnumerableReadOnlyVoidMethod(); 9101 } 9102 9103 static void notEnumerableReadOnlyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9104 { 9105 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9106 TestObjectV8Internal::notEnumerableReadOnlyVoidMethodMethod(info); 9107 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9108 } 9109 9110 static void runtimeEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9111 { 9112 TestObject* impl = V8TestObject::toNative(info.Holder()); 9113 impl->runtimeEnabledVoidMethod(); 9114 } 9115 9116 static void runtimeEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9117 { 9118 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9119 TestObjectV8Internal::runtimeEnabledVoidMethodMethod(info); 9120 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9121 } 9122 9123 static void perWorldBindingsRuntimeEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9124 { 9125 TestObject* impl = V8TestObject::toNative(info.Holder()); 9126 impl->perWorldBindingsRuntimeEnabledVoidMethod(); 9127 } 9128 9129 static void perWorldBindingsRuntimeEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9130 { 9131 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9132 TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethod(info); 9133 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9134 } 9135 9136 static void perWorldBindingsRuntimeEnabledVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9137 { 9138 TestObject* impl = V8TestObject::toNative(info.Holder()); 9139 impl->perWorldBindingsRuntimeEnabledVoidMethod(); 9140 } 9141 9142 static void perWorldBindingsRuntimeEnabledVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9143 { 9144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9145 TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodForMainWorld(info); 9146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9147 } 9148 9149 static void runtimeEnabledOverloadedVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9150 { 9151 TestObject* impl = V8TestObject::toNative(info.Holder()); 9152 V8StringResource<> stringArg; 9153 { 9154 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 9155 } 9156 impl->runtimeEnabledOverloadedVoidMethod(stringArg); 9157 } 9158 9159 static void runtimeEnabledOverloadedVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9160 { 9161 ExceptionState exceptionState(ExceptionState::ExecutionContext, "runtimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9162 TestObject* impl = V8TestObject::toNative(info.Holder()); 9163 int longArg; 9164 { 9165 v8::TryCatch block; 9166 V8RethrowTryCatchScope rethrow(block); 9167 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 9168 } 9169 impl->runtimeEnabledOverloadedVoidMethod(longArg); 9170 } 9171 9172 static void runtimeEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9173 { 9174 v8::Isolate* isolate = info.GetIsolate(); 9175 ExceptionState exceptionState(ExceptionState::ExecutionContext, "runtimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), isolate); 9176 switch (std::min(1, info.Length())) { 9177 case 1: 9178 if (info[0]->IsNumber()) { 9179 runtimeEnabledOverloadedVoidMethod2Method(info); 9180 return; 9181 } 9182 if (true) { 9183 runtimeEnabledOverloadedVoidMethod1Method(info); 9184 return; 9185 } 9186 if (true) { 9187 runtimeEnabledOverloadedVoidMethod2Method(info); 9188 return; 9189 } 9190 break; 9191 default: 9192 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 9193 exceptionState.throwIfNeeded(); 9194 return; 9195 } 9196 exceptionState.throwTypeError("No function was found that matched the signature provided."); 9197 exceptionState.throwIfNeeded(); 9198 } 9199 9200 static void runtimeEnabledOverloadedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9201 { 9202 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9203 TestObjectV8Internal::runtimeEnabledOverloadedVoidMethodMethod(info); 9204 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9205 } 9206 9207 static void partiallyRuntimeEnabledOverloadedVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9208 { 9209 TestObject* impl = V8TestObject::toNative(info.Holder()); 9210 V8StringResource<> stringArg; 9211 { 9212 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 9213 } 9214 impl->partiallyRuntimeEnabledOverloadedVoidMethod(stringArg); 9215 } 9216 9217 static void partiallyRuntimeEnabledOverloadedVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9218 { 9219 TestObject* impl = V8TestObject::toNative(info.Holder()); 9220 TestInterfaceImplementation* testInterface; 9221 { 9222 v8::TryCatch block; 9223 V8RethrowTryCatchScope rethrow(block); 9224 TONATIVE_VOID_INTERNAL(testInterface, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 9225 } 9226 impl->partiallyRuntimeEnabledOverloadedVoidMethod(testInterface); 9227 } 9228 9229 static void partiallyRuntimeEnabledOverloadedVoidMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9230 { 9231 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partiallyRuntimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9232 TestObject* impl = V8TestObject::toNative(info.Holder()); 9233 int longArg; 9234 { 9235 v8::TryCatch block; 9236 V8RethrowTryCatchScope rethrow(block); 9237 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 9238 } 9239 impl->partiallyRuntimeEnabledOverloadedVoidMethod(longArg); 9240 } 9241 9242 static void partiallyRuntimeEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9243 { 9244 v8::Isolate* isolate = info.GetIsolate(); 9245 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partiallyRuntimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), isolate); 9246 switch (std::min(1, info.Length())) { 9247 case 1: 9248 if (RuntimeEnabledFeatures::featureName2Enabled()) { 9249 if (V8TestInterface::hasInstance(info[0], isolate)) { 9250 partiallyRuntimeEnabledOverloadedVoidMethod2Method(info); 9251 return; 9252 } 9253 } 9254 if (info[0]->IsNumber()) { 9255 partiallyRuntimeEnabledOverloadedVoidMethod3Method(info); 9256 return; 9257 } 9258 if (RuntimeEnabledFeatures::featureName1Enabled()) { 9259 if (true) { 9260 partiallyRuntimeEnabledOverloadedVoidMethod1Method(info); 9261 return; 9262 } 9263 } 9264 if (true) { 9265 partiallyRuntimeEnabledOverloadedVoidMethod3Method(info); 9266 return; 9267 } 9268 break; 9269 default: 9270 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 9271 exceptionState.throwIfNeeded(); 9272 return; 9273 } 9274 exceptionState.throwTypeError("No function was found that matched the signature provided."); 9275 exceptionState.throwIfNeeded(); 9276 } 9277 9278 static void partiallyRuntimeEnabledOverloadedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9279 { 9280 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9281 TestObjectV8Internal::partiallyRuntimeEnabledOverloadedVoidMethodMethod(info); 9282 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9283 } 9284 9285 static void treatReturnedNullStringAsNullStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9286 { 9287 TestObject* impl = V8TestObject::toNative(info.Holder()); 9288 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullStringMethod(), info.GetIsolate()); 9289 } 9290 9291 static void treatReturnedNullStringAsNullStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9292 { 9293 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9294 TestObjectV8Internal::treatReturnedNullStringAsNullStringMethodMethod(info); 9295 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9296 } 9297 9298 static void treatReturnedNullStringAsUndefinedStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9299 { 9300 TestObject* impl = V8TestObject::toNative(info.Holder()); 9301 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedStringMethod(), info.GetIsolate()); 9302 } 9303 9304 static void treatReturnedNullStringAsUndefinedStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9305 { 9306 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9307 TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringMethodMethod(info); 9308 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9309 } 9310 9311 static void treatReturnedNullStringAsNullByteStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9312 { 9313 TestObject* impl = V8TestObject::toNative(info.Holder()); 9314 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullByteStringMethod(), info.GetIsolate()); 9315 } 9316 9317 static void treatReturnedNullStringAsNullByteStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9318 { 9319 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9320 TestObjectV8Internal::treatReturnedNullStringAsNullByteStringMethodMethod(info); 9321 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9322 } 9323 9324 static void treatReturnedNullStringAsUndefinedByteStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9325 { 9326 TestObject* impl = V8TestObject::toNative(info.Holder()); 9327 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedByteStringMethod(), info.GetIsolate()); 9328 } 9329 9330 static void treatReturnedNullStringAsUndefinedByteStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9331 { 9332 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9333 TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringMethodMethod(info); 9334 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9335 } 9336 9337 static void treatReturnedNullStringAsNullScalarValueStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9338 { 9339 TestObject* impl = V8TestObject::toNative(info.Holder()); 9340 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullScalarValueStringMethod(), info.GetIsolate()); 9341 } 9342 9343 static void treatReturnedNullStringAsNullScalarValueStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9344 { 9345 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9346 TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringMethodMethod(info); 9347 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9348 } 9349 9350 static void treatReturnedNullStringAsUndefinedScalarValueStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9351 { 9352 TestObject* impl = V8TestObject::toNative(info.Holder()); 9353 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedScalarValueStringMethod(), info.GetIsolate()); 9354 } 9355 9356 static void treatReturnedNullStringAsUndefinedScalarValueStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9357 { 9358 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9359 TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringMethodMethod(info); 9360 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9361 } 9362 9363 static void typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9364 { 9365 if (UNLIKELY(info.Length() < 1)) { 9366 throwMinimumArityTypeErrorForMethod("typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()); 9367 return; 9368 } 9369 TestObject* impl = V8TestObject::toNative(info.Holder()); 9370 TestInterfaceEmpty* testInterfaceEmptyArg; 9371 { 9372 v8::TryCatch block; 9373 V8RethrowTryCatchScope rethrow(block); 9374 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) { 9375 throwTypeError(ExceptionMessages::failedToExecute("typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg", "TestObject", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate()); 9376 return; 9377 } 9378 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 9379 } 9380 impl->typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 9381 } 9382 9383 static void typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9384 { 9385 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9386 TestObjectV8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethod(info); 9387 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9388 } 9389 9390 static void typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9391 { 9392 if (UNLIKELY(info.Length() < 1)) { 9393 throwMinimumArityTypeErrorForMethod("typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArg", "TestObject", 1, info.Length(), info.GetIsolate()); 9394 return; 9395 } 9396 TestObject* impl = V8TestObject::toNative(info.Holder()); 9397 TestInterfaceEmpty* testInterfaceEmptyOrNullArg; 9398 { 9399 v8::TryCatch block; 9400 V8RethrowTryCatchScope rethrow(block); 9401 TONATIVE_VOID_INTERNAL(testInterfaceEmptyOrNullArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 9402 } 9403 impl->typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArg(testInterfaceEmptyOrNullArg); 9404 } 9405 9406 static void typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9407 { 9408 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9409 TestObjectV8Internal::typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArgMethod(info); 9410 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9411 } 9412 9413 static void typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9414 { 9415 if (UNLIKELY(info.Length() < 1)) { 9416 throwMinimumArityTypeErrorForMethod("typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArg", "TestObject", 1, info.Length(), info.GetIsolate()); 9417 return; 9418 } 9419 TestObject* impl = V8TestObject::toNative(info.Holder()); 9420 TestInterfaceEmpty* testInterfaceEmptyOrNullArg; 9421 { 9422 v8::TryCatch block; 9423 V8RethrowTryCatchScope rethrow(block); 9424 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) { 9425 throwTypeError(ExceptionMessages::failedToExecute("typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArg", "TestObject", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate()); 9426 return; 9427 } 9428 TONATIVE_VOID_INTERNAL(testInterfaceEmptyOrNullArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 9429 } 9430 impl->typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArg(testInterfaceEmptyOrNullArg); 9431 } 9432 9433 static void typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9434 { 9435 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9436 TestObjectV8Internal::typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArgMethod(info); 9437 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9438 } 9439 9440 static void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9441 { 9442 if (UNLIKELY(info.Length() < 2)) { 9443 throwMinimumArityTypeErrorForMethod("typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", "TestObject", 2, info.Length(), info.GetIsolate()); 9444 return; 9445 } 9446 TestObject* impl = V8TestObject::toNative(info.Holder()); 9447 float floatArg; 9448 double doubleArg; 9449 { 9450 v8::TryCatch block; 9451 V8RethrowTryCatchScope rethrow(block); 9452 TONATIVE_VOID_INTERNAL(floatArg, static_cast<float>(info[0]->NumberValue())); 9453 if (!std::isfinite(floatArg)) { 9454 throwTypeError(ExceptionMessages::failedToExecute("typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", "TestObject", "float parameter 1 is non-finite."), info.GetIsolate()); 9455 return; 9456 } 9457 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[1]->NumberValue())); 9458 if (!std::isfinite(doubleArg)) { 9459 throwTypeError(ExceptionMessages::failedToExecute("typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", "TestObject", "double parameter 2 is non-finite."), info.GetIsolate()); 9460 return; 9461 } 9462 } 9463 impl->typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(floatArg, doubleArg); 9464 } 9465 9466 static void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9467 { 9468 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9469 TestObjectV8Internal::typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethod(info); 9470 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9471 } 9472 9473 static void unforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9474 { 9475 TestObject* impl = V8TestObject::toNative(info.Holder()); 9476 impl->unforgeableVoidMethod(); 9477 } 9478 9479 static void unforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9480 { 9481 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9482 TestObjectV8Internal::unforgeableVoidMethodMethod(info); 9483 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9484 } 9485 9486 static void voidMethodTestInterfaceGarbageCollectedSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9487 { 9488 if (UNLIKELY(info.Length() < 1)) { 9489 throwMinimumArityTypeErrorForMethod("voidMethodTestInterfaceGarbageCollectedSequenceArg", "TestObject", 1, info.Length(), info.GetIsolate()); 9490 return; 9491 } 9492 TestObject* impl = V8TestObject::toNative(info.Holder()); 9493 HeapVector<Member<TestInterfaceGarbageCollected> > testInterfaceGarbageCollectedSequenceArg; 9494 { 9495 v8::TryCatch block; 9496 V8RethrowTryCatchScope rethrow(block); 9497 TONATIVE_VOID_INTERNAL(testInterfaceGarbageCollectedSequenceArg, (toMemberNativeArray<TestInterfaceGarbageCollected, V8TestInterfaceGarbageCollected>(info[0], 1, info.GetIsolate()))); 9498 } 9499 impl->voidMethodTestInterfaceGarbageCollectedSequenceArg(testInterfaceGarbageCollectedSequenceArg); 9500 } 9501 9502 static void voidMethodTestInterfaceGarbageCollectedSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9503 { 9504 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9505 TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedSequenceArgMethod(info); 9506 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9507 } 9508 9509 static void voidMethodTestInterfaceGarbageCollectedArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9510 { 9511 if (UNLIKELY(info.Length() < 1)) { 9512 throwMinimumArityTypeErrorForMethod("voidMethodTestInterfaceGarbageCollectedArrayArg", "TestObject", 1, info.Length(), info.GetIsolate()); 9513 return; 9514 } 9515 TestObject* impl = V8TestObject::toNative(info.Holder()); 9516 HeapVector<Member<TestInterfaceGarbageCollected> > testInterfaceGarbageCollectedArrayArg; 9517 { 9518 v8::TryCatch block; 9519 V8RethrowTryCatchScope rethrow(block); 9520 TONATIVE_VOID_INTERNAL(testInterfaceGarbageCollectedArrayArg, (toMemberNativeArray<TestInterfaceGarbageCollected, V8TestInterfaceGarbageCollected>(info[0], 1, info.GetIsolate()))); 9521 } 9522 impl->voidMethodTestInterfaceGarbageCollectedArrayArg(testInterfaceGarbageCollectedArrayArg); 9523 } 9524 9525 static void voidMethodTestInterfaceGarbageCollectedArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9526 { 9527 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9528 TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedArrayArgMethod(info); 9529 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9530 } 9531 9532 static void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9533 { 9534 if (UNLIKELY(info.Length() < 1)) { 9535 throwMinimumArityTypeErrorForMethod("voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg", "TestObject", 1, info.Length(), info.GetIsolate()); 9536 return; 9537 } 9538 TestObject* impl = V8TestObject::toNative(info.Holder()); 9539 WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected> > testInterfaceWillBeGarbageCollectedSequenceArg; 9540 { 9541 v8::TryCatch block; 9542 V8RethrowTryCatchScope rethrow(block); 9543 TONATIVE_VOID_INTERNAL(testInterfaceWillBeGarbageCollectedSequenceArg, (toRefPtrWillBeMemberNativeArray<TestInterfaceWillBeGarbageCollected, V8TestInterfaceWillBeGarbageCollected>(info[0], 1, info.GetIsolate()))); 9544 } 9545 impl->voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg(testInterfaceWillBeGarbageCollectedSequenceArg); 9546 } 9547 9548 static void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9549 { 9550 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9551 TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethod(info); 9552 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9553 } 9554 9555 static void voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9556 { 9557 if (UNLIKELY(info.Length() < 1)) { 9558 throwMinimumArityTypeErrorForMethod("voidMethodTestInterfaceWillBeGarbageCollectedArrayArg", "TestObject", 1, info.Length(), info.GetIsolate()); 9559 return; 9560 } 9561 TestObject* impl = V8TestObject::toNative(info.Holder()); 9562 WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected> > testInterfaceWillBeGarbageCollectedArrayArg; 9563 { 9564 v8::TryCatch block; 9565 V8RethrowTryCatchScope rethrow(block); 9566 TONATIVE_VOID_INTERNAL(testInterfaceWillBeGarbageCollectedArrayArg, (toRefPtrWillBeMemberNativeArray<TestInterfaceWillBeGarbageCollected, V8TestInterfaceWillBeGarbageCollected>(info[0], 1, info.GetIsolate()))); 9567 } 9568 impl->voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(testInterfaceWillBeGarbageCollectedArrayArg); 9569 } 9570 9571 static void voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9572 { 9573 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 9574 TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethod(info); 9575 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 9576 } 9577 9578 } // namespace TestObjectV8Internal 9579 9580 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] = { 9581 {"readonlyStringAttribute", TestObjectV8Internal::readonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9582 {"readonlyTestInterfaceEmptyAttribute", TestObjectV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9583 {"readonlyLongAttribute", TestObjectV8Internal::readonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9584 {"dateAttribute", TestObjectV8Internal::dateAttributeAttributeGetterCallback, TestObjectV8Internal::dateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9585 {"stringAttribute", TestObjectV8Internal::stringAttributeAttributeGetterCallback, TestObjectV8Internal::stringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9586 {"byteStringAttribute", TestObjectV8Internal::byteStringAttributeAttributeGetterCallback, TestObjectV8Internal::byteStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9587 {"scalarValueStringAttribute", TestObjectV8Internal::scalarValueStringAttributeAttributeGetterCallback, TestObjectV8Internal::scalarValueStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9588 {"domTimeStampAttribute", TestObjectV8Internal::domTimeStampAttributeAttributeGetterCallback, TestObjectV8Internal::domTimeStampAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9589 {"booleanAttribute", TestObjectV8Internal::booleanAttributeAttributeGetterCallback, TestObjectV8Internal::booleanAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9590 {"byteAttribute", TestObjectV8Internal::byteAttributeAttributeGetterCallback, TestObjectV8Internal::byteAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9591 {"doubleAttribute", TestObjectV8Internal::doubleAttributeAttributeGetterCallback, TestObjectV8Internal::doubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9592 {"floatAttribute", TestObjectV8Internal::floatAttributeAttributeGetterCallback, TestObjectV8Internal::floatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9593 {"longAttribute", TestObjectV8Internal::longAttributeAttributeGetterCallback, TestObjectV8Internal::longAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9594 {"longLongAttribute", TestObjectV8Internal::longLongAttributeAttributeGetterCallback, TestObjectV8Internal::longLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9595 {"octetAttribute", TestObjectV8Internal::octetAttributeAttributeGetterCallback, TestObjectV8Internal::octetAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9596 {"shortAttribute", TestObjectV8Internal::shortAttributeAttributeGetterCallback, TestObjectV8Internal::shortAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9597 {"unrestrictedDoubleAttribute", TestObjectV8Internal::unrestrictedDoubleAttributeAttributeGetterCallback, TestObjectV8Internal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9598 {"unrestrictedFloatAttribute", TestObjectV8Internal::unrestrictedFloatAttributeAttributeGetterCallback, TestObjectV8Internal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9599 {"unsignedLongAttribute", TestObjectV8Internal::unsignedLongAttributeAttributeGetterCallback, TestObjectV8Internal::unsignedLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9600 {"unsignedLongLongAttribute", TestObjectV8Internal::unsignedLongLongAttributeAttributeGetterCallback, TestObjectV8Internal::unsignedLongLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9601 {"unsignedShortAttribute", TestObjectV8Internal::unsignedShortAttributeAttributeGetterCallback, TestObjectV8Internal::unsignedShortAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9602 {"testInterfaceEmptyAttribute", TestObjectV8Internal::testInterfaceEmptyAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceEmptyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9603 {"testObjectAttribute", TestObjectV8Internal::testObjectAttributeAttributeGetterCallback, TestObjectV8Internal::testObjectAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9604 {"voidCallbackFunctionAttribute", TestObjectV8Internal::voidCallbackFunctionAttributeAttributeGetterCallback, TestObjectV8Internal::voidCallbackFunctionAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9605 {"anyCallbackFunctionOptionalAnyArgAttribute", TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeGetterCallback, TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9606 {"cssAttribute", TestObjectV8Internal::cssAttributeAttributeGetterCallback, TestObjectV8Internal::cssAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9607 {"imeAttribute", TestObjectV8Internal::imeAttributeAttributeGetterCallback, TestObjectV8Internal::imeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9608 {"svgAttribute", TestObjectV8Internal::svgAttributeAttributeGetterCallback, TestObjectV8Internal::svgAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9609 {"xmlAttribute", TestObjectV8Internal::xmlAttributeAttributeGetterCallback, TestObjectV8Internal::xmlAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9610 {"nodeFilterAttribute", TestObjectV8Internal::nodeFilterAttributeAttributeGetterCallback, TestObjectV8Internal::nodeFilterAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9611 {"serializedScriptValueAttribute", TestObjectV8Internal::serializedScriptValueAttributeAttributeGetterCallback, TestObjectV8Internal::serializedScriptValueAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9612 {"anyAttribute", TestObjectV8Internal::anyAttributeAttributeGetterCallback, TestObjectV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9613 {"promiseAttribute", TestObjectV8Internal::promiseAttributeAttributeGetterCallback, TestObjectV8Internal::promiseAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9614 {"windowAttribute", TestObjectV8Internal::windowAttributeAttributeGetterCallback, TestObjectV8Internal::windowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9615 {"documentAttribute", TestObjectV8Internal::documentAttributeAttributeGetterCallback, TestObjectV8Internal::documentAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9616 {"documentFragmentAttribute", TestObjectV8Internal::documentFragmentAttributeAttributeGetterCallback, TestObjectV8Internal::documentFragmentAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9617 {"documentTypeAttribute", TestObjectV8Internal::documentTypeAttributeAttributeGetterCallback, TestObjectV8Internal::documentTypeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9618 {"elementAttribute", TestObjectV8Internal::elementAttributeAttributeGetterCallback, TestObjectV8Internal::elementAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9619 {"nodeAttribute", TestObjectV8Internal::nodeAttributeAttributeGetterCallback, TestObjectV8Internal::nodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9620 {"shadowRootAttribute", TestObjectV8Internal::shadowRootAttributeAttributeGetterCallback, TestObjectV8Internal::shadowRootAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9621 {"arrayBufferAttribute", TestObjectV8Internal::arrayBufferAttributeAttributeGetterCallback, TestObjectV8Internal::arrayBufferAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9622 {"float32ArrayAttribute", TestObjectV8Internal::float32ArrayAttributeAttributeGetterCallback, TestObjectV8Internal::float32ArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9623 {"uint8ArrayAttribute", TestObjectV8Internal::uint8ArrayAttributeAttributeGetterCallback, TestObjectV8Internal::uint8ArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9624 {"self", TestObjectV8Internal::selfAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9625 {"readonlyEventTargetAttribute", TestObjectV8Internal::readonlyEventTargetAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9626 {"readonlyEventTargetOrNullAttribute", TestObjectV8Internal::readonlyEventTargetOrNullAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9627 {"readonlyWindowAttribute", TestObjectV8Internal::readonlyWindowAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9628 {"htmlCollectionAttribute", TestObjectV8Internal::htmlCollectionAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9629 {"htmlElementAttribute", TestObjectV8Internal::htmlElementAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9630 {"stringArrayAttribute", TestObjectV8Internal::stringArrayAttributeAttributeGetterCallback, TestObjectV8Internal::stringArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9631 {"testInterfaceEmptyArrayAttribute", TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9632 {"floatArrayAttribute", TestObjectV8Internal::floatArrayAttributeAttributeGetterCallback, TestObjectV8Internal::floatArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9633 {"stringOrNullAttribute", TestObjectV8Internal::stringOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::stringOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9634 {"longOrNullAttribute", TestObjectV8Internal::longOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::longOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9635 {"testInterfaceOrNullAttribute", TestObjectV8Internal::testInterfaceOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9636 {"testEnumAttribute", TestObjectV8Internal::testEnumAttributeAttributeGetterCallback, TestObjectV8Internal::testEnumAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9637 {"eventHandlerAttribute", TestObjectV8Internal::eventHandlerAttributeAttributeGetterCallback, TestObjectV8Internal::eventHandlerAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9638 {"activityLoggingAccessForAllWorldsLongAttribute", TestObjectV8Internal::activityLoggingAccessForAllWorldsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingAccessForAllWorldsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9639 {"activityLoggingGetterForAllWorldsLongAttribute", TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9640 {"activityLoggingSetterForAllWorldsLongAttribute", TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9641 {"cachedAttributeAnyAttribute", TestObjectV8Internal::cachedAttributeAnyAttributeAttributeGetterCallback, TestObjectV8Internal::cachedAttributeAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9642 {"cachedArrayAttribute", TestObjectV8Internal::cachedArrayAttributeAttributeGetterCallback, TestObjectV8Internal::cachedArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9643 {"callWithExecutionContextAnyAttribute", TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeGetterCallback, TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9644 {"callWithScriptStateAnyAttribute", TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeGetterCallback, TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9645 {"callWithExecutionContextAndScriptStateAnyAttribute", TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeGetterCallback, TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9646 {"checkSecurityForNodeReadonlyDocumentAttribute", TestObjectV8Internal::checkSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9647 #if ENABLE(CONDITION) 9648 {"conditionalLongAttribute", TestObjectV8Internal::conditionalLongAttributeAttributeGetterCallback, TestObjectV8Internal::conditionalLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9649 #endif // ENABLE(CONDITION) 9650 #if ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 9651 {"conditionalAndLongAttribute", TestObjectV8Internal::conditionalAndLongAttributeAttributeGetterCallback, TestObjectV8Internal::conditionalAndLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9652 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 9653 #if ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 9654 {"conditionalOrLongAttribute", TestObjectV8Internal::conditionalOrLongAttributeAttributeGetterCallback, TestObjectV8Internal::conditionalOrLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9655 #endif // ENABLE(CONDITION_1) || ENABLE(CONDITION_2) 9656 {"testInterfaceEmptyConstructorAttribute", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterfaceEmpty::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, 9657 {"testInterfaceEmptyConstructorAttribute", TestObjectV8Internal::testInterfaceEmptyConstructorAttributeConstructorGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterfaceEmpty::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, 9658 {"measureAsFeatureNameTestInterfaceEmptyConstructorAttribute", TestObjectV8Internal::measureAsFeatureNameTestInterfaceEmptyConstructorAttributeConstructorGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterfaceEmpty::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, 9659 {"customObjectAttribute", TestObjectV8Internal::customObjectAttributeAttributeGetterCallback, TestObjectV8Internal::customObjectAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9660 {"customGetterLongAttribute", TestObjectV8Internal::customGetterLongAttributeAttributeGetterCallback, TestObjectV8Internal::customGetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9661 {"customGetterReadonlyObjectAttribute", TestObjectV8Internal::customGetterReadonlyObjectAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9662 {"customSetterLongAttribute", TestObjectV8Internal::customSetterLongAttributeAttributeGetterCallback, TestObjectV8Internal::customSetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9663 #if ENABLE(CONDITION) 9664 {"customLongAttribute", TestObjectV8Internal::customLongAttributeAttributeGetterCallback, TestObjectV8Internal::customLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9665 #endif // ENABLE(CONDITION) 9666 {"customElementsCallbacksReadonlyLongAttribute", TestObjectV8Internal::customElementsCallbacksReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9667 {"deprecatedLongAttribute", TestObjectV8Internal::deprecatedLongAttributeAttributeGetterCallback, TestObjectV8Internal::deprecatedLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9668 {"enforceRangeLongAttribute", TestObjectV8Internal::enforceRangeLongAttributeAttributeGetterCallback, TestObjectV8Internal::enforceRangeLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9669 {"implementedAsLongAttribute", TestObjectV8Internal::implementedAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::implementedAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9670 {"customImplementedAsLongAttribute", TestObjectV8Internal::customImplementedAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::customImplementedAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9671 {"customGetterImplementedAsLongAttribute", TestObjectV8Internal::customGetterImplementedAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::customGetterImplementedAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9672 {"customSetterImplementedAsLongAttribute", TestObjectV8Internal::customSetterImplementedAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::customSetterImplementedAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9673 {"measureAsLongAttribute", TestObjectV8Internal::measureAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::measureAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9674 {"notEnumerableLongAttribute", TestObjectV8Internal::notEnumerableLongAttributeAttributeGetterCallback, TestObjectV8Internal::notEnumerableLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */}, 9675 {"perWorldBindingsReadonlyTestInterfaceEmptyAttribute", TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, 0, TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9676 {"activityLoggingAccessPerWorldBindingsLongAttribute", TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallback, TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9677 {"activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback, TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9678 {"activityLoggingGetterPerWorldBindingsLongAttribute", TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallback, TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9679 {"activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback, TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9680 {"location", TestObjectV8Internal::locationAttributeGetterCallback, TestObjectV8Internal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9681 {"locationWithException", TestObjectV8Internal::locationWithExceptionAttributeGetterCallback, TestObjectV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9682 {"locationWithCallWith", TestObjectV8Internal::locationWithCallWithAttributeGetterCallback, TestObjectV8Internal::locationWithCallWithAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9683 {"locationWithPerWorldBindings", TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetterCallback, TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetterCallback, TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetterCallbackForMainWorld, TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9684 {"locationGarbageCollected", TestObjectV8Internal::locationGarbageCollectedAttributeGetterCallback, TestObjectV8Internal::locationGarbageCollectedAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9685 {"locationWillBeGarbageCollected", TestObjectV8Internal::locationWillBeGarbageCollectedAttributeGetterCallback, TestObjectV8Internal::locationWillBeGarbageCollectedAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9686 {"raisesExceptionLongAttribute", TestObjectV8Internal::raisesExceptionLongAttributeAttributeGetterCallback, TestObjectV8Internal::raisesExceptionLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9687 {"raisesExceptionGetterLongAttribute", TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeGetterCallback, TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9688 {"setterRaisesExceptionLongAttribute", TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeGetterCallback, TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9689 {"raisesExceptionTestInterfaceEmptyAttribute", TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeGetterCallback, TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9690 {"cachedAttributeRaisesExceptionGetterAnyAttribute", TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetterCallback, TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9691 {"reflectTestInterfaceAttribute", TestObjectV8Internal::reflectTestInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::reflectTestInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9692 {"reflectReflectedNameAttributeTestAttribute", TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeGetterCallback, TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9693 {"reflectBooleanAttribute", TestObjectV8Internal::reflectBooleanAttributeAttributeGetterCallback, TestObjectV8Internal::reflectBooleanAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9694 {"reflectLongAttribute", TestObjectV8Internal::reflectLongAttributeAttributeGetterCallback, TestObjectV8Internal::reflectLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9695 {"reflectUnsignedShortAttribute", TestObjectV8Internal::reflectUnsignedShortAttributeAttributeGetterCallback, TestObjectV8Internal::reflectUnsignedShortAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9696 {"reflectUnsignedLongAttribute", TestObjectV8Internal::reflectUnsignedLongAttributeAttributeGetterCallback, TestObjectV8Internal::reflectUnsignedLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9697 {"id", TestObjectV8Internal::idAttributeGetterCallback, TestObjectV8Internal::idAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9698 {"name", TestObjectV8Internal::nameAttributeGetterCallback, TestObjectV8Internal::nameAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9699 {"class", TestObjectV8Internal::classAttributeGetterCallback, TestObjectV8Internal::classAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9700 {"reflectedId", TestObjectV8Internal::reflectedIdAttributeGetterCallback, TestObjectV8Internal::reflectedIdAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9701 {"reflectedName", TestObjectV8Internal::reflectedNameAttributeGetterCallback, TestObjectV8Internal::reflectedNameAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9702 {"reflectedClass", TestObjectV8Internal::reflectedClassAttributeGetterCallback, TestObjectV8Internal::reflectedClassAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9703 {"limitedToOnlyOneAttribute", TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9704 {"limitedToOnlyAttribute", TestObjectV8Internal::limitedToOnlyAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9705 {"limitedToOnlyOtherAttribute", TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9706 {"limitedWithMissingDefaultAttribute", TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9707 {"limitedWithInvalidMissingDefaultAttribute", TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9708 {"corsSettingAttribute", TestObjectV8Internal::corsSettingAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9709 {"limitedWithEmptyMissingInvalidAttribute", TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9710 {"replaceableReadonlyLongAttribute", TestObjectV8Internal::replaceableReadonlyLongAttributeAttributeGetterCallback, TestObjectV8Internal::TestObjectReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9711 {"locationReplaceable", TestObjectV8Internal::locationReplaceableAttributeGetterCallback, TestObjectV8Internal::locationReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9712 {"setterCallWithActiveWindowAndFirstWindowStringAttribute", TestObjectV8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGetterCallback, TestObjectV8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9713 {"setterCallWithExecutionContextStringAttribute", TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeGetterCallback, TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9714 {"treatNullAsNullStringStringAttribute", TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9715 {"treatReturnedNullStringAsNullStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9716 {"treatReturnedNullStringAsUndefinedStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9717 {"treatReturnedNullStringAsNullByteStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsNullByteStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsNullByteStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9718 {"treatReturnedNullStringAsUndefinedByteStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9719 {"treatReturnedNullStringAsNullScalarValueStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9720 {"treatReturnedNullStringAsUndefinedScalarValueStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9721 {"typeCheckingInterfaceNullableStringFloatAttribute", TestObjectV8Internal::typeCheckingInterfaceNullableStringFloatAttributeAttributeGetterCallback, TestObjectV8Internal::typeCheckingInterfaceNullableStringFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9722 {"typeCheckingInterfaceTestInterfaceAttribute", TestObjectV8Internal::typeCheckingInterfaceTestInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::typeCheckingInterfaceTestInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9723 {"typeCheckingNullableTestInterfaceOrNullAttribute", TestObjectV8Internal::typeCheckingNullableTestInterfaceOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::typeCheckingNullableTestInterfaceOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9724 {"typeCheckingInterfaceNullableTestInterfaceOrNullAttribute", TestObjectV8Internal::typeCheckingInterfaceNullableTestInterfaceOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::typeCheckingInterfaceNullableTestInterfaceOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9725 {"urlStringAttribute", TestObjectV8Internal::urlStringAttributeAttributeGetterCallback, TestObjectV8Internal::urlStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9726 {"urlStringAttribute", TestObjectV8Internal::urlStringAttributeAttributeGetterCallback, TestObjectV8Internal::urlStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9727 {"unforgeableLongAttribute", TestObjectV8Internal::unforgeableLongAttributeAttributeGetterCallback, TestObjectV8Internal::unforgeableLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS_OVERWRITING), static_cast<v8::PropertyAttribute>(v8::DontDelete), 0 /* on instance */}, 9728 {"activityLoggingSetterOnlyLogPreviousValueAttribute", TestObjectV8Internal::activityLoggingSetterOnlyLogPreviousValueAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingSetterOnlyLogPreviousValueAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9729 {"activityLoggingLogPreviousValueInterfaceAttribute", TestObjectV8Internal::activityLoggingLogPreviousValueInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingLogPreviousValueInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9730 {"testInterfaceAttribute", TestObjectV8Internal::testInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9731 {"testInterfaceGarbageCollectedAttribute", TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9732 {"testInterfaceGarbageCollectedOrNullAttribute", TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9733 {"testInterfaceWillBeGarbageCollectedAttribute", TestObjectV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9734 {"testInterfaceWillBeGarbageCollectedOrNullAttribute", TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 9735 }; 9736 9737 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = { 9738 {"exposeJSAccessorsLongAttribute", TestObjectV8Internal::exposeJSAccessorsLongAttributeAttributeGetterCallback, TestObjectV8Internal::exposeJSAccessorsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)}, 9739 }; 9740 9741 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { 9742 {"voidMethod", TestObjectV8Internal::voidMethodMethodCallback, 0, 0}, 9743 {"dateMethod", TestObjectV8Internal::dateMethodMethodCallback, 0, 0}, 9744 {"stringMethod", TestObjectV8Internal::stringMethodMethodCallback, 0, 0}, 9745 {"byteStringMethod", TestObjectV8Internal::byteStringMethodMethodCallback, 0, 0}, 9746 {"scalarValueStringMethod", TestObjectV8Internal::scalarValueStringMethodMethodCallback, 0, 0}, 9747 {"readonlyDOMTimeStampMethod", TestObjectV8Internal::readonlyDOMTimeStampMethodMethodCallback, 0, 0}, 9748 {"booleanMethod", TestObjectV8Internal::booleanMethodMethodCallback, 0, 0}, 9749 {"byteMethod", TestObjectV8Internal::byteMethodMethodCallback, 0, 0}, 9750 {"doubleMethod", TestObjectV8Internal::doubleMethodMethodCallback, 0, 0}, 9751 {"floatMethod", TestObjectV8Internal::floatMethodMethodCallback, 0, 0}, 9752 {"longMethod", TestObjectV8Internal::longMethodMethodCallback, 0, 0}, 9753 {"longLongMethod", TestObjectV8Internal::longLongMethodMethodCallback, 0, 0}, 9754 {"octetMethod", TestObjectV8Internal::octetMethodMethodCallback, 0, 0}, 9755 {"shortMethod", TestObjectV8Internal::shortMethodMethodCallback, 0, 0}, 9756 {"unsignedLongMethod", TestObjectV8Internal::unsignedLongMethodMethodCallback, 0, 0}, 9757 {"unsignedLongLongMethod", TestObjectV8Internal::unsignedLongLongMethodMethodCallback, 0, 0}, 9758 {"unsignedShortMethod", TestObjectV8Internal::unsignedShortMethodMethodCallback, 0, 0}, 9759 {"voidMethodDateArg", TestObjectV8Internal::voidMethodDateArgMethodCallback, 0, 1}, 9760 {"voidMethodStringArg", TestObjectV8Internal::voidMethodStringArgMethodCallback, 0, 1}, 9761 {"voidMethodByteStringArg", TestObjectV8Internal::voidMethodByteStringArgMethodCallback, 0, 1}, 9762 {"voidMethodScalarValueStringArg", TestObjectV8Internal::voidMethodScalarValueStringArgMethodCallback, 0, 1}, 9763 {"voidMethodDOMTimeStampArg", TestObjectV8Internal::voidMethodDOMTimeStampArgMethodCallback, 0, 1}, 9764 {"voidMethodBooleanArg", TestObjectV8Internal::voidMethodBooleanArgMethodCallback, 0, 1}, 9765 {"voidMethodByteArg", TestObjectV8Internal::voidMethodByteArgMethodCallback, 0, 1}, 9766 {"voidMethodDoubleArg", TestObjectV8Internal::voidMethodDoubleArgMethodCallback, 0, 1}, 9767 {"voidMethodFloatArg", TestObjectV8Internal::voidMethodFloatArgMethodCallback, 0, 1}, 9768 {"voidMethodLongArg", TestObjectV8Internal::voidMethodLongArgMethodCallback, 0, 1}, 9769 {"voidMethodLongLongArg", TestObjectV8Internal::voidMethodLongLongArgMethodCallback, 0, 1}, 9770 {"voidMethodOctetArg", TestObjectV8Internal::voidMethodOctetArgMethodCallback, 0, 1}, 9771 {"voidMethodShortArg", TestObjectV8Internal::voidMethodShortArgMethodCallback, 0, 1}, 9772 {"voidMethodUnsignedLongArg", TestObjectV8Internal::voidMethodUnsignedLongArgMethodCallback, 0, 1}, 9773 {"voidMethodUnsignedLongLongArg", TestObjectV8Internal::voidMethodUnsignedLongLongArgMethodCallback, 0, 1}, 9774 {"voidMethodUnsignedShortArg", TestObjectV8Internal::voidMethodUnsignedShortArgMethodCallback, 0, 1}, 9775 {"testInterfaceEmptyMethod", TestObjectV8Internal::testInterfaceEmptyMethodMethodCallback, 0, 0}, 9776 {"voidMethodTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, 9777 {"voidMethodLongArgTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodLongArgTestInterfaceEmptyArgMethodCallback, 0, 2}, 9778 {"voidCallbackFunctionMethod", TestObjectV8Internal::voidCallbackFunctionMethodMethodCallback, 0, 0}, 9779 {"anyCallbackFunctionOptionalAnyArgMethod", TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgMethodMethodCallback, 0, 0}, 9780 {"voidMethodVoidCallbackFunctionArg", TestObjectV8Internal::voidMethodVoidCallbackFunctionArgMethodCallback, 0, 1}, 9781 {"voidMethodAnyCallbackFunctionOptionalAnyArg", TestObjectV8Internal::voidMethodAnyCallbackFunctionOptionalAnyArgMethodCallback, 0, 1}, 9782 {"compareHowMethod", TestObjectV8Internal::compareHowMethodMethodCallback, 0, 0}, 9783 {"anyMethod", TestObjectV8Internal::anyMethodMethodCallback, 0, 0}, 9784 {"voidMethodCompareHowArg", TestObjectV8Internal::voidMethodCompareHowArgMethodCallback, 0, 1}, 9785 {"voidMethodEventTargetArg", TestObjectV8Internal::voidMethodEventTargetArgMethodCallback, 0, 1}, 9786 {"voidMethodMediaQueryListListenerArg", TestObjectV8Internal::voidMethodMediaQueryListListenerArgMethodCallback, 0, 1}, 9787 {"voidMethodAnyArg", TestObjectV8Internal::voidMethodAnyArgMethodCallback, 0, 1}, 9788 {"voidMethodAttrArg", TestObjectV8Internal::voidMethodAttrArgMethodCallback, 0, 1}, 9789 {"voidMethodDocumentArg", TestObjectV8Internal::voidMethodDocumentArgMethodCallback, 0, 1}, 9790 {"voidMethodDocumentTypeArg", TestObjectV8Internal::voidMethodDocumentTypeArgMethodCallback, 0, 1}, 9791 {"voidMethodElementArg", TestObjectV8Internal::voidMethodElementArgMethodCallback, 0, 1}, 9792 {"voidMethodNodeArg", TestObjectV8Internal::voidMethodNodeArgMethodCallback, 0, 1}, 9793 {"arrayBufferMethod", TestObjectV8Internal::arrayBufferMethodMethodCallback, 0, 0}, 9794 {"arrayBufferViewMethod", TestObjectV8Internal::arrayBufferViewMethodMethodCallback, 0, 0}, 9795 {"float32ArrayMethod", TestObjectV8Internal::float32ArrayMethodMethodCallback, 0, 0}, 9796 {"int32ArrayMethod", TestObjectV8Internal::int32ArrayMethodMethodCallback, 0, 0}, 9797 {"uint8ArrayMethod", TestObjectV8Internal::uint8ArrayMethodMethodCallback, 0, 0}, 9798 {"voidMethodArrayBufferArg", TestObjectV8Internal::voidMethodArrayBufferArgMethodCallback, 0, 1}, 9799 {"voidMethodArrayBufferOrNullArg", TestObjectV8Internal::voidMethodArrayBufferOrNullArgMethodCallback, 0, 1}, 9800 {"voidMethodArrayBufferViewArg", TestObjectV8Internal::voidMethodArrayBufferViewArgMethodCallback, 0, 1}, 9801 {"voidMethodFloat32ArrayArg", TestObjectV8Internal::voidMethodFloat32ArrayArgMethodCallback, 0, 1}, 9802 {"voidMethodInt32ArrayArg", TestObjectV8Internal::voidMethodInt32ArrayArgMethodCallback, 0, 1}, 9803 {"voidMethodUint8ArrayArg", TestObjectV8Internal::voidMethodUint8ArrayArgMethodCallback, 0, 1}, 9804 {"longArrayMethod", TestObjectV8Internal::longArrayMethodMethodCallback, 0, 0}, 9805 {"stringArrayMethod", TestObjectV8Internal::stringArrayMethodMethodCallback, 0, 0}, 9806 {"testInterfaceEmptyArrayMethod", TestObjectV8Internal::testInterfaceEmptyArrayMethodMethodCallback, 0, 0}, 9807 {"voidMethodArrayLongArg", TestObjectV8Internal::voidMethodArrayLongArgMethodCallback, 0, 1}, 9808 {"voidMethodArrayStringArg", TestObjectV8Internal::voidMethodArrayStringArgMethodCallback, 0, 1}, 9809 {"voidMethodArrayTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodArrayTestInterfaceEmptyArgMethodCallback, 0, 1}, 9810 {"longSequenceMethod", TestObjectV8Internal::longSequenceMethodMethodCallback, 0, 0}, 9811 {"stringSequenceMethod", TestObjectV8Internal::stringSequenceMethodMethodCallback, 0, 0}, 9812 {"testInterfaceEmptySequenceMethod", TestObjectV8Internal::testInterfaceEmptySequenceMethodMethodCallback, 0, 0}, 9813 {"voidMethodSequenceLongArg", TestObjectV8Internal::voidMethodSequenceLongArgMethodCallback, 0, 1}, 9814 {"voidMethodSequenceStringArg", TestObjectV8Internal::voidMethodSequenceStringArgMethodCallback, 0, 1}, 9815 {"voidMethodSequenceTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodSequenceTestInterfaceEmptyArgMethodCallback, 0, 1}, 9816 {"voidMethodTestInterfaceEmptyOrNullArg", TestObjectV8Internal::voidMethodTestInterfaceEmptyOrNullArgMethodCallback, 0, 1}, 9817 {"voidMethodTestCallbackInterfaceArg", TestObjectV8Internal::voidMethodTestCallbackInterfaceArgMethodCallback, 0, 1}, 9818 {"voidMethodOptionalTestCallbackInterfaceArg", TestObjectV8Internal::voidMethodOptionalTestCallbackInterfaceArgMethodCallback, 0, 0}, 9819 {"voidMethodTestCallbackInterfaceOrNullArg", TestObjectV8Internal::voidMethodTestCallbackInterfaceOrNullArgMethodCallback, 0, 1}, 9820 {"testEnumMethod", TestObjectV8Internal::testEnumMethodMethodCallback, 0, 0}, 9821 {"voidMethodTestEnumArg", TestObjectV8Internal::voidMethodTestEnumArgMethodCallback, 0, 1}, 9822 {"dictionaryMethod", TestObjectV8Internal::dictionaryMethodMethodCallback, 0, 0}, 9823 {"nodeFilterMethod", TestObjectV8Internal::nodeFilterMethodMethodCallback, 0, 0}, 9824 {"promiseMethod", TestObjectV8Internal::promiseMethodMethodCallback, 0, 0}, 9825 {"serializedScriptValueMethod", TestObjectV8Internal::serializedScriptValueMethodMethodCallback, 0, 0}, 9826 {"xPathNSResolverMethod", TestObjectV8Internal::xPathNSResolverMethodMethodCallback, 0, 0}, 9827 {"voidMethodDictionaryArg", TestObjectV8Internal::voidMethodDictionaryArgMethodCallback, 0, 1}, 9828 {"voidMethodEventListenerArg", TestObjectV8Internal::voidMethodEventListenerArgMethodCallback, 0, 1}, 9829 {"voidMethodNodeFilterArg", TestObjectV8Internal::voidMethodNodeFilterArgMethodCallback, 0, 1}, 9830 {"voidMethodPromiseArg", TestObjectV8Internal::voidMethodPromiseArgMethodCallback, 0, 1}, 9831 {"voidMethodSerializedScriptValueArg", TestObjectV8Internal::voidMethodSerializedScriptValueArgMethodCallback, 0, 1}, 9832 {"voidMethodXPathNSResolverArg", TestObjectV8Internal::voidMethodXPathNSResolverArgMethodCallback, 0, 1}, 9833 {"voidMethodDictionarySequenceArg", TestObjectV8Internal::voidMethodDictionarySequenceArgMethodCallback, 0, 1}, 9834 {"voidMethodStringArgLongArg", TestObjectV8Internal::voidMethodStringArgLongArgMethodCallback, 0, 2}, 9835 {"voidMethodOptionalStringArg", TestObjectV8Internal::voidMethodOptionalStringArgMethodCallback, 0, 0}, 9836 {"voidMethodOptionalTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodOptionalTestInterfaceEmptyArgMethodCallback, 0, 0}, 9837 {"voidMethodOptionalLongArg", TestObjectV8Internal::voidMethodOptionalLongArgMethodCallback, 0, 0}, 9838 {"stringMethodOptionalLongArg", TestObjectV8Internal::stringMethodOptionalLongArgMethodCallback, 0, 0}, 9839 {"testInterfaceEmptyMethodOptionalLongArg", TestObjectV8Internal::testInterfaceEmptyMethodOptionalLongArgMethodCallback, 0, 0}, 9840 {"longMethodOptionalLongArg", TestObjectV8Internal::longMethodOptionalLongArgMethodCallback, 0, 0}, 9841 {"voidMethodLongArgOptionalLongArg", TestObjectV8Internal::voidMethodLongArgOptionalLongArgMethodCallback, 0, 1}, 9842 {"voidMethodLongArgOptionalLongArgOptionalLongArg", TestObjectV8Internal::voidMethodLongArgOptionalLongArgOptionalLongArgMethodCallback, 0, 1}, 9843 {"voidMethodLongArgOptionalTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodLongArgOptionalTestInterfaceEmptyArgMethodCallback, 0, 1}, 9844 {"voidMethodTestInterfaceEmptyArgOptionalLongArg", TestObjectV8Internal::voidMethodTestInterfaceEmptyArgOptionalLongArgMethodCallback, 0, 1}, 9845 {"voidMethodOptionalDictionaryArg", TestObjectV8Internal::voidMethodOptionalDictionaryArgMethodCallback, 0, 0}, 9846 {"voidMethodDefaultStringArg", TestObjectV8Internal::voidMethodDefaultStringArgMethodCallback, 0, 0}, 9847 {"voidMethodDefaultNullStringArg", TestObjectV8Internal::voidMethodDefaultNullStringArgMethodCallback, 0, 0}, 9848 {"voidMethodDefaultLongArg", TestObjectV8Internal::voidMethodDefaultLongArgMethodCallback, 0, 0}, 9849 {"voidMethodDefaultDoubleArg", TestObjectV8Internal::voidMethodDefaultDoubleArgMethodCallback, 0, 0}, 9850 {"voidMethodDefaultTrueBooleanArg", TestObjectV8Internal::voidMethodDefaultTrueBooleanArgMethodCallback, 0, 0}, 9851 {"voidMethodDefaultFalseBooleanArg", TestObjectV8Internal::voidMethodDefaultFalseBooleanArgMethodCallback, 0, 0}, 9852 {"voidMethodDefaultNullableStringArg", TestObjectV8Internal::voidMethodDefaultNullableStringArgMethodCallback, 0, 0}, 9853 {"voidMethodDefaultNullableTestInterfaceArg", TestObjectV8Internal::voidMethodDefaultNullableTestInterfaceArgMethodCallback, 0, 0}, 9854 {"voidMethodVariadicStringArg", TestObjectV8Internal::voidMethodVariadicStringArgMethodCallback, 0, 0}, 9855 {"voidMethodStringArgVariadicStringArg", TestObjectV8Internal::voidMethodStringArgVariadicStringArgMethodCallback, 0, 1}, 9856 {"voidMethodVariadicTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethodCallback, 0, 0}, 9857 {"voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethodCallback, 0, 1}, 9858 {"voidMethodVariadicTestInterfaceGarbageCollectedArg", TestObjectV8Internal::voidMethodVariadicTestInterfaceGarbageCollectedArgMethodCallback, 0, 0}, 9859 {"voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg", TestObjectV8Internal::voidMethodVariadicTestInterfaceWillBeGarbageCollectedArgMethodCallback, 0, 0}, 9860 {"overloadedMethodA", TestObjectV8Internal::overloadedMethodAMethodCallback, 0, 1}, 9861 {"overloadedMethodB", TestObjectV8Internal::overloadedMethodBMethodCallback, 0, 1}, 9862 {"overloadedMethodC", TestObjectV8Internal::overloadedMethodCMethodCallback, 0, 1}, 9863 {"overloadedMethodD", TestObjectV8Internal::overloadedMethodDMethodCallback, 0, 1}, 9864 {"overloadedMethodE", TestObjectV8Internal::overloadedMethodEMethodCallback, 0, 1}, 9865 {"overloadedMethodF", TestObjectV8Internal::overloadedMethodFMethodCallback, 0, 0}, 9866 {"overloadedMethodG", TestObjectV8Internal::overloadedMethodGMethodCallback, 0, 0}, 9867 {"overloadedMethodH", TestObjectV8Internal::overloadedMethodHMethodCallback, 0, 1}, 9868 {"overloadedMethodI", TestObjectV8Internal::overloadedMethodIMethodCallback, 0, 1}, 9869 {"overloadedPerWorldBindingsMethod", TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodCallback, TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodCallbackForMainWorld, 0}, 9870 {"voidMethodClampUnsignedShortArg", TestObjectV8Internal::voidMethodClampUnsignedShortArgMethodCallback, 0, 1}, 9871 {"voidMethodClampUnsignedLongArg", TestObjectV8Internal::voidMethodClampUnsignedLongArgMethodCallback, 0, 1}, 9872 {"voidMethodDefaultUndefinedTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback, 0, 0}, 9873 {"voidMethodDefaultUndefinedLongArg", TestObjectV8Internal::voidMethodDefaultUndefinedLongArgMethodCallback, 0, 0}, 9874 {"voidMethodDefaultUndefinedStringArg", TestObjectV8Internal::voidMethodDefaultUndefinedStringArgMethodCallback, 0, 0}, 9875 {"voidMethodEnforceRangeLongArg", TestObjectV8Internal::voidMethodEnforceRangeLongArgMethodCallback, 0, 1}, 9876 {"voidMethodTreatNullAsNullStringStringArg", TestObjectV8Internal::voidMethodTreatNullAsNullStringStringArgMethodCallback, 0, 1}, 9877 {"voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", TestObjectV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethodCallback, 0, 1}, 9878 {"activityLoggingAccessForAllWorldsMethod", TestObjectV8Internal::activityLoggingAccessForAllWorldsMethodMethodCallback, 0, 0}, 9879 {"callWithExecutionContextVoidMethod", TestObjectV8Internal::callWithExecutionContextVoidMethodMethodCallback, 0, 0}, 9880 {"callWithScriptStateVoidMethod", TestObjectV8Internal::callWithScriptStateVoidMethodMethodCallback, 0, 0}, 9881 {"callWithScriptStateLongMethod", TestObjectV8Internal::callWithScriptStateLongMethodMethodCallback, 0, 0}, 9882 {"callWithScriptStateExecutionContextVoidMethod", TestObjectV8Internal::callWithScriptStateExecutionContextVoidMethodMethodCallback, 0, 0}, 9883 {"callWithScriptStateScriptArgumentsVoidMethod", TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodMethodCallback, 0, 0}, 9884 {"callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg", TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethodCallback, 0, 0}, 9885 {"callWithActiveWindow", TestObjectV8Internal::callWithActiveWindowMethodCallback, 0, 0}, 9886 {"callWithActiveWindowScriptWindow", TestObjectV8Internal::callWithActiveWindowScriptWindowMethodCallback, 0, 0}, 9887 {"checkSecurityForNodeVoidMethod", TestObjectV8Internal::checkSecurityForNodeVoidMethodMethodCallback, 0, 0}, 9888 #if ENABLE(CONDITION) 9889 {"conditionalConditionVoidMethod", TestObjectV8Internal::conditionalConditionVoidMethodMethodCallback, 0, 0}, 9890 #endif // ENABLE(CONDITION) 9891 #if ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 9892 {"conditionalCondition1AndCondition2VoidMethod", TestObjectV8Internal::conditionalCondition1AndCondition2VoidMethodMethodCallback, 0, 0}, 9893 #endif // ENABLE(CONDITION_1) && ENABLE(CONDITION_2) 9894 {"customVoidMethod", TestObjectV8Internal::customVoidMethodMethodCallback, 0, 0}, 9895 #if ENABLE(CONDITION) 9896 {"conditionalConditionCustomVoidMethod", TestObjectV8Internal::conditionalConditionCustomVoidMethodMethodCallback, 0, 0}, 9897 #endif // ENABLE(CONDITION) 9898 {"customElementCallbacksVoidMethod", TestObjectV8Internal::customElementCallbacksVoidMethodMethodCallback, 0, 0}, 9899 {"deprecatedVoidMethod", TestObjectV8Internal::deprecatedVoidMethodMethodCallback, 0, 0}, 9900 {"implementedAsVoidMethod", TestObjectV8Internal::implementedAsVoidMethodMethodCallback, 0, 0}, 9901 {"measureAsVoidMethod", TestObjectV8Internal::measureAsVoidMethodMethodCallback, 0, 0}, 9902 {"DeprecateAsOverloadedMethod", TestObjectV8Internal::DeprecateAsOverloadedMethodMethodCallback, 0, 0}, 9903 {"DeprecateAsSameValueOverloadedMethod", TestObjectV8Internal::DeprecateAsSameValueOverloadedMethodMethodCallback, 0, 0}, 9904 {"measureAsOverloadedMethod", TestObjectV8Internal::measureAsOverloadedMethodMethodCallback, 0, 0}, 9905 {"measureAsSameValueOverloadedMethod", TestObjectV8Internal::measureAsSameValueOverloadedMethodMethodCallback, 0, 0}, 9906 {"deprecateAsMeasureAsSameValueOverloadedMethod", TestObjectV8Internal::deprecateAsMeasureAsSameValueOverloadedMethodMethodCallback, 0, 0}, 9907 {"deprecateAsSameValueMeasureAsOverloadedMethod", TestObjectV8Internal::deprecateAsSameValueMeasureAsOverloadedMethodMethodCallback, 0, 0}, 9908 {"deprecateAsSameValueMeasureAsSameValueOverloadedMethod", TestObjectV8Internal::deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethodCallback, 0, 0}, 9909 {"perWorldBindingsVoidMethod", TestObjectV8Internal::perWorldBindingsVoidMethodMethodCallback, TestObjectV8Internal::perWorldBindingsVoidMethodMethodCallbackForMainWorld, 0}, 9910 {"perWorldBindingsVoidMethodTestInterfaceEmptyArg", TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback, TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld, 1}, 9911 {"activityLoggingForAllWorldsPerWorldBindingsVoidMethod", TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback, TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld, 0}, 9912 {"activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallback, TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld, 0}, 9913 {"raisesExceptionVoidMethod", TestObjectV8Internal::raisesExceptionVoidMethodMethodCallback, 0, 0}, 9914 {"raisesExceptionStringMethod", TestObjectV8Internal::raisesExceptionStringMethodMethodCallback, 0, 0}, 9915 {"raisesExceptionVoidMethodOptionalLongArg", TestObjectV8Internal::raisesExceptionVoidMethodOptionalLongArgMethodCallback, 0, 0}, 9916 {"raisesExceptionVoidMethodTestCallbackInterfaceArg", TestObjectV8Internal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback, 0, 1}, 9917 {"raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg", TestObjectV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCallback, 0, 0}, 9918 {"raisesExceptionTestInterfaceEmptyVoidMethod", TestObjectV8Internal::raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback, 0, 0}, 9919 {"callWithExecutionContextRaisesExceptionVoidMethodLongArg", TestObjectV8Internal::callWithExecutionContextRaisesExceptionVoidMethodLongArgMethodCallback, 0, 1}, 9920 {"partiallyRuntimeEnabledOverloadedVoidMethod", TestObjectV8Internal::partiallyRuntimeEnabledOverloadedVoidMethodMethodCallback, 0, 1}, 9921 {"treatReturnedNullStringAsNullStringMethod", TestObjectV8Internal::treatReturnedNullStringAsNullStringMethodMethodCallback, 0, 0}, 9922 {"treatReturnedNullStringAsUndefinedStringMethod", TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringMethodMethodCallback, 0, 0}, 9923 {"treatReturnedNullStringAsNullByteStringMethod", TestObjectV8Internal::treatReturnedNullStringAsNullByteStringMethodMethodCallback, 0, 0}, 9924 {"treatReturnedNullStringAsUndefinedByteStringMethod", TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringMethodMethodCallback, 0, 0}, 9925 {"treatReturnedNullStringAsNullScalarValueStringMethod", TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringMethodMethodCallback, 0, 0}, 9926 {"treatReturnedNullStringAsUndefinedScalarValueStringMethod", TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringMethodMethodCallback, 0, 0}, 9927 {"typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg", TestObjectV8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, 9928 {"typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArg", TestObjectV8Internal::typeCheckingNullableVoidMethodTestInterfaceEmptyOrNullArgMethodCallback, 0, 1}, 9929 {"typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArg", TestObjectV8Internal::typeCheckingInterfaceNullableVoidMethodTestInterfaceEmptyOrNullArgMethodCallback, 0, 1}, 9930 {"typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", TestObjectV8Internal::typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethodCallback, 0, 2}, 9931 {"voidMethodTestInterfaceGarbageCollectedSequenceArg", TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedSequenceArgMethodCallback, 0, 1}, 9932 {"voidMethodTestInterfaceGarbageCollectedArrayArg", TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedArrayArgMethodCallback, 0, 1}, 9933 {"voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg", TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethodCallback, 0, 1}, 9934 {"voidMethodTestInterfaceWillBeGarbageCollectedArrayArg", TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback, 0, 1}, 9935 }; 9936 9937 static void configureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) 9938 { 9939 functionTemplate->ReadOnlyPrototype(); 9940 9941 v8::Local<v8::Signature> defaultSignature; 9942 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestObject", v8::Local<v8::FunctionTemplate>(), V8TestObject::internalFieldCount, 9943 V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes), 9944 V8TestObjectAccessors, WTF_ARRAY_LENGTH(V8TestObjectAccessors), 9945 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), 9946 isolate); 9947 v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate(); 9948 v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate(); 9949 if (RuntimeEnabledFeatures::featureNameEnabled()) { 9950 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ 9951 {"runtimeEnabledLongAttribute", TestObjectV8Internal::runtimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::runtimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; 9952 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); 9953 } 9954 #if ENABLE(CONDITION) 9955 if (RuntimeEnabledFeatures::featureNameEnabled()) { 9956 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ 9957 {"conditionalRuntimeEnabledLongAttribute", TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; 9958 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); 9959 } 9960 #endif // ENABLE(CONDITION) 9961 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = { 9962 {"CONST_VALUE_0", 0}, 9963 {"CONST_VALUE_1", 1}, 9964 {"CONST_VALUE_2", 2}, 9965 {"CONST_VALUE_4", 4}, 9966 {"CONST_VALUE_8", 8}, 9967 {"CONST_VALUE_9", -1}, 9968 {"CONST_VALUE_10", "my constant string"}, 9969 {"CONST_VALUE_11", 0xffffffff}, 9970 {"CONST_VALUE_12", 0x01}, 9971 {"CONST_VALUE_13", 0X20}, 9972 {"CONST_VALUE_14", 0x1abc}, 9973 {"CONST_VALUE_15", 010}, 9974 {"CONST_VALUE_16", -010}, 9975 {"CONST_VALUE_16", -0x1A}, 9976 {"CONST_VALUE_17", -0X1a}, 9977 {"DEPRECATED_CONSTANT", 1}, 9978 {"CONST_JAVASCRIPT", 1}, 9979 }; 9980 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate); 9981 if (RuntimeEnabledFeatures::featureNameEnabled()) { 9982 static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {"FEATURE_ENABLED_CONST", static_cast<signed int>(1)}; 9983 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, &constantConfiguration, 1, isolate); 9984 } 9985 COMPILE_ASSERT(0 == TestObject::CONST_VALUE_0, TheValueOfTestObject_CONST_VALUE_0DoesntMatchWithImplementation); 9986 COMPILE_ASSERT(1 == TestObject::CONST_VALUE_1, TheValueOfTestObject_CONST_VALUE_1DoesntMatchWithImplementation); 9987 COMPILE_ASSERT(2 == TestObject::CONST_VALUE_2, TheValueOfTestObject_CONST_VALUE_2DoesntMatchWithImplementation); 9988 COMPILE_ASSERT(4 == TestObject::CONST_VALUE_4, TheValueOfTestObject_CONST_VALUE_4DoesntMatchWithImplementation); 9989 COMPILE_ASSERT(8 == TestObject::CONST_VALUE_8, TheValueOfTestObject_CONST_VALUE_8DoesntMatchWithImplementation); 9990 COMPILE_ASSERT(-1 == TestObject::CONST_VALUE_9, TheValueOfTestObject_CONST_VALUE_9DoesntMatchWithImplementation); 9991 COMPILE_ASSERT("my constant string" == TestObject::CONST_VALUE_10, TheValueOfTestObject_CONST_VALUE_10DoesntMatchWithImplementation); 9992 COMPILE_ASSERT(0xffffffff == TestObject::CONST_VALUE_11, TheValueOfTestObject_CONST_VALUE_11DoesntMatchWithImplementation); 9993 COMPILE_ASSERT(0x01 == TestObject::CONST_VALUE_12, TheValueOfTestObject_CONST_VALUE_12DoesntMatchWithImplementation); 9994 COMPILE_ASSERT(0X20 == TestObject::CONST_VALUE_13, TheValueOfTestObject_CONST_VALUE_13DoesntMatchWithImplementation); 9995 COMPILE_ASSERT(0x1abc == TestObject::CONST_VALUE_14, TheValueOfTestObject_CONST_VALUE_14DoesntMatchWithImplementation); 9996 COMPILE_ASSERT(010 == TestObject::CONST_VALUE_15, TheValueOfTestObject_CONST_VALUE_15DoesntMatchWithImplementation); 9997 COMPILE_ASSERT(-010 == TestObject::CONST_VALUE_16, TheValueOfTestObject_CONST_VALUE_16DoesntMatchWithImplementation); 9998 COMPILE_ASSERT(-0x1A == TestObject::CONST_VALUE_16, TheValueOfTestObject_CONST_VALUE_16DoesntMatchWithImplementation); 9999 COMPILE_ASSERT(-0X1a == TestObject::CONST_VALUE_17, TheValueOfTestObject_CONST_VALUE_17DoesntMatchWithImplementation); 10000 COMPILE_ASSERT(1 == TestObject::DEPRECATED_CONSTANT, TheValueOfTestObject_DEPRECATED_CONSTANTDoesntMatchWithImplementation); 10001 COMPILE_ASSERT(1 == TestObject::FEATURE_ENABLED_CONST, TheValueOfTestObject_FEATURE_ENABLED_CONSTDoesntMatchWithImplementation); 10002 COMPILE_ASSERT(1 == TestObject::CONST_IMPL, TheValueOfTestObject_CONST_IMPLDoesntMatchWithImplementation); 10003 functionTemplate->Set(v8AtomicString(isolate, "staticVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::staticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); 10004 functionTemplate->Set(v8AtomicString(isolate, "overloadedStaticMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::overloadedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1)); 10005 #if ENABLE(CONDITION) 10006 functionTemplate->Set(v8AtomicString(isolate, "conditionalConditionStaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::conditionalConditionStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); 10007 #endif // ENABLE(CONDITION) 10008 prototypeTemplate->Set(v8AtomicString(isolate, "doNotCheckSignatureVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::doNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); 10009 prototypeTemplate->Set(v8AtomicString(isolate, "notEnumerableVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::notEnumerableVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum)); 10010 prototypeTemplate->Set(v8AtomicString(isolate, "readOnlyVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::readOnlyVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); 10011 prototypeTemplate->Set(v8AtomicString(isolate, "notEnumerableReadOnlyVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::notEnumerableReadOnlyVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly)); 10012 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10013 prototypeTemplate->Set(v8AtomicString(isolate, "runtimeEnabledVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::runtimeEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)); 10014 } 10015 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10016 if (DOMWrapperWorld::current(isolate).isMainWorld()) { 10017 prototypeTemplate->Set(v8AtomicString(isolate, "perWorldBindingsRuntimeEnabledVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodCallbackForMainWorld, v8Undefined(), defaultSignature, 0)); 10018 } else { 10019 prototypeTemplate->Set(v8AtomicString(isolate, "perWorldBindingsRuntimeEnabledVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)); 10020 } 10021 } 10022 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10023 prototypeTemplate->Set(v8AtomicString(isolate, "runtimeEnabledOverloadedVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::runtimeEnabledOverloadedVoidMethodMethodCallback, v8Undefined(), defaultSignature, 1)); 10024 } 10025 instanceTemplate->Set(v8AtomicString(isolate, "unforgeableVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::unforgeableVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)); 10026 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStringAttribute"), TestObjectV8Internal::staticStringAttributeAttributeGetterCallback, TestObjectV8Internal::staticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 10027 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticLongAttribute"), TestObjectV8Internal::staticLongAttributeAttributeGetterCallback, TestObjectV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); 10028 10029 // Custom toString template 10030 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate()); 10031 } 10032 10033 v8::Handle<v8::FunctionTemplate> V8TestObject::domTemplate(v8::Isolate* isolate) 10034 { 10035 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), configureV8TestObjectTemplate); 10036 } 10037 10038 bool V8TestObject::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) 10039 { 10040 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); 10041 } 10042 10043 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) 10044 { 10045 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); 10046 } 10047 10048 TestObject* V8TestObject::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) 10049 { 10050 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; 10051 } 10052 10053 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, TestObject* impl, v8::Isolate* isolate) 10054 { 10055 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instanceTemplate->GetPrototype()); 10056 if (ContextFeatures::featureNameEnabled(impl->document())) { 10057 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ 10058 {"perContextEnabledLongAttribute", TestObjectV8Internal::perContextEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; 10059 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); 10060 } 10061 if (ContextFeatures::featureNameEnabled(impl->document())) { 10062 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ 10063 {"perContextEnabledRuntimeEnabledLongAttribute", TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; 10064 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); 10065 } 10066 } 10067 10068 void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate) 10069 { 10070 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate)); 10071 10072 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext()); 10073 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) 10074 prototypeTemplate->Set(v8AtomicString(isolate, "perContextEnabledVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); 10075 } 10076 10077 v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 10078 { 10079 ASSERT(impl); 10080 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate)); 10081 return V8TestObject::createWrapper(impl, creationContext, isolate); 10082 } 10083 10084 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 10085 { 10086 ASSERT(impl); 10087 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate)); 10088 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 10089 const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get())->typeInfo(); 10090 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have 10091 // the same object de-ref functions, though, so use that as the basis of the check. 10092 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction); 10093 } 10094 10095 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); 10096 if (UNLIKELY(wrapper.IsEmpty())) 10097 return wrapper; 10098 10099 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 10100 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); 10101 return wrapper; 10102 } 10103 10104 void V8TestObject::derefObject(void* object) 10105 { 10106 fromInternalPointer(object)->deref(); 10107 } 10108 10109 template<> 10110 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 10111 { 10112 return toV8(impl, creationContext, isolate); 10113 } 10114 10115 } // namespace WebCore 10116