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 "bindings/core/v8/BindingSecurity.h" 11 #include "bindings/core/v8/Dictionary.h" 12 #include "bindings/core/v8/ExceptionState.h" 13 #include "bindings/core/v8/PrivateScriptRunner.h" 14 #include "bindings/core/v8/ScriptCallStackFactory.h" 15 #include "bindings/core/v8/ScriptPromise.h" 16 #include "bindings/core/v8/ScriptState.h" 17 #include "bindings/core/v8/ScriptValue.h" 18 #include "bindings/core/v8/SerializedScriptValue.h" 19 #include "bindings/core/v8/V8AbstractEventListener.h" 20 #include "bindings/core/v8/V8Attr.h" 21 #include "bindings/core/v8/V8DOMActivityLogger.h" 22 #include "bindings/core/v8/V8DOMConfiguration.h" 23 #include "bindings/core/v8/V8Document.h" 24 #include "bindings/core/v8/V8DocumentFragment.h" 25 #include "bindings/core/v8/V8DocumentType.h" 26 #include "bindings/core/v8/V8Element.h" 27 #include "bindings/core/v8/V8EventListenerList.h" 28 #include "bindings/core/v8/V8EventTarget.h" 29 #include "bindings/core/v8/V8HTMLCollection.h" 30 #include "bindings/core/v8/V8HTMLElement.h" 31 #include "bindings/core/v8/V8HiddenValue.h" 32 #include "bindings/core/v8/V8Node.h" 33 #include "bindings/core/v8/V8NodeFilter.h" 34 #include "bindings/core/v8/V8ObjectConstructor.h" 35 #include "bindings/core/v8/V8ShadowRoot.h" 36 #include "bindings/core/v8/V8TestCallbackInterface.h" 37 #include "bindings/core/v8/V8TestDictionary.h" 38 #include "bindings/core/v8/V8TestInterface.h" 39 #include "bindings/core/v8/V8TestInterfaceEmpty.h" 40 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h" 41 #include "bindings/core/v8/V8TestInterfaceWillBeGarbageCollected.h" 42 #include "bindings/core/v8/V8TestNode.h" 43 #include "bindings/core/v8/V8TestObject.h" 44 #include "bindings/core/v8/V8Window.h" 45 #include "bindings/core/v8/V8XPathNSResolver.h" 46 #include "bindings/core/v8/custom/V8ArrayBufferCustom.h" 47 #include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h" 48 #include "bindings/core/v8/custom/V8Float32ArrayCustom.h" 49 #include "bindings/core/v8/custom/V8Int32ArrayCustom.h" 50 #include "bindings/core/v8/custom/V8Uint8ArrayCustom.h" 51 #include "core/HTMLNames.h" 52 #include "core/dom/ClassCollection.h" 53 #include "core/dom/ContextFeatures.h" 54 #include "core/dom/Document.h" 55 #include "core/dom/TagCollection.h" 56 #include "core/dom/custom/CustomElementProcessingStack.h" 57 #include "core/frame/LocalFrame.h" 58 #include "core/frame/UseCounter.h" 59 #include "core/html/HTMLCollection.h" 60 #include "core/html/HTMLDataListOptionsCollection.h" 61 #include "core/html/HTMLFormControlsCollection.h" 62 #include "core/html/HTMLTableRowsCollection.h" 63 #include "core/inspector/ScriptArguments.h" 64 #include "platform/RuntimeEnabledFeatures.h" 65 #include "platform/ScriptForbiddenScope.h" 66 #include "platform/TraceEvent.h" 67 #include "wtf/GetPtr.h" 68 #include "wtf/RefPtr.h" 69 70 namespace blink { 71 72 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::domTemplate, V8TestObject::refObject, V8TestObject::derefObject, V8TestObject::createPersistentHandle, 0, 0, 0, V8TestObject::installConditionallyEnabledMethods, V8TestObject::installConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject }; 73 74 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestObject.h. 75 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 76 // bindings/core/v8/ScriptWrappable.h. 77 const WrapperTypeInfo& TestObject::s_wrapperTypeInfo = V8TestObject::wrapperTypeInfo; 78 79 namespace TestObjectV8Internal { 80 81 template <typename T> void V8_USE(T) { } 82 83 static void DEPRECATED_CONSTANTConstantGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 84 { 85 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 86 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::Constant); 87 v8SetReturnValueInt(info, 1); 88 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 89 } 90 91 static void MEASURED_CONSTANTConstantGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 92 { 93 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 94 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::Constant); 95 v8SetReturnValueInt(info, 1); 96 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 97 } 98 99 static void stringifierAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 100 { 101 v8::Handle<v8::Object> holder = info.Holder(); 102 TestObject* impl = V8TestObject::toImpl(holder); 103 v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate()); 104 } 105 106 static void stringifierAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 107 { 108 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 109 TestObjectV8Internal::stringifierAttributeAttributeGetter(info); 110 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 111 } 112 113 static void stringifierAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 114 { 115 v8::Handle<v8::Object> holder = info.Holder(); 116 TestObject* impl = V8TestObject::toImpl(holder); 117 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 118 impl->setStringifierAttribute(cppValue); 119 } 120 121 static void stringifierAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 122 { 123 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 124 TestObjectV8Internal::stringifierAttributeAttributeSetter(v8Value, info); 125 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 126 } 127 128 static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 129 { 130 v8::Handle<v8::Object> holder = info.Holder(); 131 TestObject* impl = V8TestObject::toImpl(holder); 132 v8SetReturnValueString(info, impl->readonlyStringAttribute(), info.GetIsolate()); 133 } 134 135 static void readonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 136 { 137 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 138 TestObjectV8Internal::readonlyStringAttributeAttributeGetter(info); 139 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 140 } 141 142 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 143 { 144 v8::Handle<v8::Object> holder = info.Holder(); 145 TestObject* impl = V8TestObject::toImpl(holder); 146 RefPtr<TestInterfaceEmpty> cppValue(impl->readonlyTestInterfaceEmptyAttribute()); 147 if (cppValue && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEmpty>(info.GetReturnValue(), cppValue.get())) 148 return; 149 v8::Handle<v8::Value> wrapper = toV8(cppValue.get(), holder, info.GetIsolate()); 150 if (!wrapper.IsEmpty()) { 151 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "readonlyTestInterfaceEmptyAttribute"), wrapper); 152 v8SetReturnValue(info, wrapper); 153 } 154 } 155 156 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 157 { 158 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 159 TestObjectV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGetter(info); 160 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 161 } 162 163 static void readonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 164 { 165 v8::Handle<v8::Object> holder = info.Holder(); 166 TestObject* impl = V8TestObject::toImpl(holder); 167 v8SetReturnValueInt(info, impl->readonlyLongAttribute()); 168 } 169 170 static void readonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 171 { 172 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 173 TestObjectV8Internal::readonlyLongAttributeAttributeGetter(info); 174 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 175 } 176 177 static void dateAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 178 { 179 v8::Handle<v8::Object> holder = info.Holder(); 180 TestObject* impl = V8TestObject::toImpl(holder); 181 v8SetReturnValue(info, v8DateOrNaN(impl->dateAttribute(), info.GetIsolate())); 182 } 183 184 static void dateAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 185 { 186 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 187 TestObjectV8Internal::dateAttributeAttributeGetter(info); 188 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 189 } 190 191 static void dateAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 192 { 193 v8::Handle<v8::Object> holder = info.Holder(); 194 TestObject* impl = V8TestObject::toImpl(holder); 195 double cppValue = toCoreDate(v8Value); 196 impl->setDateAttribute(cppValue); 197 } 198 199 static void dateAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 200 { 201 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 202 TestObjectV8Internal::dateAttributeAttributeSetter(v8Value, info); 203 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 204 } 205 206 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 207 { 208 v8::Handle<v8::Object> holder = info.Holder(); 209 TestObject* impl = V8TestObject::toImpl(holder); 210 v8SetReturnValueString(info, impl->stringAttribute(), info.GetIsolate()); 211 } 212 213 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 214 { 215 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 216 TestObjectV8Internal::stringAttributeAttributeGetter(info); 217 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 218 } 219 220 static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 221 { 222 v8::Handle<v8::Object> holder = info.Holder(); 223 TestObject* impl = V8TestObject::toImpl(holder); 224 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 225 impl->setStringAttribute(cppValue); 226 } 227 228 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 229 { 230 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 231 TestObjectV8Internal::stringAttributeAttributeSetter(v8Value, info); 232 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 233 } 234 235 static void byteStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 236 { 237 v8::Handle<v8::Object> holder = info.Holder(); 238 TestObject* impl = V8TestObject::toImpl(holder); 239 v8SetReturnValueString(info, impl->byteStringAttribute(), info.GetIsolate()); 240 } 241 242 static void byteStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 243 { 244 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 245 TestObjectV8Internal::byteStringAttributeAttributeGetter(info); 246 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 247 } 248 249 static void byteStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 250 { 251 v8::Handle<v8::Object> holder = info.Holder(); 252 ExceptionState exceptionState(ExceptionState::SetterContext, "byteStringAttribute", "TestObject", holder, info.GetIsolate()); 253 TestObject* impl = V8TestObject::toImpl(holder); 254 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toByteString(v8Value, exceptionState), exceptionState); 255 impl->setByteStringAttribute(cppValue); 256 } 257 258 static void byteStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 259 { 260 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 261 TestObjectV8Internal::byteStringAttributeAttributeSetter(v8Value, info); 262 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 263 } 264 265 static void scalarValueStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 266 { 267 v8::Handle<v8::Object> holder = info.Holder(); 268 TestObject* impl = V8TestObject::toImpl(holder); 269 v8SetReturnValueString(info, impl->scalarValueStringAttribute(), info.GetIsolate()); 270 } 271 272 static void scalarValueStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 273 { 274 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 275 TestObjectV8Internal::scalarValueStringAttributeAttributeGetter(info); 276 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 277 } 278 279 static void scalarValueStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 280 { 281 v8::Handle<v8::Object> holder = info.Holder(); 282 ExceptionState exceptionState(ExceptionState::SetterContext, "scalarValueStringAttribute", "TestObject", holder, info.GetIsolate()); 283 TestObject* impl = V8TestObject::toImpl(holder); 284 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toScalarValueString(v8Value, exceptionState), exceptionState); 285 impl->setScalarValueStringAttribute(cppValue); 286 } 287 288 static void scalarValueStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 289 { 290 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 291 TestObjectV8Internal::scalarValueStringAttributeAttributeSetter(v8Value, info); 292 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 293 } 294 295 static void domTimeStampAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 296 { 297 v8::Handle<v8::Object> holder = info.Holder(); 298 TestObject* impl = V8TestObject::toImpl(holder); 299 v8SetReturnValue(info, static_cast<double>(impl->domTimeStampAttribute())); 300 } 301 302 static void domTimeStampAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 303 { 304 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 305 TestObjectV8Internal::domTimeStampAttributeAttributeGetter(info); 306 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 307 } 308 309 static void domTimeStampAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 310 { 311 v8::Handle<v8::Object> holder = info.Holder(); 312 ExceptionState exceptionState(ExceptionState::SetterContext, "domTimeStampAttribute", "TestObject", holder, info.GetIsolate()); 313 TestObject* impl = V8TestObject::toImpl(holder); 314 TONATIVE_VOID_EXCEPTIONSTATE(unsigned long long, cppValue, toUInt64(v8Value, exceptionState), exceptionState); 315 impl->setDomTimeStampAttribute(cppValue); 316 } 317 318 static void domTimeStampAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 319 { 320 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 321 TestObjectV8Internal::domTimeStampAttributeAttributeSetter(v8Value, info); 322 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 323 } 324 325 static void booleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 326 { 327 v8::Handle<v8::Object> holder = info.Holder(); 328 TestObject* impl = V8TestObject::toImpl(holder); 329 v8SetReturnValueBool(info, impl->booleanAttribute()); 330 } 331 332 static void booleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 333 { 334 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 335 TestObjectV8Internal::booleanAttributeAttributeGetter(info); 336 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 337 } 338 339 static void booleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 340 { 341 v8::Handle<v8::Object> holder = info.Holder(); 342 TestObject* impl = V8TestObject::toImpl(holder); 343 bool cppValue = v8Value->BooleanValue(); 344 impl->setBooleanAttribute(cppValue); 345 } 346 347 static void booleanAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 348 { 349 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 350 TestObjectV8Internal::booleanAttributeAttributeSetter(v8Value, info); 351 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 352 } 353 354 static void byteAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 355 { 356 v8::Handle<v8::Object> holder = info.Holder(); 357 TestObject* impl = V8TestObject::toImpl(holder); 358 v8SetReturnValueInt(info, impl->byteAttribute()); 359 } 360 361 static void byteAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 362 { 363 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 364 TestObjectV8Internal::byteAttributeAttributeGetter(info); 365 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 366 } 367 368 static void byteAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 369 { 370 v8::Handle<v8::Object> holder = info.Holder(); 371 ExceptionState exceptionState(ExceptionState::SetterContext, "byteAttribute", "TestObject", holder, info.GetIsolate()); 372 TestObject* impl = V8TestObject::toImpl(holder); 373 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt8(v8Value, exceptionState), exceptionState); 374 impl->setByteAttribute(cppValue); 375 } 376 377 static void byteAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 378 { 379 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 380 TestObjectV8Internal::byteAttributeAttributeSetter(v8Value, info); 381 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 382 } 383 384 static void doubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 385 { 386 v8::Handle<v8::Object> holder = info.Holder(); 387 TestObject* impl = V8TestObject::toImpl(holder); 388 v8SetReturnValue(info, impl->doubleAttribute()); 389 } 390 391 static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 392 { 393 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 394 TestObjectV8Internal::doubleAttributeAttributeGetter(info); 395 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 396 } 397 398 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 399 { 400 v8::Handle<v8::Object> holder = info.Holder(); 401 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestObject", holder, info.GetIsolate()); 402 TestObject* impl = V8TestObject::toImpl(holder); 403 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toDouble(v8Value, exceptionState), exceptionState); 404 impl->setDoubleAttribute(cppValue); 405 } 406 407 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 408 { 409 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 410 TestObjectV8Internal::doubleAttributeAttributeSetter(v8Value, info); 411 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 412 } 413 414 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 415 { 416 v8::Handle<v8::Object> holder = info.Holder(); 417 TestObject* impl = V8TestObject::toImpl(holder); 418 v8SetReturnValue(info, impl->floatAttribute()); 419 } 420 421 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 422 { 423 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 424 TestObjectV8Internal::floatAttributeAttributeGetter(info); 425 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 426 } 427 428 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 429 { 430 v8::Handle<v8::Object> holder = info.Holder(); 431 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute", "TestObject", holder, info.GetIsolate()); 432 TestObject* impl = V8TestObject::toImpl(holder); 433 TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toFloat(v8Value, exceptionState), exceptionState); 434 impl->setFloatAttribute(cppValue); 435 } 436 437 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 438 { 439 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 440 TestObjectV8Internal::floatAttributeAttributeSetter(v8Value, info); 441 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 442 } 443 444 static void longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 445 { 446 v8::Handle<v8::Object> holder = info.Holder(); 447 TestObject* impl = V8TestObject::toImpl(holder); 448 v8SetReturnValueInt(info, impl->longAttribute()); 449 } 450 451 static void longAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 452 { 453 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 454 TestObjectV8Internal::longAttributeAttributeGetter(info); 455 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 456 } 457 458 static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 459 { 460 v8::Handle<v8::Object> holder = info.Holder(); 461 ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute", "TestObject", holder, info.GetIsolate()); 462 TestObject* impl = V8TestObject::toImpl(holder); 463 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 464 impl->setLongAttribute(cppValue); 465 } 466 467 static void longAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 468 { 469 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 470 TestObjectV8Internal::longAttributeAttributeSetter(v8Value, info); 471 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 472 } 473 474 static void longLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 475 { 476 v8::Handle<v8::Object> holder = info.Holder(); 477 TestObject* impl = V8TestObject::toImpl(holder); 478 v8SetReturnValue(info, static_cast<double>(impl->longLongAttribute())); 479 } 480 481 static void longLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 482 { 483 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 484 TestObjectV8Internal::longLongAttributeAttributeGetter(info); 485 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 486 } 487 488 static void longLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 489 { 490 v8::Handle<v8::Object> holder = info.Holder(); 491 ExceptionState exceptionState(ExceptionState::SetterContext, "longLongAttribute", "TestObject", holder, info.GetIsolate()); 492 TestObject* impl = V8TestObject::toImpl(holder); 493 TONATIVE_VOID_EXCEPTIONSTATE(long long, cppValue, toInt64(v8Value, exceptionState), exceptionState); 494 impl->setLongLongAttribute(cppValue); 495 } 496 497 static void longLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 498 { 499 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 500 TestObjectV8Internal::longLongAttributeAttributeSetter(v8Value, info); 501 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 502 } 503 504 static void octetAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 505 { 506 v8::Handle<v8::Object> holder = info.Holder(); 507 TestObject* impl = V8TestObject::toImpl(holder); 508 v8SetReturnValueUnsigned(info, impl->octetAttribute()); 509 } 510 511 static void octetAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 512 { 513 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 514 TestObjectV8Internal::octetAttributeAttributeGetter(info); 515 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 516 } 517 518 static void octetAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 519 { 520 v8::Handle<v8::Object> holder = info.Holder(); 521 ExceptionState exceptionState(ExceptionState::SetterContext, "octetAttribute", "TestObject", holder, info.GetIsolate()); 522 TestObject* impl = V8TestObject::toImpl(holder); 523 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt8(v8Value, exceptionState), exceptionState); 524 impl->setOctetAttribute(cppValue); 525 } 526 527 static void octetAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 528 { 529 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 530 TestObjectV8Internal::octetAttributeAttributeSetter(v8Value, info); 531 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 532 } 533 534 static void shortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 535 { 536 v8::Handle<v8::Object> holder = info.Holder(); 537 TestObject* impl = V8TestObject::toImpl(holder); 538 v8SetReturnValueInt(info, impl->shortAttribute()); 539 } 540 541 static void shortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 542 { 543 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 544 TestObjectV8Internal::shortAttributeAttributeGetter(info); 545 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 546 } 547 548 static void shortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 549 { 550 v8::Handle<v8::Object> holder = info.Holder(); 551 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute", "TestObject", holder, info.GetIsolate()); 552 TestObject* impl = V8TestObject::toImpl(holder); 553 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState); 554 impl->setShortAttribute(cppValue); 555 } 556 557 static void shortAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 558 { 559 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 560 TestObjectV8Internal::shortAttributeAttributeSetter(v8Value, info); 561 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 562 } 563 564 static void unrestrictedDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 565 { 566 v8::Handle<v8::Object> holder = info.Holder(); 567 TestObject* impl = V8TestObject::toImpl(holder); 568 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); 569 } 570 571 static void unrestrictedDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 572 { 573 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 574 TestObjectV8Internal::unrestrictedDoubleAttributeAttributeGetter(info); 575 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 576 } 577 578 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 579 { 580 v8::Handle<v8::Object> holder = info.Holder(); 581 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedDoubleAttribute", "TestObject", holder, info.GetIsolate()); 582 TestObject* impl = V8TestObject::toImpl(holder); 583 TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toDouble(v8Value, exceptionState), exceptionState); 584 impl->setUnrestrictedDoubleAttribute(cppValue); 585 } 586 587 static void unrestrictedDoubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 588 { 589 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 590 TestObjectV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, info); 591 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 592 } 593 594 static void unrestrictedFloatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 595 { 596 v8::Handle<v8::Object> holder = info.Holder(); 597 TestObject* impl = V8TestObject::toImpl(holder); 598 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); 599 } 600 601 static void unrestrictedFloatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 602 { 603 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 604 TestObjectV8Internal::unrestrictedFloatAttributeAttributeGetter(info); 605 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 606 } 607 608 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 609 { 610 v8::Handle<v8::Object> holder = info.Holder(); 611 ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedFloatAttribute", "TestObject", holder, info.GetIsolate()); 612 TestObject* impl = V8TestObject::toImpl(holder); 613 TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toFloat(v8Value, exceptionState), exceptionState); 614 impl->setUnrestrictedFloatAttribute(cppValue); 615 } 616 617 static void unrestrictedFloatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 618 { 619 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 620 TestObjectV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, info); 621 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 622 } 623 624 static void unsignedLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 625 { 626 v8::Handle<v8::Object> holder = info.Holder(); 627 TestObject* impl = V8TestObject::toImpl(holder); 628 v8SetReturnValueUnsigned(info, impl->unsignedLongAttribute()); 629 } 630 631 static void unsignedLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 632 { 633 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 634 TestObjectV8Internal::unsignedLongAttributeAttributeGetter(info); 635 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 636 } 637 638 static void unsignedLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 639 { 640 v8::Handle<v8::Object> holder = info.Holder(); 641 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongAttribute", "TestObject", holder, info.GetIsolate()); 642 TestObject* impl = V8TestObject::toImpl(holder); 643 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt32(v8Value, exceptionState), exceptionState); 644 impl->setUnsignedLongAttribute(cppValue); 645 } 646 647 static void unsignedLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 648 { 649 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 650 TestObjectV8Internal::unsignedLongAttributeAttributeSetter(v8Value, info); 651 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 652 } 653 654 static void unsignedLongLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 655 { 656 v8::Handle<v8::Object> holder = info.Holder(); 657 TestObject* impl = V8TestObject::toImpl(holder); 658 v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongAttribute())); 659 } 660 661 static void unsignedLongLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 662 { 663 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 664 TestObjectV8Internal::unsignedLongLongAttributeAttributeGetter(info); 665 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 666 } 667 668 static void unsignedLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 669 { 670 v8::Handle<v8::Object> holder = info.Holder(); 671 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLongAttribute", "TestObject", holder, info.GetIsolate()); 672 TestObject* impl = V8TestObject::toImpl(holder); 673 TONATIVE_VOID_EXCEPTIONSTATE(unsigned long long, cppValue, toUInt64(v8Value, exceptionState), exceptionState); 674 impl->setUnsignedLongLongAttribute(cppValue); 675 } 676 677 static void unsignedLongLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 678 { 679 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 680 TestObjectV8Internal::unsignedLongLongAttributeAttributeSetter(v8Value, info); 681 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 682 } 683 684 static void unsignedShortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 685 { 686 v8::Handle<v8::Object> holder = info.Holder(); 687 TestObject* impl = V8TestObject::toImpl(holder); 688 v8SetReturnValueUnsigned(info, impl->unsignedShortAttribute()); 689 } 690 691 static void unsignedShortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 692 { 693 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 694 TestObjectV8Internal::unsignedShortAttributeAttributeGetter(info); 695 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 696 } 697 698 static void unsignedShortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 699 { 700 v8::Handle<v8::Object> holder = info.Holder(); 701 ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedShortAttribute", "TestObject", holder, info.GetIsolate()); 702 TestObject* impl = V8TestObject::toImpl(holder); 703 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt16(v8Value, exceptionState), exceptionState); 704 impl->setUnsignedShortAttribute(cppValue); 705 } 706 707 static void unsignedShortAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 708 { 709 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 710 TestObjectV8Internal::unsignedShortAttributeAttributeSetter(v8Value, info); 711 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 712 } 713 714 static void testInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 715 { 716 v8::Handle<v8::Object> holder = info.Holder(); 717 TestObject* impl = V8TestObject::toImpl(holder); 718 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceEmptyAttribute()), impl); 719 } 720 721 static void testInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 722 { 723 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 724 TestObjectV8Internal::testInterfaceEmptyAttributeAttributeGetter(info); 725 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 726 } 727 728 static void testInterfaceEmptyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 729 { 730 v8::Handle<v8::Object> holder = info.Holder(); 731 TestObject* impl = V8TestObject::toImpl(holder); 732 TestInterfaceEmpty* cppValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value); 733 impl->setTestInterfaceEmptyAttribute(WTF::getPtr(cppValue)); 734 } 735 736 static void testInterfaceEmptyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 737 { 738 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 739 TestObjectV8Internal::testInterfaceEmptyAttributeAttributeSetter(v8Value, info); 740 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 741 } 742 743 static void testObjectAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 744 { 745 v8::Handle<v8::Object> holder = info.Holder(); 746 TestObject* impl = V8TestObject::toImpl(holder); 747 v8SetReturnValueFast(info, WTF::getPtr(impl->testObjectAttribute()), impl); 748 } 749 750 static void testObjectAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 751 { 752 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 753 TestObjectV8Internal::testObjectAttributeAttributeGetter(info); 754 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 755 } 756 757 static void testObjectAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 758 { 759 v8::Handle<v8::Object> holder = info.Holder(); 760 TestObject* impl = V8TestObject::toImpl(holder); 761 TestObject* cppValue = V8TestObject::toImplWithTypeCheck(info.GetIsolate(), v8Value); 762 impl->setTestObjectAttribute(WTF::getPtr(cppValue)); 763 } 764 765 static void testObjectAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 766 { 767 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 768 TestObjectV8Internal::testObjectAttributeAttributeSetter(v8Value, info); 769 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 770 } 771 772 static void voidCallbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 773 { 774 v8::Handle<v8::Object> holder = info.Holder(); 775 TestObject* impl = V8TestObject::toImpl(holder); 776 v8SetReturnValue(info, impl->voidCallbackFunctionAttribute().v8Value()); 777 } 778 779 static void voidCallbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 780 { 781 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 782 TestObjectV8Internal::voidCallbackFunctionAttributeAttributeGetter(info); 783 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 784 } 785 786 static void voidCallbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 787 { 788 v8::Handle<v8::Object> holder = info.Holder(); 789 TestObject* impl = V8TestObject::toImpl(holder); 790 ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value); 791 impl->setVoidCallbackFunctionAttribute(cppValue); 792 } 793 794 static void voidCallbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 795 { 796 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 797 TestObjectV8Internal::voidCallbackFunctionAttributeAttributeSetter(v8Value, info); 798 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 799 } 800 801 static void anyCallbackFunctionOptionalAnyArgAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 802 { 803 v8::Handle<v8::Object> holder = info.Holder(); 804 TestObject* impl = V8TestObject::toImpl(holder); 805 v8SetReturnValue(info, impl->anyCallbackFunctionOptionalAnyArgAttribute().v8Value()); 806 } 807 808 static void anyCallbackFunctionOptionalAnyArgAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 809 { 810 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 811 TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeGetter(info); 812 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 813 } 814 815 static void anyCallbackFunctionOptionalAnyArgAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 816 { 817 v8::Handle<v8::Object> holder = info.Holder(); 818 TestObject* impl = V8TestObject::toImpl(holder); 819 ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value); 820 impl->setAnyCallbackFunctionOptionalAnyArgAttribute(cppValue); 821 } 822 823 static void anyCallbackFunctionOptionalAnyArgAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 824 { 825 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 826 TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeSetter(v8Value, info); 827 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 828 } 829 830 static void cssAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 831 { 832 v8::Handle<v8::Object> holder = info.Holder(); 833 TestObject* impl = V8TestObject::toImpl(holder); 834 v8SetReturnValueInt(info, impl->cssAttribute()); 835 } 836 837 static void cssAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 838 { 839 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 840 TestObjectV8Internal::cssAttributeAttributeGetter(info); 841 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 842 } 843 844 static void cssAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 845 { 846 v8::Handle<v8::Object> holder = info.Holder(); 847 ExceptionState exceptionState(ExceptionState::SetterContext, "cssAttribute", "TestObject", holder, info.GetIsolate()); 848 TestObject* impl = V8TestObject::toImpl(holder); 849 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 850 impl->setCSSAttribute(cppValue); 851 } 852 853 static void cssAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 854 { 855 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 856 TestObjectV8Internal::cssAttributeAttributeSetter(v8Value, info); 857 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 858 } 859 860 static void imeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 861 { 862 v8::Handle<v8::Object> holder = info.Holder(); 863 TestObject* impl = V8TestObject::toImpl(holder); 864 v8SetReturnValueInt(info, impl->imeAttribute()); 865 } 866 867 static void imeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 868 { 869 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 870 TestObjectV8Internal::imeAttributeAttributeGetter(info); 871 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 872 } 873 874 static void imeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 875 { 876 v8::Handle<v8::Object> holder = info.Holder(); 877 ExceptionState exceptionState(ExceptionState::SetterContext, "imeAttribute", "TestObject", holder, info.GetIsolate()); 878 TestObject* impl = V8TestObject::toImpl(holder); 879 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 880 impl->setIMEAttribute(cppValue); 881 } 882 883 static void imeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 884 { 885 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 886 TestObjectV8Internal::imeAttributeAttributeSetter(v8Value, info); 887 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 888 } 889 890 static void svgAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 891 { 892 v8::Handle<v8::Object> holder = info.Holder(); 893 TestObject* impl = V8TestObject::toImpl(holder); 894 v8SetReturnValueInt(info, impl->svgAttribute()); 895 } 896 897 static void svgAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 898 { 899 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 900 TestObjectV8Internal::svgAttributeAttributeGetter(info); 901 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 902 } 903 904 static void svgAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 905 { 906 v8::Handle<v8::Object> holder = info.Holder(); 907 ExceptionState exceptionState(ExceptionState::SetterContext, "svgAttribute", "TestObject", holder, info.GetIsolate()); 908 TestObject* impl = V8TestObject::toImpl(holder); 909 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 910 impl->setSVGAttribute(cppValue); 911 } 912 913 static void svgAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 914 { 915 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 916 TestObjectV8Internal::svgAttributeAttributeSetter(v8Value, info); 917 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 918 } 919 920 static void xmlAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 921 { 922 v8::Handle<v8::Object> holder = info.Holder(); 923 TestObject* impl = V8TestObject::toImpl(holder); 924 v8SetReturnValueInt(info, impl->xmlAttribute()); 925 } 926 927 static void xmlAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 928 { 929 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 930 TestObjectV8Internal::xmlAttributeAttributeGetter(info); 931 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 932 } 933 934 static void xmlAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 935 { 936 v8::Handle<v8::Object> holder = info.Holder(); 937 ExceptionState exceptionState(ExceptionState::SetterContext, "xmlAttribute", "TestObject", holder, info.GetIsolate()); 938 TestObject* impl = V8TestObject::toImpl(holder); 939 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 940 impl->setXMLAttribute(cppValue); 941 } 942 943 static void xmlAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 944 { 945 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 946 TestObjectV8Internal::xmlAttributeAttributeSetter(v8Value, info); 947 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 948 } 949 950 static void nodeFilterAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 951 { 952 v8::Handle<v8::Object> holder = info.Holder(); 953 TestObject* impl = V8TestObject::toImpl(holder); 954 v8SetReturnValueFast(info, WTF::getPtr(impl->nodeFilterAttribute()), impl); 955 } 956 957 static void nodeFilterAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 958 { 959 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 960 TestObjectV8Internal::nodeFilterAttributeAttributeGetter(info); 961 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 962 } 963 964 static void nodeFilterAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 965 { 966 v8::Handle<v8::Object> holder = info.Holder(); 967 TestObject* impl = V8TestObject::toImpl(holder); 968 RefPtrWillBeRawPtr<NodeFilter> cppValue = toNodeFilter(v8Value, info.Holder(), ScriptState::current(info.GetIsolate())); 969 impl->setNodeFilterAttribute(WTF::getPtr(cppValue)); 970 } 971 972 static void nodeFilterAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 973 { 974 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 975 TestObjectV8Internal::nodeFilterAttributeAttributeSetter(v8Value, info); 976 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 977 } 978 979 static void serializedScriptValueAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 980 { 981 v8::Handle<v8::Object> holder = info.Holder(); 982 TestObject* impl = V8TestObject::toImpl(holder); 983 v8SetReturnValue(info, impl->serializedScriptValueAttribute() ? impl->serializedScriptValueAttribute()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()))); 984 } 985 986 static void serializedScriptValueAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 987 { 988 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 989 TestObjectV8Internal::serializedScriptValueAttributeAttributeGetter(info); 990 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 991 } 992 993 static void serializedScriptValueAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 994 { 995 v8::Handle<v8::Object> holder = info.Holder(); 996 ExceptionState exceptionState(ExceptionState::SetterContext, "serializedScriptValueAttribute", "TestObject", holder, info.GetIsolate()); 997 TestObject* impl = V8TestObject::toImpl(holder); 998 TONATIVE_VOID_EXCEPTIONSTATE(RefPtr<SerializedScriptValue>, cppValue, SerializedScriptValue::create(v8Value, 0, 0, exceptionState, info.GetIsolate()), exceptionState); 999 impl->setSerializedScriptValueAttribute(WTF::getPtr(cppValue)); 1000 } 1001 1002 static void serializedScriptValueAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1003 { 1004 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1005 TestObjectV8Internal::serializedScriptValueAttributeAttributeSetter(v8Value, info); 1006 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1007 } 1008 1009 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1010 { 1011 v8::Handle<v8::Object> holder = info.Holder(); 1012 TestObject* impl = V8TestObject::toImpl(holder); 1013 v8SetReturnValue(info, impl->anyAttribute().v8Value()); 1014 } 1015 1016 static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1017 { 1018 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1019 TestObjectV8Internal::anyAttributeAttributeGetter(info); 1020 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1021 } 1022 1023 static void anyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1024 { 1025 v8::Handle<v8::Object> holder = info.Holder(); 1026 TestObject* impl = V8TestObject::toImpl(holder); 1027 ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value); 1028 impl->setAnyAttribute(cppValue); 1029 } 1030 1031 static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1032 { 1033 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1034 TestObjectV8Internal::anyAttributeAttributeSetter(v8Value, info); 1035 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1036 } 1037 1038 static void promiseAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1039 { 1040 v8::Handle<v8::Object> holder = info.Holder(); 1041 TestObject* impl = V8TestObject::toImpl(holder); 1042 v8SetReturnValue(info, impl->promiseAttribute().v8Value()); 1043 } 1044 1045 static void promiseAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1046 { 1047 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1048 TestObjectV8Internal::promiseAttributeAttributeGetter(info); 1049 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1050 } 1051 1052 static void promiseAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1053 { 1054 v8::Handle<v8::Object> holder = info.Holder(); 1055 TestObject* impl = V8TestObject::toImpl(holder); 1056 ScriptPromise cppValue = ScriptPromise::cast(ScriptState::current(info.GetIsolate()), v8Value); 1057 impl->setPromiseAttribute(cppValue); 1058 } 1059 1060 static void promiseAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1061 { 1062 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1063 TestObjectV8Internal::promiseAttributeAttributeSetter(v8Value, info); 1064 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1065 } 1066 1067 static void windowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1068 { 1069 v8::Handle<v8::Object> holder = info.Holder(); 1070 TestObject* impl = V8TestObject::toImpl(holder); 1071 v8SetReturnValueFast(info, WTF::getPtr(impl->windowAttribute()), impl); 1072 } 1073 1074 static void windowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1075 { 1076 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1077 TestObjectV8Internal::windowAttributeAttributeGetter(info); 1078 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1079 } 1080 1081 static void windowAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1082 { 1083 v8::Handle<v8::Object> holder = info.Holder(); 1084 TestObject* impl = V8TestObject::toImpl(holder); 1085 LocalDOMWindow* cppValue = toDOMWindow(v8Value, info.GetIsolate()); 1086 impl->setWindowAttribute(WTF::getPtr(cppValue)); 1087 } 1088 1089 static void windowAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1090 { 1091 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1092 TestObjectV8Internal::windowAttributeAttributeSetter(v8Value, info); 1093 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1094 } 1095 1096 static void documentAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1097 { 1098 v8::Handle<v8::Object> holder = info.Holder(); 1099 TestObject* impl = V8TestObject::toImpl(holder); 1100 v8SetReturnValueFast(info, WTF::getPtr(impl->documentAttribute()), impl); 1101 } 1102 1103 static void documentAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1104 { 1105 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1106 TestObjectV8Internal::documentAttributeAttributeGetter(info); 1107 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1108 } 1109 1110 static void documentAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1111 { 1112 v8::Handle<v8::Object> holder = info.Holder(); 1113 TestObject* impl = V8TestObject::toImpl(holder); 1114 Document* cppValue = V8Document::toImplWithTypeCheck(info.GetIsolate(), v8Value); 1115 impl->setDocumentAttribute(WTF::getPtr(cppValue)); 1116 } 1117 1118 static void documentAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1119 { 1120 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1121 TestObjectV8Internal::documentAttributeAttributeSetter(v8Value, info); 1122 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1123 } 1124 1125 static void documentFragmentAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1126 { 1127 v8::Handle<v8::Object> holder = info.Holder(); 1128 TestObject* impl = V8TestObject::toImpl(holder); 1129 v8SetReturnValueFast(info, WTF::getPtr(impl->documentFragmentAttribute()), impl); 1130 } 1131 1132 static void documentFragmentAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1133 { 1134 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1135 TestObjectV8Internal::documentFragmentAttributeAttributeGetter(info); 1136 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1137 } 1138 1139 static void documentFragmentAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1140 { 1141 v8::Handle<v8::Object> holder = info.Holder(); 1142 TestObject* impl = V8TestObject::toImpl(holder); 1143 DocumentFragment* cppValue = V8DocumentFragment::toImplWithTypeCheck(info.GetIsolate(), v8Value); 1144 impl->setDocumentFragmentAttribute(WTF::getPtr(cppValue)); 1145 } 1146 1147 static void documentFragmentAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1148 { 1149 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1150 TestObjectV8Internal::documentFragmentAttributeAttributeSetter(v8Value, info); 1151 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1152 } 1153 1154 static void documentTypeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1155 { 1156 v8::Handle<v8::Object> holder = info.Holder(); 1157 TestObject* impl = V8TestObject::toImpl(holder); 1158 v8SetReturnValueFast(info, WTF::getPtr(impl->documentTypeAttribute()), impl); 1159 } 1160 1161 static void documentTypeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1162 { 1163 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1164 TestObjectV8Internal::documentTypeAttributeAttributeGetter(info); 1165 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1166 } 1167 1168 static void documentTypeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1169 { 1170 v8::Handle<v8::Object> holder = info.Holder(); 1171 TestObject* impl = V8TestObject::toImpl(holder); 1172 DocumentType* cppValue = V8DocumentType::toImplWithTypeCheck(info.GetIsolate(), v8Value); 1173 impl->setDocumentTypeAttribute(WTF::getPtr(cppValue)); 1174 } 1175 1176 static void documentTypeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1177 { 1178 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1179 TestObjectV8Internal::documentTypeAttributeAttributeSetter(v8Value, info); 1180 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1181 } 1182 1183 static void elementAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1184 { 1185 v8::Handle<v8::Object> holder = info.Holder(); 1186 TestObject* impl = V8TestObject::toImpl(holder); 1187 v8SetReturnValueFast(info, WTF::getPtr(impl->elementAttribute()), impl); 1188 } 1189 1190 static void elementAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1191 { 1192 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1193 TestObjectV8Internal::elementAttributeAttributeGetter(info); 1194 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1195 } 1196 1197 static void elementAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1198 { 1199 v8::Handle<v8::Object> holder = info.Holder(); 1200 TestObject* impl = V8TestObject::toImpl(holder); 1201 Element* cppValue = V8Element::toImplWithTypeCheck(info.GetIsolate(), v8Value); 1202 impl->setElementAttribute(WTF::getPtr(cppValue)); 1203 } 1204 1205 static void elementAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1206 { 1207 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1208 TestObjectV8Internal::elementAttributeAttributeSetter(v8Value, info); 1209 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1210 } 1211 1212 static void nodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1213 { 1214 v8::Handle<v8::Object> holder = info.Holder(); 1215 TestObject* impl = V8TestObject::toImpl(holder); 1216 v8SetReturnValueFast(info, WTF::getPtr(impl->nodeAttribute()), impl); 1217 } 1218 1219 static void nodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1220 { 1221 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1222 TestObjectV8Internal::nodeAttributeAttributeGetter(info); 1223 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1224 } 1225 1226 static void nodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1227 { 1228 v8::Handle<v8::Object> holder = info.Holder(); 1229 TestObject* impl = V8TestObject::toImpl(holder); 1230 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); 1231 impl->setNodeAttribute(WTF::getPtr(cppValue)); 1232 } 1233 1234 static void nodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1235 { 1236 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1237 TestObjectV8Internal::nodeAttributeAttributeSetter(v8Value, info); 1238 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1239 } 1240 1241 static void shadowRootAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1242 { 1243 v8::Handle<v8::Object> holder = info.Holder(); 1244 TestObject* impl = V8TestObject::toImpl(holder); 1245 v8SetReturnValueFast(info, WTF::getPtr(impl->shadowRootAttribute()), impl); 1246 } 1247 1248 static void shadowRootAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1249 { 1250 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1251 TestObjectV8Internal::shadowRootAttributeAttributeGetter(info); 1252 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1253 } 1254 1255 static void shadowRootAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1256 { 1257 v8::Handle<v8::Object> holder = info.Holder(); 1258 TestObject* impl = V8TestObject::toImpl(holder); 1259 ShadowRoot* cppValue = V8ShadowRoot::toImplWithTypeCheck(info.GetIsolate(), v8Value); 1260 impl->setShadowRootAttribute(WTF::getPtr(cppValue)); 1261 } 1262 1263 static void shadowRootAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1264 { 1265 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1266 TestObjectV8Internal::shadowRootAttributeAttributeSetter(v8Value, info); 1267 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1268 } 1269 1270 static void arrayBufferAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1271 { 1272 v8::Handle<v8::Object> holder = info.Holder(); 1273 TestObject* impl = V8TestObject::toImpl(holder); 1274 v8SetReturnValueFast(info, WTF::getPtr(impl->arrayBufferAttribute()), impl); 1275 } 1276 1277 static void arrayBufferAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1278 { 1279 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1280 TestObjectV8Internal::arrayBufferAttributeAttributeGetter(info); 1281 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1282 } 1283 1284 static void arrayBufferAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1285 { 1286 v8::Handle<v8::Object> holder = info.Holder(); 1287 TestObject* impl = V8TestObject::toImpl(holder); 1288 ArrayBuffer* cppValue = v8Value->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Handle<v8::ArrayBuffer>::Cast(v8Value)) : 0; 1289 impl->setArrayBufferAttribute(WTF::getPtr(cppValue)); 1290 } 1291 1292 static void arrayBufferAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1293 { 1294 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1295 TestObjectV8Internal::arrayBufferAttributeAttributeSetter(v8Value, info); 1296 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1297 } 1298 1299 static void float32ArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1300 { 1301 v8::Handle<v8::Object> holder = info.Holder(); 1302 TestObject* impl = V8TestObject::toImpl(holder); 1303 v8SetReturnValueFast(info, WTF::getPtr(impl->float32ArrayAttribute()), impl); 1304 } 1305 1306 static void float32ArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1307 { 1308 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1309 TestObjectV8Internal::float32ArrayAttributeAttributeGetter(info); 1310 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1311 } 1312 1313 static void float32ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1314 { 1315 v8::Handle<v8::Object> holder = info.Holder(); 1316 TestObject* impl = V8TestObject::toImpl(holder); 1317 Float32Array* cppValue = v8Value->IsFloat32Array() ? V8Float32Array::toImpl(v8::Handle<v8::Float32Array>::Cast(v8Value)) : 0; 1318 impl->setFloat32ArrayAttribute(WTF::getPtr(cppValue)); 1319 } 1320 1321 static void float32ArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1322 { 1323 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1324 TestObjectV8Internal::float32ArrayAttributeAttributeSetter(v8Value, info); 1325 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1326 } 1327 1328 static void uint8ArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1329 { 1330 v8::Handle<v8::Object> holder = info.Holder(); 1331 TestObject* impl = V8TestObject::toImpl(holder); 1332 v8SetReturnValueFast(info, WTF::getPtr(impl->uint8ArrayAttribute()), impl); 1333 } 1334 1335 static void uint8ArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1336 { 1337 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1338 TestObjectV8Internal::uint8ArrayAttributeAttributeGetter(info); 1339 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1340 } 1341 1342 static void uint8ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1343 { 1344 v8::Handle<v8::Object> holder = info.Holder(); 1345 TestObject* impl = V8TestObject::toImpl(holder); 1346 Uint8Array* cppValue = v8Value->IsUint8Array() ? V8Uint8Array::toImpl(v8::Handle<v8::Uint8Array>::Cast(v8Value)) : 0; 1347 impl->setUint8ArrayAttribute(WTF::getPtr(cppValue)); 1348 } 1349 1350 static void uint8ArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1351 { 1352 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1353 TestObjectV8Internal::uint8ArrayAttributeAttributeSetter(v8Value, info); 1354 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1355 } 1356 1357 static void selfAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1358 { 1359 v8::Handle<v8::Object> holder = info.Holder(); 1360 TestObject* impl = V8TestObject::toImpl(holder); 1361 v8SetReturnValueFast(info, WTF::getPtr(impl->self()), impl); 1362 } 1363 1364 static void selfAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1365 { 1366 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1367 TestObjectV8Internal::selfAttributeGetter(info); 1368 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1369 } 1370 1371 static void readonlyEventTargetAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1372 { 1373 v8::Handle<v8::Object> holder = info.Holder(); 1374 TestObject* impl = V8TestObject::toImpl(holder); 1375 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyEventTargetAttribute()), impl); 1376 } 1377 1378 static void readonlyEventTargetAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1379 { 1380 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1381 TestObjectV8Internal::readonlyEventTargetAttributeAttributeGetter(info); 1382 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1383 } 1384 1385 static void readonlyEventTargetOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1386 { 1387 v8::Handle<v8::Object> holder = info.Holder(); 1388 TestObject* impl = V8TestObject::toImpl(holder); 1389 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyEventTargetOrNullAttribute()), impl); 1390 } 1391 1392 static void readonlyEventTargetOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1393 { 1394 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1395 TestObjectV8Internal::readonlyEventTargetOrNullAttributeAttributeGetter(info); 1396 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1397 } 1398 1399 static void readonlyWindowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1400 { 1401 v8::Handle<v8::Object> holder = info.Holder(); 1402 TestObject* impl = V8TestObject::toImpl(holder); 1403 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyWindowAttribute()), impl); 1404 } 1405 1406 static void readonlyWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1407 { 1408 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1409 TestObjectV8Internal::readonlyWindowAttributeAttributeGetter(info); 1410 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1411 } 1412 1413 static void htmlCollectionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1414 { 1415 v8::Handle<v8::Object> holder = info.Holder(); 1416 TestObject* impl = V8TestObject::toImpl(holder); 1417 v8SetReturnValueFast(info, WTF::getPtr(impl->htmlCollectionAttribute()), impl); 1418 } 1419 1420 static void htmlCollectionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1421 { 1422 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1423 TestObjectV8Internal::htmlCollectionAttributeAttributeGetter(info); 1424 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1425 } 1426 1427 static void htmlElementAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1428 { 1429 v8::Handle<v8::Object> holder = info.Holder(); 1430 TestObject* impl = V8TestObject::toImpl(holder); 1431 v8SetReturnValueFast(info, WTF::getPtr(impl->htmlElementAttribute()), impl); 1432 } 1433 1434 static void htmlElementAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1435 { 1436 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1437 TestObjectV8Internal::htmlElementAttributeAttributeGetter(info); 1438 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1439 } 1440 1441 static void stringArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1442 { 1443 v8::Handle<v8::Object> holder = info.Holder(); 1444 TestObject* impl = V8TestObject::toImpl(holder); 1445 v8SetReturnValue(info, v8Array(impl->stringArrayAttribute(), info.Holder(), info.GetIsolate())); 1446 } 1447 1448 static void stringArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1449 { 1450 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1451 TestObjectV8Internal::stringArrayAttributeAttributeGetter(info); 1452 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1453 } 1454 1455 static void stringArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1456 { 1457 v8::Handle<v8::Object> holder = info.Holder(); 1458 ExceptionState exceptionState(ExceptionState::SetterContext, "stringArrayAttribute", "TestObject", holder, info.GetIsolate()); 1459 TestObject* impl = V8TestObject::toImpl(holder); 1460 TONATIVE_VOID_EXCEPTIONSTATE(Vector<String>, cppValue, toImplArray<String>(v8Value, 0, info.GetIsolate(), exceptionState), exceptionState); 1461 impl->setStringArrayAttribute(cppValue); 1462 } 1463 1464 static void stringArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1465 { 1466 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1467 TestObjectV8Internal::stringArrayAttributeAttributeSetter(v8Value, info); 1468 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1469 } 1470 1471 static void testInterfaceEmptyArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1472 { 1473 v8::Handle<v8::Object> holder = info.Holder(); 1474 TestObject* impl = V8TestObject::toImpl(holder); 1475 v8SetReturnValue(info, v8Array(impl->testInterfaceEmptyArrayAttribute(), info.Holder(), info.GetIsolate())); 1476 } 1477 1478 static void testInterfaceEmptyArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1479 { 1480 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1481 TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeGetter(info); 1482 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1483 } 1484 1485 static void testInterfaceEmptyArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1486 { 1487 v8::Handle<v8::Object> holder = info.Holder(); 1488 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceEmptyArrayAttribute", "TestObject", holder, info.GetIsolate()); 1489 TestObject* impl = V8TestObject::toImpl(holder); 1490 TONATIVE_VOID_EXCEPTIONSTATE(Vector<RefPtr<TestInterfaceEmpty> >, cppValue, (toRefPtrNativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(v8Value, 0, info.GetIsolate(), exceptionState)), exceptionState); 1491 impl->setTestInterfaceEmptyArrayAttribute(cppValue); 1492 } 1493 1494 static void testInterfaceEmptyArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1495 { 1496 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1497 TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeSetter(v8Value, info); 1498 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1499 } 1500 1501 static void floatArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1502 { 1503 v8::Handle<v8::Object> holder = info.Holder(); 1504 TestObject* impl = V8TestObject::toImpl(holder); 1505 v8SetReturnValue(info, v8Array(impl->floatArrayAttribute(), info.Holder(), info.GetIsolate())); 1506 } 1507 1508 static void floatArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1509 { 1510 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1511 TestObjectV8Internal::floatArrayAttributeAttributeGetter(info); 1512 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1513 } 1514 1515 static void floatArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1516 { 1517 v8::Handle<v8::Object> holder = info.Holder(); 1518 ExceptionState exceptionState(ExceptionState::SetterContext, "floatArrayAttribute", "TestObject", holder, info.GetIsolate()); 1519 TestObject* impl = V8TestObject::toImpl(holder); 1520 TONATIVE_VOID_EXCEPTIONSTATE(Vector<float>, cppValue, toImplArray<float>(v8Value, 0, info.GetIsolate(), exceptionState), exceptionState); 1521 impl->setFloatArrayAttribute(cppValue); 1522 } 1523 1524 static void floatArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1525 { 1526 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1527 TestObjectV8Internal::floatArrayAttributeAttributeSetter(v8Value, info); 1528 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1529 } 1530 1531 static void stringOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1532 { 1533 v8::Handle<v8::Object> holder = info.Holder(); 1534 TestObject* impl = V8TestObject::toImpl(holder); 1535 v8SetReturnValueStringOrNull(info, impl->stringOrNullAttribute(), info.GetIsolate()); 1536 } 1537 1538 static void stringOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1539 { 1540 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1541 TestObjectV8Internal::stringOrNullAttributeAttributeGetter(info); 1542 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1543 } 1544 1545 static void stringOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1546 { 1547 v8::Handle<v8::Object> holder = info.Holder(); 1548 TestObject* impl = V8TestObject::toImpl(holder); 1549 TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, cppValue, v8Value); 1550 impl->setStringOrNullAttribute(cppValue); 1551 } 1552 1553 static void stringOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1554 { 1555 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1556 TestObjectV8Internal::stringOrNullAttributeAttributeSetter(v8Value, info); 1557 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1558 } 1559 1560 static void longOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1561 { 1562 v8::Handle<v8::Object> holder = info.Holder(); 1563 TestObject* impl = V8TestObject::toImpl(holder); 1564 bool isNull = false; 1565 int cppValue(impl->longOrNullAttribute(isNull)); 1566 if (isNull) { 1567 v8SetReturnValueNull(info); 1568 return; 1569 } 1570 v8SetReturnValueInt(info, cppValue); 1571 } 1572 1573 static void longOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1574 { 1575 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1576 TestObjectV8Internal::longOrNullAttributeAttributeGetter(info); 1577 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1578 } 1579 1580 static void longOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1581 { 1582 v8::Handle<v8::Object> holder = info.Holder(); 1583 ExceptionState exceptionState(ExceptionState::SetterContext, "longOrNullAttribute", "TestObject", holder, info.GetIsolate()); 1584 TestObject* impl = V8TestObject::toImpl(holder); 1585 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1586 impl->setLongOrNullAttribute(cppValue); 1587 } 1588 1589 static void longOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1590 { 1591 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1592 TestObjectV8Internal::longOrNullAttributeAttributeSetter(v8Value, info); 1593 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1594 } 1595 1596 static void testInterfaceOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1597 { 1598 v8::Handle<v8::Object> holder = info.Holder(); 1599 TestObject* impl = V8TestObject::toImpl(holder); 1600 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceOrNullAttribute()), impl); 1601 } 1602 1603 static void testInterfaceOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1604 { 1605 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1606 TestObjectV8Internal::testInterfaceOrNullAttributeAttributeGetter(info); 1607 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1608 } 1609 1610 static void testInterfaceOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1611 { 1612 v8::Handle<v8::Object> holder = info.Holder(); 1613 TestObject* impl = V8TestObject::toImpl(holder); 1614 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value); 1615 impl->setTestInterfaceOrNullAttribute(WTF::getPtr(cppValue)); 1616 } 1617 1618 static void testInterfaceOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1619 { 1620 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1621 TestObjectV8Internal::testInterfaceOrNullAttributeAttributeSetter(v8Value, info); 1622 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1623 } 1624 1625 static void testEnumAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1626 { 1627 v8::Handle<v8::Object> holder = info.Holder(); 1628 TestObject* impl = V8TestObject::toImpl(holder); 1629 v8SetReturnValueString(info, impl->testEnumAttribute(), info.GetIsolate()); 1630 } 1631 1632 static void testEnumAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1633 { 1634 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1635 TestObjectV8Internal::testEnumAttributeAttributeGetter(info); 1636 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1637 } 1638 1639 static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1640 { 1641 v8::Handle<v8::Object> holder = info.Holder(); 1642 TestObject* impl = V8TestObject::toImpl(holder); 1643 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 1644 String string = cppValue; 1645 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) 1646 return; 1647 impl->setTestEnumAttribute(cppValue); 1648 } 1649 1650 static void testEnumAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1651 { 1652 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1653 TestObjectV8Internal::testEnumAttributeAttributeSetter(v8Value, info); 1654 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1655 } 1656 1657 static void staticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1658 { 1659 v8SetReturnValueString(info, TestObject::staticStringAttribute(), info.GetIsolate()); 1660 } 1661 1662 static void staticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1663 { 1664 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1665 TestObjectV8Internal::staticStringAttributeAttributeGetter(info); 1666 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1667 } 1668 1669 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1670 { 1671 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 1672 TestObject::setStaticStringAttribute(cppValue); 1673 } 1674 1675 static void staticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1676 { 1677 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1678 TestObjectV8Internal::staticStringAttributeAttributeSetter(v8Value, info); 1679 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1680 } 1681 1682 static void staticLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1683 { 1684 v8SetReturnValueInt(info, TestObject::staticLongAttribute()); 1685 } 1686 1687 static void staticLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1688 { 1689 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1690 TestObjectV8Internal::staticLongAttributeAttributeGetter(info); 1691 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1692 } 1693 1694 static void staticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1695 { 1696 ExceptionState exceptionState(ExceptionState::SetterContext, "staticLongAttribute", "TestObject", holder, info.GetIsolate()); 1697 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1698 TestObject::setStaticLongAttribute(cppValue); 1699 } 1700 1701 static void staticLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1702 { 1703 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1704 TestObjectV8Internal::staticLongAttributeAttributeSetter(v8Value, info); 1705 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1706 } 1707 1708 static void eventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1709 { 1710 v8::Handle<v8::Object> holder = info.Holder(); 1711 TestObject* impl = V8TestObject::toImpl(holder); 1712 EventListener* cppValue(impl->eventHandlerAttribute()); 1713 v8SetReturnValue(info, cppValue ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(cppValue)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()))); 1714 } 1715 1716 static void eventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1717 { 1718 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1719 TestObjectV8Internal::eventHandlerAttributeAttributeGetter(info); 1720 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1721 } 1722 1723 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1724 { 1725 v8::Handle<v8::Object> holder = info.Holder(); 1726 TestObject* impl = V8TestObject::toImpl(holder); 1727 moveEventListenerToNewWrapper(holder, impl->eventHandlerAttribute(), v8Value, V8TestObject::eventListenerCacheIndex, info.GetIsolate()); 1728 impl->setEventHandlerAttribute(V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)); 1729 } 1730 1731 static void eventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1732 { 1733 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1734 TestObjectV8Internal::eventHandlerAttributeAttributeSetter(v8Value, info); 1735 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1736 } 1737 1738 static void activityLoggingAccessForAllWorldsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1739 { 1740 v8::Handle<v8::Object> holder = info.Holder(); 1741 TestObject* impl = V8TestObject::toImpl(holder); 1742 v8SetReturnValueInt(info, impl->activityLoggingAccessForAllWorldsLongAttribute()); 1743 } 1744 1745 static void activityLoggingAccessForAllWorldsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1746 { 1747 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1748 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 1749 V8PerContextData* contextData = scriptState->perContextData(); 1750 if (contextData && contextData->activityLogger()) 1751 contextData->activityLogger()->logGetter("TestObject.activityLoggingAccessForAllWorldsLongAttribute"); 1752 TestObjectV8Internal::activityLoggingAccessForAllWorldsLongAttributeAttributeGetter(info); 1753 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1754 } 1755 1756 static void activityLoggingAccessForAllWorldsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1757 { 1758 v8::Handle<v8::Object> holder = info.Holder(); 1759 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate()); 1760 TestObject* impl = V8TestObject::toImpl(holder); 1761 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1762 impl->setActivityLoggingAccessForAllWorldsLongAttribute(cppValue); 1763 } 1764 1765 static void activityLoggingAccessForAllWorldsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1766 { 1767 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1768 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 1769 V8PerContextData* contextData = scriptState->perContextData(); 1770 if (contextData && contextData->activityLogger()) { 1771 contextData->activityLogger()->logSetter("TestObject.activityLoggingAccessForAllWorldsLongAttribute", v8Value); 1772 } 1773 TestObjectV8Internal::activityLoggingAccessForAllWorldsLongAttributeAttributeSetter(v8Value, info); 1774 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1775 } 1776 1777 static void activityLoggingGetterForAllWorldsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1778 { 1779 v8::Handle<v8::Object> holder = info.Holder(); 1780 TestObject* impl = V8TestObject::toImpl(holder); 1781 v8SetReturnValueInt(info, impl->activityLoggingGetterForAllWorldsLongAttribute()); 1782 } 1783 1784 static void activityLoggingGetterForAllWorldsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1785 { 1786 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1787 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 1788 V8PerContextData* contextData = scriptState->perContextData(); 1789 if (contextData && contextData->activityLogger()) 1790 contextData->activityLogger()->logGetter("TestObject.activityLoggingGetterForAllWorldsLongAttribute"); 1791 TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeGetter(info); 1792 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1793 } 1794 1795 static void activityLoggingGetterForAllWorldsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1796 { 1797 v8::Handle<v8::Object> holder = info.Holder(); 1798 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate()); 1799 TestObject* impl = V8TestObject::toImpl(holder); 1800 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1801 impl->setActivityLoggingGetterForAllWorldsLongAttribute(cppValue); 1802 } 1803 1804 static void activityLoggingGetterForAllWorldsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1805 { 1806 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1807 TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeSetter(v8Value, info); 1808 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1809 } 1810 1811 static void activityLoggingSetterForAllWorldsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1812 { 1813 v8::Handle<v8::Object> holder = info.Holder(); 1814 TestObject* impl = V8TestObject::toImpl(holder); 1815 v8SetReturnValueInt(info, impl->activityLoggingSetterForAllWorldsLongAttribute()); 1816 } 1817 1818 static void activityLoggingSetterForAllWorldsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1819 { 1820 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1821 TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeGetter(info); 1822 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1823 } 1824 1825 static void activityLoggingSetterForAllWorldsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1826 { 1827 v8::Handle<v8::Object> holder = info.Holder(); 1828 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingSetterForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate()); 1829 TestObject* impl = V8TestObject::toImpl(holder); 1830 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 1831 impl->setActivityLoggingSetterForAllWorldsLongAttribute(cppValue); 1832 } 1833 1834 static void activityLoggingSetterForAllWorldsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1835 { 1836 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1837 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 1838 V8PerContextData* contextData = scriptState->perContextData(); 1839 if (contextData && contextData->activityLogger()) { 1840 contextData->activityLogger()->logSetter("TestObject.activityLoggingSetterForAllWorldsLongAttribute", v8Value); 1841 } 1842 TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeSetter(v8Value, info); 1843 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1844 } 1845 1846 static void cachedAttributeAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1847 { 1848 v8::Handle<v8::Object> holder = info.Holder(); 1849 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedAttributeAnyAttribute"); 1850 TestObject* impl = V8TestObject::toImpl(holder); 1851 if (!impl->isValueDirty()) { 1852 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); 1853 if (!v8Value.IsEmpty()) { 1854 v8SetReturnValue(info, v8Value); 1855 return; 1856 } 1857 } 1858 ScriptValue cppValue(impl->cachedAttributeAnyAttribute()); 1859 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, cppValue.v8Value()); 1860 v8SetReturnValue(info, cppValue.v8Value()); 1861 } 1862 1863 static void cachedAttributeAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1864 { 1865 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1866 TestObjectV8Internal::cachedAttributeAnyAttributeAttributeGetter(info); 1867 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1868 } 1869 1870 static void cachedAttributeAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1871 { 1872 v8::Handle<v8::Object> holder = info.Holder(); 1873 TestObject* impl = V8TestObject::toImpl(holder); 1874 ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value); 1875 impl->setCachedAttributeAnyAttribute(cppValue); 1876 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "cachedAttributeAnyAttribute")); // Invalidate the cached value. 1877 } 1878 1879 static void cachedAttributeAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1880 { 1881 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1882 TestObjectV8Internal::cachedAttributeAnyAttributeAttributeSetter(v8Value, info); 1883 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1884 } 1885 1886 static void cachedArrayAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1887 { 1888 v8::Handle<v8::Object> holder = info.Holder(); 1889 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedArrayAttribute"); 1890 TestObject* impl = V8TestObject::toImpl(holder); 1891 if (!impl->isArrayDirty()) { 1892 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); 1893 if (!v8Value.IsEmpty()) { 1894 v8SetReturnValue(info, v8Value); 1895 return; 1896 } 1897 } 1898 Vector<String> cppValue(impl->cachedArrayAttribute()); 1899 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Array(cppValue, info.Holder(), info.GetIsolate())); 1900 v8SetReturnValue(info, v8Array(cppValue, info.Holder(), info.GetIsolate())); 1901 } 1902 1903 static void cachedArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1904 { 1905 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1906 TestObjectV8Internal::cachedArrayAttributeAttributeGetter(info); 1907 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1908 } 1909 1910 static void cachedArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1911 { 1912 v8::Handle<v8::Object> holder = info.Holder(); 1913 ExceptionState exceptionState(ExceptionState::SetterContext, "cachedArrayAttribute", "TestObject", holder, info.GetIsolate()); 1914 TestObject* impl = V8TestObject::toImpl(holder); 1915 TONATIVE_VOID_EXCEPTIONSTATE(Vector<String>, cppValue, toImplArray<String>(v8Value, 0, info.GetIsolate(), exceptionState), exceptionState); 1916 impl->setCachedArrayAttribute(cppValue); 1917 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "cachedArrayAttribute")); // Invalidate the cached value. 1918 } 1919 1920 static void cachedArrayAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1921 { 1922 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1923 TestObjectV8Internal::cachedArrayAttributeAttributeSetter(v8Value, info); 1924 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1925 } 1926 1927 static void cachedStringOrNoneAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1928 { 1929 v8::Handle<v8::Object> holder = info.Holder(); 1930 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedStringOrNoneAttribute"); 1931 TestObject* impl = V8TestObject::toImpl(holder); 1932 if (!impl->isStringDirty()) { 1933 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); 1934 if (!v8Value.IsEmpty()) { 1935 v8SetReturnValue(info, v8Value); 1936 return; 1937 } 1938 } 1939 String cppValue(impl->cachedStringOrNoneAttribute()); 1940 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, cppValue.isNull() ? v8::Handle<v8::Value>(v8::Null(info.GetIsolate())) : v8String(info.GetIsolate(), cppValue)); 1941 v8SetReturnValueStringOrNull(info, cppValue, info.GetIsolate()); 1942 } 1943 1944 static void cachedStringOrNoneAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1945 { 1946 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1947 TestObjectV8Internal::cachedStringOrNoneAttributeAttributeGetter(info); 1948 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1949 } 1950 1951 static void cachedStringOrNoneAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1952 { 1953 v8::Handle<v8::Object> holder = info.Holder(); 1954 TestObject* impl = V8TestObject::toImpl(holder); 1955 TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, cppValue, v8Value); 1956 impl->setCachedStringOrNoneAttribute(cppValue); 1957 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "cachedStringOrNoneAttribute")); // Invalidate the cached value. 1958 } 1959 1960 static void cachedStringOrNoneAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1961 { 1962 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1963 TestObjectV8Internal::cachedStringOrNoneAttributeAttributeSetter(v8Value, info); 1964 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1965 } 1966 1967 static void callWithExecutionContextAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1968 { 1969 v8::Handle<v8::Object> holder = info.Holder(); 1970 TestObject* impl = V8TestObject::toImpl(holder); 1971 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 1972 v8SetReturnValue(info, impl->callWithExecutionContextAnyAttribute(executionContext).v8Value()); 1973 } 1974 1975 static void callWithExecutionContextAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1976 { 1977 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 1978 TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeGetter(info); 1979 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1980 } 1981 1982 static void callWithExecutionContextAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1983 { 1984 v8::Handle<v8::Object> holder = info.Holder(); 1985 TestObject* impl = V8TestObject::toImpl(holder); 1986 ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value); 1987 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 1988 impl->setCallWithExecutionContextAnyAttribute(executionContext, cppValue); 1989 } 1990 1991 static void callWithExecutionContextAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 1992 { 1993 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 1994 TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeSetter(v8Value, info); 1995 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1996 } 1997 1998 static void callWithScriptStateAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 1999 { 2000 v8::Handle<v8::Object> holder = info.Holder(); 2001 TestObject* impl = V8TestObject::toImpl(holder); 2002 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 2003 v8SetReturnValue(info, impl->callWithScriptStateAnyAttribute(scriptState).v8Value()); 2004 } 2005 2006 static void callWithScriptStateAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2007 { 2008 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2009 TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeGetter(info); 2010 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2011 } 2012 2013 static void callWithScriptStateAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2014 { 2015 v8::Handle<v8::Object> holder = info.Holder(); 2016 TestObject* impl = V8TestObject::toImpl(holder); 2017 ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value); 2018 impl->setCallWithScriptStateAnyAttribute(scriptState, cppValue); 2019 } 2020 2021 static void callWithScriptStateAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2022 { 2023 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2024 TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeSetter(v8Value, info); 2025 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2026 } 2027 2028 static void callWithExecutionContextAndScriptStateAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2029 { 2030 v8::Handle<v8::Object> holder = info.Holder(); 2031 TestObject* impl = V8TestObject::toImpl(holder); 2032 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 2033 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 2034 v8SetReturnValue(info, impl->callWithExecutionContextAndScriptStateAnyAttribute(scriptState, executionContext).v8Value()); 2035 } 2036 2037 static void callWithExecutionContextAndScriptStateAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2038 { 2039 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2040 TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeGetter(info); 2041 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2042 } 2043 2044 static void callWithExecutionContextAndScriptStateAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2045 { 2046 v8::Handle<v8::Object> holder = info.Holder(); 2047 TestObject* impl = V8TestObject::toImpl(holder); 2048 ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value); 2049 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 2050 impl->setCallWithExecutionContextAndScriptStateAnyAttribute(scriptState, executionContext, cppValue); 2051 } 2052 2053 static void callWithExecutionContextAndScriptStateAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2054 { 2055 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2056 TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeSetter(v8Value, info); 2057 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2058 } 2059 2060 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2061 { 2062 v8::Handle<v8::Object> holder = info.Holder(); 2063 TestObject* impl = V8TestObject::toImpl(holder); 2064 ExceptionState exceptionState(ExceptionState::GetterContext, "checkSecurityForNodeReadonlyDocumentAttribute", "TestObject", holder, info.GetIsolate()); 2065 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->checkSecurityForNodeReadonlyDocumentAttribute(), exceptionState)) { 2066 v8SetReturnValueNull(info); 2067 exceptionState.throwIfNeeded(); 2068 return; 2069 } 2070 v8SetReturnValueFast(info, WTF::getPtr(impl->checkSecurityForNodeReadonlyDocumentAttribute()), impl); 2071 } 2072 2073 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2074 { 2075 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2076 TestObjectV8Internal::checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(info); 2077 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2078 } 2079 2080 #if ENABLE(CONDITION) 2081 static void conditionalLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2082 { 2083 v8::Handle<v8::Object> holder = info.Holder(); 2084 TestObject* impl = V8TestObject::toImpl(holder); 2085 v8SetReturnValueInt(info, impl->conditionalLongAttribute()); 2086 } 2087 #endif // ENABLE(CONDITION) 2088 2089 #if ENABLE(CONDITION) 2090 static void conditionalLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2091 { 2092 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2093 TestObjectV8Internal::conditionalLongAttributeAttributeGetter(info); 2094 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2095 } 2096 #endif // ENABLE(CONDITION) 2097 2098 #if ENABLE(CONDITION) 2099 static void conditionalLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2100 { 2101 v8::Handle<v8::Object> holder = info.Holder(); 2102 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalLongAttribute", "TestObject", holder, info.GetIsolate()); 2103 TestObject* impl = V8TestObject::toImpl(holder); 2104 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2105 impl->setConditionalLongAttribute(cppValue); 2106 } 2107 #endif // ENABLE(CONDITION) 2108 2109 #if ENABLE(CONDITION) 2110 static void conditionalLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2111 { 2112 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2113 TestObjectV8Internal::conditionalLongAttributeAttributeSetter(v8Value, info); 2114 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2115 } 2116 #endif // ENABLE(CONDITION) 2117 2118 static void customObjectAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2119 { 2120 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2121 V8TestObject::customObjectAttributeAttributeGetterCustom(info); 2122 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2123 } 2124 2125 static void customObjectAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2126 { 2127 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2128 V8TestObject::customObjectAttributeAttributeSetterCustom(v8Value, info); 2129 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2130 } 2131 2132 static void customGetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2133 { 2134 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2135 V8TestObject::customGetterLongAttributeAttributeGetterCustom(info); 2136 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2137 } 2138 2139 static void customGetterLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2140 { 2141 v8::Handle<v8::Object> holder = info.Holder(); 2142 ExceptionState exceptionState(ExceptionState::SetterContext, "customGetterLongAttribute", "TestObject", holder, info.GetIsolate()); 2143 TestObject* impl = V8TestObject::toImpl(holder); 2144 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2145 impl->setCustomGetterLongAttribute(cppValue); 2146 } 2147 2148 static void customGetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2149 { 2150 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2151 TestObjectV8Internal::customGetterLongAttributeAttributeSetter(v8Value, info); 2152 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2153 } 2154 2155 static void customGetterReadonlyObjectAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2156 { 2157 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2158 V8TestObject::customGetterReadonlyObjectAttributeAttributeGetterCustom(info); 2159 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2160 } 2161 2162 static void customSetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2163 { 2164 v8::Handle<v8::Object> holder = info.Holder(); 2165 TestObject* impl = V8TestObject::toImpl(holder); 2166 v8SetReturnValueInt(info, impl->customSetterLongAttribute()); 2167 } 2168 2169 static void customSetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2170 { 2171 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2172 TestObjectV8Internal::customSetterLongAttributeAttributeGetter(info); 2173 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2174 } 2175 2176 static void customSetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2177 { 2178 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2179 V8TestObject::customSetterLongAttributeAttributeSetterCustom(v8Value, info); 2180 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2181 } 2182 2183 #if ENABLE(CONDITION) 2184 static void customLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2185 { 2186 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2187 V8TestObject::customLongAttributeAttributeGetterCustom(info); 2188 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2189 } 2190 #endif // ENABLE(CONDITION) 2191 2192 #if ENABLE(CONDITION) 2193 static void customLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2194 { 2195 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2196 V8TestObject::customLongAttributeAttributeSetterCustom(v8Value, info); 2197 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2198 } 2199 #endif // ENABLE(CONDITION) 2200 2201 static void customElementsCallbacksReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2202 { 2203 v8::Handle<v8::Object> holder = info.Holder(); 2204 TestObject* impl = V8TestObject::toImpl(holder); 2205 v8SetReturnValueInt(info, impl->customElementsCallbacksReadonlyLongAttribute()); 2206 } 2207 2208 static void customElementsCallbacksReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2209 { 2210 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2211 TestObjectV8Internal::customElementsCallbacksReadonlyLongAttributeAttributeGetter(info); 2212 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2213 } 2214 2215 static void deprecatedLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2216 { 2217 v8::Handle<v8::Object> holder = info.Holder(); 2218 TestObject* impl = V8TestObject::toImpl(holder); 2219 v8SetReturnValueInt(info, impl->deprecatedLongAttribute()); 2220 } 2221 2222 static void deprecatedLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2223 { 2224 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2225 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::LongAttribute); 2226 TestObjectV8Internal::deprecatedLongAttributeAttributeGetter(info); 2227 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2228 } 2229 2230 static void deprecatedLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2231 { 2232 v8::Handle<v8::Object> holder = info.Holder(); 2233 ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedLongAttribute", "TestObject", holder, info.GetIsolate()); 2234 TestObject* impl = V8TestObject::toImpl(holder); 2235 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2236 impl->setDeprecatedLongAttribute(cppValue); 2237 } 2238 2239 static void deprecatedLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2240 { 2241 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2242 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::LongAttribute); 2243 TestObjectV8Internal::deprecatedLongAttributeAttributeSetter(v8Value, info); 2244 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2245 } 2246 2247 static void enforceRangeLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2248 { 2249 v8::Handle<v8::Object> holder = info.Holder(); 2250 TestObject* impl = V8TestObject::toImpl(holder); 2251 v8SetReturnValueInt(info, impl->enforceRangeLongAttribute()); 2252 } 2253 2254 static void enforceRangeLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2255 { 2256 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2257 TestObjectV8Internal::enforceRangeLongAttributeAttributeGetter(info); 2258 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2259 } 2260 2261 static void enforceRangeLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2262 { 2263 v8::Handle<v8::Object> holder = info.Holder(); 2264 ExceptionState exceptionState(ExceptionState::SetterContext, "enforceRangeLongAttribute", "TestObject", holder, info.GetIsolate()); 2265 TestObject* impl = V8TestObject::toImpl(holder); 2266 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, EnforceRange, exceptionState), exceptionState); 2267 impl->setEnforceRangeLongAttribute(cppValue); 2268 } 2269 2270 static void enforceRangeLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2271 { 2272 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2273 TestObjectV8Internal::enforceRangeLongAttributeAttributeSetter(v8Value, info); 2274 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2275 } 2276 2277 static void exposeJSAccessorsLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) 2278 { 2279 v8::Handle<v8::Object> holder = info.Holder(); 2280 TestObject* impl = V8TestObject::toImpl(holder); 2281 v8SetReturnValueInt(info, impl->exposeJSAccessorsLongAttribute()); 2282 } 2283 2284 static void exposeJSAccessorsLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 2285 { 2286 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2287 TestObjectV8Internal::exposeJSAccessorsLongAttributeAttributeGetter(info); 2288 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2289 } 2290 2291 static void exposeJSAccessorsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) 2292 { 2293 v8::Handle<v8::Object> holder = info.Holder(); 2294 ExceptionState exceptionState(ExceptionState::SetterContext, "exposeJSAccessorsLongAttribute", "TestObject", holder, info.GetIsolate()); 2295 TestObject* impl = V8TestObject::toImpl(holder); 2296 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2297 impl->setExposeJSAccessorsLongAttribute(cppValue); 2298 } 2299 2300 static void exposeJSAccessorsLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 2301 { 2302 v8::Local<v8::Value> v8Value = info[0]; 2303 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2304 TestObjectV8Internal::exposeJSAccessorsLongAttributeAttributeSetter(v8Value, info); 2305 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2306 } 2307 2308 static void implementedAsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2309 { 2310 v8::Handle<v8::Object> holder = info.Holder(); 2311 TestObject* impl = V8TestObject::toImpl(holder); 2312 v8SetReturnValueInt(info, impl->implementedAsName()); 2313 } 2314 2315 static void implementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2316 { 2317 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2318 TestObjectV8Internal::implementedAsLongAttributeAttributeGetter(info); 2319 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2320 } 2321 2322 static void implementedAsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2323 { 2324 v8::Handle<v8::Object> holder = info.Holder(); 2325 ExceptionState exceptionState(ExceptionState::SetterContext, "implementedAsLongAttribute", "TestObject", holder, info.GetIsolate()); 2326 TestObject* impl = V8TestObject::toImpl(holder); 2327 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2328 impl->setImplementedAsName(cppValue); 2329 } 2330 2331 static void implementedAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2332 { 2333 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2334 TestObjectV8Internal::implementedAsLongAttributeAttributeSetter(v8Value, info); 2335 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2336 } 2337 2338 static void customImplementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2339 { 2340 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2341 V8TestObject::customImplementedAsLongAttributeAttributeGetterCustom(info); 2342 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2343 } 2344 2345 static void customImplementedAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2346 { 2347 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2348 V8TestObject::customImplementedAsLongAttributeAttributeSetterCustom(v8Value, info); 2349 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2350 } 2351 2352 static void customGetterImplementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2353 { 2354 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2355 V8TestObject::customGetterImplementedAsLongAttributeAttributeGetterCustom(info); 2356 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2357 } 2358 2359 static void customGetterImplementedAsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2360 { 2361 v8::Handle<v8::Object> holder = info.Holder(); 2362 ExceptionState exceptionState(ExceptionState::SetterContext, "customGetterImplementedAsLongAttribute", "TestObject", holder, info.GetIsolate()); 2363 TestObject* impl = V8TestObject::toImpl(holder); 2364 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2365 impl->setImplementedAsNameWithCustomGetter(cppValue); 2366 } 2367 2368 static void customGetterImplementedAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2369 { 2370 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2371 TestObjectV8Internal::customGetterImplementedAsLongAttributeAttributeSetter(v8Value, info); 2372 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2373 } 2374 2375 static void customSetterImplementedAsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2376 { 2377 v8::Handle<v8::Object> holder = info.Holder(); 2378 TestObject* impl = V8TestObject::toImpl(holder); 2379 v8SetReturnValueInt(info, impl->implementedAsNameWithCustomGetter()); 2380 } 2381 2382 static void customSetterImplementedAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2383 { 2384 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2385 TestObjectV8Internal::customSetterImplementedAsLongAttributeAttributeGetter(info); 2386 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2387 } 2388 2389 static void customSetterImplementedAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2390 { 2391 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2392 V8TestObject::customSetterImplementedAsLongAttributeAttributeSetterCustom(v8Value, info); 2393 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2394 } 2395 2396 static void measureAsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2397 { 2398 v8::Handle<v8::Object> holder = info.Holder(); 2399 TestObject* impl = V8TestObject::toImpl(holder); 2400 v8SetReturnValueInt(info, impl->measureAsLongAttribute()); 2401 } 2402 2403 static void measureAsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2404 { 2405 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2406 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 2407 TestObjectV8Internal::measureAsLongAttributeAttributeGetter(info); 2408 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2409 } 2410 2411 static void measureAsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2412 { 2413 v8::Handle<v8::Object> holder = info.Holder(); 2414 ExceptionState exceptionState(ExceptionState::SetterContext, "measureAsLongAttribute", "TestObject", holder, info.GetIsolate()); 2415 TestObject* impl = V8TestObject::toImpl(holder); 2416 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2417 impl->setMeasureAsLongAttribute(cppValue); 2418 } 2419 2420 static void measureAsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2421 { 2422 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2423 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 2424 TestObjectV8Internal::measureAsLongAttributeAttributeSetter(v8Value, info); 2425 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2426 } 2427 2428 static void notEnumerableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2429 { 2430 v8::Handle<v8::Object> holder = info.Holder(); 2431 TestObject* impl = V8TestObject::toImpl(holder); 2432 v8SetReturnValueInt(info, impl->notEnumerableLongAttribute()); 2433 } 2434 2435 static void notEnumerableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2436 { 2437 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2438 TestObjectV8Internal::notEnumerableLongAttributeAttributeGetter(info); 2439 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2440 } 2441 2442 static void notEnumerableLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2443 { 2444 v8::Handle<v8::Object> holder = info.Holder(); 2445 ExceptionState exceptionState(ExceptionState::SetterContext, "notEnumerableLongAttribute", "TestObject", holder, info.GetIsolate()); 2446 TestObject* impl = V8TestObject::toImpl(holder); 2447 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2448 impl->setNotEnumerableLongAttribute(cppValue); 2449 } 2450 2451 static void notEnumerableLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2452 { 2453 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2454 TestObjectV8Internal::notEnumerableLongAttributeAttributeSetter(v8Value, info); 2455 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2456 } 2457 2458 static void perContextEnabledLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2459 { 2460 v8::Handle<v8::Object> holder = info.Holder(); 2461 TestObject* impl = V8TestObject::toImpl(holder); 2462 v8SetReturnValueInt(info, impl->perContextEnabledLongAttribute()); 2463 } 2464 2465 static void perContextEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2466 { 2467 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2468 TestObjectV8Internal::perContextEnabledLongAttributeAttributeGetter(info); 2469 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2470 } 2471 2472 static void perContextEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2473 { 2474 v8::Handle<v8::Object> holder = info.Holder(); 2475 ExceptionState exceptionState(ExceptionState::SetterContext, "perContextEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); 2476 TestObject* impl = V8TestObject::toImpl(holder); 2477 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2478 impl->setPerContextEnabledLongAttribute(cppValue); 2479 } 2480 2481 static void perContextEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2482 { 2483 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2484 TestObjectV8Internal::perContextEnabledLongAttributeAttributeSetter(v8Value, info); 2485 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2486 } 2487 2488 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2489 { 2490 v8::Handle<v8::Object> holder = info.Holder(); 2491 TestObject* impl = V8TestObject::toImpl(holder); 2492 RefPtr<TestInterfaceEmpty> cppValue(impl->perWorldBindingsReadonlyTestInterfaceEmptyAttribute()); 2493 if (cppValue && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEmpty>(info.GetReturnValue(), cppValue.get())) 2494 return; 2495 v8::Handle<v8::Value> wrapper = toV8(cppValue.get(), holder, info.GetIsolate()); 2496 if (!wrapper.IsEmpty()) { 2497 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "perWorldBindingsReadonlyTestInterfaceEmptyAttribute"), wrapper); 2498 v8SetReturnValue(info, wrapper); 2499 } 2500 } 2501 2502 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2503 { 2504 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2505 TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(info); 2506 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2507 } 2508 2509 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2510 { 2511 v8::Handle<v8::Object> holder = info.Holder(); 2512 TestObject* impl = V8TestObject::toImpl(holder); 2513 RefPtr<TestInterfaceEmpty> cppValue(impl->perWorldBindingsReadonlyTestInterfaceEmptyAttribute()); 2514 if (cppValue && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceEmpty>(info.GetReturnValue(), cppValue.get())) 2515 return; 2516 v8::Handle<v8::Value> wrapper = toV8(cppValue.get(), holder, info.GetIsolate()); 2517 if (!wrapper.IsEmpty()) { 2518 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "perWorldBindingsReadonlyTestInterfaceEmptyAttribute"), wrapper); 2519 v8SetReturnValue(info, wrapper); 2520 } 2521 } 2522 2523 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2524 { 2525 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2526 TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterForMainWorld(info); 2527 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2528 } 2529 2530 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2531 { 2532 v8::Handle<v8::Object> holder = info.Holder(); 2533 TestObject* impl = V8TestObject::toImpl(holder); 2534 v8SetReturnValueInt(info, impl->activityLoggingAccessPerWorldBindingsLongAttribute()); 2535 } 2536 2537 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2538 { 2539 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2540 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2541 V8PerContextData* contextData = scriptState->perContextData(); 2542 if (contextData && contextData->activityLogger()) 2543 contextData->activityLogger()->logGetter("TestObject.activityLoggingAccessPerWorldBindingsLongAttribute"); 2544 TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetter(info); 2545 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2546 } 2547 2548 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2549 { 2550 v8::Handle<v8::Object> holder = info.Holder(); 2551 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2552 TestObject* impl = V8TestObject::toImpl(holder); 2553 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2554 impl->setActivityLoggingAccessPerWorldBindingsLongAttribute(cppValue); 2555 } 2556 2557 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2558 { 2559 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2560 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2561 V8PerContextData* contextData = scriptState->perContextData(); 2562 if (contextData && contextData->activityLogger()) { 2563 contextData->activityLogger()->logSetter("TestObject.activityLoggingAccessPerWorldBindingsLongAttribute", v8Value); 2564 } 2565 TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); 2566 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2567 } 2568 2569 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2570 { 2571 v8::Handle<v8::Object> holder = info.Holder(); 2572 TestObject* impl = V8TestObject::toImpl(holder); 2573 v8SetReturnValueInt(info, impl->activityLoggingAccessPerWorldBindingsLongAttribute()); 2574 } 2575 2576 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2577 { 2578 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2579 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2580 V8PerContextData* contextData = scriptState->perContextData(); 2581 if (contextData && contextData->activityLogger()) 2582 contextData->activityLogger()->logGetter("TestObject.activityLoggingAccessPerWorldBindingsLongAttribute"); 2583 TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); 2584 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2585 } 2586 2587 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2588 { 2589 v8::Handle<v8::Object> holder = info.Holder(); 2590 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2591 TestObject* impl = V8TestObject::toImpl(holder); 2592 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2593 impl->setActivityLoggingAccessPerWorldBindingsLongAttribute(cppValue); 2594 } 2595 2596 static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2597 { 2598 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2599 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2600 V8PerContextData* contextData = scriptState->perContextData(); 2601 if (contextData && contextData->activityLogger()) { 2602 contextData->activityLogger()->logSetter("TestObject.activityLoggingAccessPerWorldBindingsLongAttribute", v8Value); 2603 } 2604 TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); 2605 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2606 } 2607 2608 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2609 { 2610 v8::Handle<v8::Object> holder = info.Holder(); 2611 TestObject* impl = V8TestObject::toImpl(holder); 2612 v8SetReturnValueInt(info, impl->activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute()); 2613 } 2614 2615 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2616 { 2617 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2618 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2619 V8PerContextData* contextData = scriptState->perContextData(); 2620 if (contextData && contextData->activityLogger()) 2621 contextData->activityLogger()->logGetter("TestObject.activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute"); 2622 TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetter(info); 2623 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2624 } 2625 2626 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2627 { 2628 v8::Handle<v8::Object> holder = info.Holder(); 2629 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2630 TestObject* impl = V8TestObject::toImpl(holder); 2631 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2632 impl->setActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue); 2633 } 2634 2635 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2636 { 2637 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2638 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2639 V8PerContextData* contextData = scriptState->perContextData(); 2640 if (contextData && contextData->activityLogger()) { 2641 contextData->activityLogger()->logSetter("TestObject.activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", v8Value); 2642 } 2643 TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); 2644 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2645 } 2646 2647 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2648 { 2649 v8::Handle<v8::Object> holder = info.Holder(); 2650 TestObject* impl = V8TestObject::toImpl(holder); 2651 v8SetReturnValueInt(info, impl->activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute()); 2652 } 2653 2654 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2655 { 2656 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2657 TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); 2658 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2659 } 2660 2661 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2662 { 2663 v8::Handle<v8::Object> holder = info.Holder(); 2664 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2665 TestObject* impl = V8TestObject::toImpl(holder); 2666 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2667 impl->setActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue); 2668 } 2669 2670 static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2671 { 2672 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2673 TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); 2674 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2675 } 2676 2677 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2678 { 2679 v8::Handle<v8::Object> holder = info.Holder(); 2680 TestObject* impl = V8TestObject::toImpl(holder); 2681 v8SetReturnValueInt(info, impl->activityLoggingGetterPerWorldBindingsLongAttribute()); 2682 } 2683 2684 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2685 { 2686 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2687 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2688 V8PerContextData* contextData = scriptState->perContextData(); 2689 if (contextData && contextData->activityLogger()) 2690 contextData->activityLogger()->logGetter("TestObject.activityLoggingGetterPerWorldBindingsLongAttribute"); 2691 TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetter(info); 2692 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2693 } 2694 2695 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2696 { 2697 v8::Handle<v8::Object> holder = info.Holder(); 2698 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2699 TestObject* impl = V8TestObject::toImpl(holder); 2700 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2701 impl->setActivityLoggingGetterPerWorldBindingsLongAttribute(cppValue); 2702 } 2703 2704 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2705 { 2706 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2707 TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); 2708 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2709 } 2710 2711 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2712 { 2713 v8::Handle<v8::Object> holder = info.Holder(); 2714 TestObject* impl = V8TestObject::toImpl(holder); 2715 v8SetReturnValueInt(info, impl->activityLoggingGetterPerWorldBindingsLongAttribute()); 2716 } 2717 2718 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2719 { 2720 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2721 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2722 V8PerContextData* contextData = scriptState->perContextData(); 2723 if (contextData && contextData->activityLogger()) 2724 contextData->activityLogger()->logGetter("TestObject.activityLoggingGetterPerWorldBindingsLongAttribute"); 2725 TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); 2726 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2727 } 2728 2729 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2730 { 2731 v8::Handle<v8::Object> holder = info.Holder(); 2732 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2733 TestObject* impl = V8TestObject::toImpl(holder); 2734 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2735 impl->setActivityLoggingGetterPerWorldBindingsLongAttribute(cppValue); 2736 } 2737 2738 static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2739 { 2740 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2741 TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); 2742 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2743 } 2744 2745 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2746 { 2747 v8::Handle<v8::Object> holder = info.Holder(); 2748 TestObject* impl = V8TestObject::toImpl(holder); 2749 v8SetReturnValueInt(info, impl->activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute()); 2750 } 2751 2752 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2753 { 2754 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2755 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 2756 V8PerContextData* contextData = scriptState->perContextData(); 2757 if (contextData && contextData->activityLogger()) 2758 contextData->activityLogger()->logGetter("TestObject.activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute"); 2759 TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetter(info); 2760 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2761 } 2762 2763 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2764 { 2765 v8::Handle<v8::Object> holder = info.Holder(); 2766 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2767 TestObject* impl = V8TestObject::toImpl(holder); 2768 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2769 impl->setActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue); 2770 } 2771 2772 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2773 { 2774 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2775 TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetter(v8Value, info); 2776 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2777 } 2778 2779 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2780 { 2781 v8::Handle<v8::Object> holder = info.Holder(); 2782 TestObject* impl = V8TestObject::toImpl(holder); 2783 v8SetReturnValueInt(info, impl->activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute()); 2784 } 2785 2786 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2787 { 2788 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2789 TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterForMainWorld(info); 2790 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2791 } 2792 2793 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2794 { 2795 v8::Handle<v8::Object> holder = info.Holder(); 2796 ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate()); 2797 TestObject* impl = V8TestObject::toImpl(holder); 2798 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 2799 impl->setActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue); 2800 } 2801 2802 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2803 { 2804 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2805 TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8Value, info); 2806 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2807 } 2808 2809 static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2810 { 2811 v8::Handle<v8::Object> holder = info.Holder(); 2812 TestObject* impl = V8TestObject::toImpl(holder); 2813 v8SetReturnValueFast(info, WTF::getPtr(impl->location()), impl); 2814 } 2815 2816 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2817 { 2818 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2819 TestObjectV8Internal::locationAttributeGetter(info); 2820 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2821 } 2822 2823 static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2824 { 2825 v8::Handle<v8::Object> holder = info.Holder(); 2826 TestObject* proxyImpl = V8TestObject::toImpl(holder); 2827 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->location()); 2828 if (!impl) 2829 return; 2830 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2831 impl->setHref(cppValue); 2832 } 2833 2834 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2835 { 2836 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2837 TestObjectV8Internal::locationAttributeSetter(v8Value, info); 2838 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2839 } 2840 2841 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2842 { 2843 v8::Handle<v8::Object> holder = info.Holder(); 2844 TestObject* impl = V8TestObject::toImpl(holder); 2845 v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithException()), impl); 2846 } 2847 2848 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2849 { 2850 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2851 TestObjectV8Internal::locationWithExceptionAttributeGetter(info); 2852 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2853 } 2854 2855 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2856 { 2857 v8::Handle<v8::Object> holder = info.Holder(); 2858 ExceptionState exceptionState(ExceptionState::SetterContext, "locationWithException", "TestObject", holder, info.GetIsolate()); 2859 TestObject* proxyImpl = V8TestObject::toImpl(holder); 2860 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithException()); 2861 if (!impl) 2862 return; 2863 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2864 impl->setHrefThrows(cppValue, exceptionState); 2865 exceptionState.throwIfNeeded(); 2866 } 2867 2868 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2869 { 2870 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2871 TestObjectV8Internal::locationWithExceptionAttributeSetter(v8Value, info); 2872 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2873 } 2874 2875 static void locationWithCallWithAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2876 { 2877 v8::Handle<v8::Object> holder = info.Holder(); 2878 TestObject* impl = V8TestObject::toImpl(holder); 2879 v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithCallWith()), impl); 2880 } 2881 2882 static void locationWithCallWithAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2883 { 2884 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2885 TestObjectV8Internal::locationWithCallWithAttributeGetter(info); 2886 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2887 } 2888 2889 static void locationWithCallWithAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2890 { 2891 v8::Handle<v8::Object> holder = info.Holder(); 2892 TestObject* proxyImpl = V8TestObject::toImpl(holder); 2893 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithCallWith()); 2894 if (!impl) 2895 return; 2896 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2897 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 2898 impl->setHrefCallWith(executionContext, callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), cppValue); 2899 } 2900 2901 static void locationWithCallWithAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2902 { 2903 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2904 TestObjectV8Internal::locationWithCallWithAttributeSetter(v8Value, info); 2905 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2906 } 2907 2908 static void locationByteStringAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2909 { 2910 v8::Handle<v8::Object> holder = info.Holder(); 2911 TestObject* impl = V8TestObject::toImpl(holder); 2912 v8SetReturnValueFast(info, WTF::getPtr(impl->locationByteString()), impl); 2913 } 2914 2915 static void locationByteStringAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2916 { 2917 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2918 TestObjectV8Internal::locationByteStringAttributeGetter(info); 2919 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2920 } 2921 2922 static void locationByteStringAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2923 { 2924 v8::Handle<v8::Object> holder = info.Holder(); 2925 ExceptionState exceptionState(ExceptionState::SetterContext, "locationByteString", "TestObject", holder, info.GetIsolate()); 2926 TestObject* proxyImpl = V8TestObject::toImpl(holder); 2927 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationByteString()); 2928 if (!impl) 2929 return; 2930 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toByteString(v8Value, exceptionState), exceptionState); 2931 impl->setHrefByteString(cppValue); 2932 } 2933 2934 static void locationByteStringAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2935 { 2936 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2937 TestObjectV8Internal::locationByteStringAttributeSetter(v8Value, info); 2938 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2939 } 2940 2941 static void locationWithPerWorldBindingsAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 2942 { 2943 v8::Handle<v8::Object> holder = info.Holder(); 2944 TestObject* impl = V8TestObject::toImpl(holder); 2945 v8SetReturnValueFast(info, WTF::getPtr(impl->locationWithPerWorldBindings()), impl); 2946 } 2947 2948 static void locationWithPerWorldBindingsAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2949 { 2950 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2951 TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetter(info); 2952 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2953 } 2954 2955 static void locationWithPerWorldBindingsAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2956 { 2957 v8::Handle<v8::Object> holder = info.Holder(); 2958 TestObject* proxyImpl = V8TestObject::toImpl(holder); 2959 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithPerWorldBindings()); 2960 if (!impl) 2961 return; 2962 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2963 impl->setHref(cppValue); 2964 } 2965 2966 static void locationWithPerWorldBindingsAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2967 { 2968 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 2969 TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetter(v8Value, info); 2970 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2971 } 2972 2973 static void locationWithPerWorldBindingsAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 2974 { 2975 v8::Handle<v8::Object> holder = info.Holder(); 2976 TestObject* impl = V8TestObject::toImpl(holder); 2977 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->locationWithPerWorldBindings())); 2978 } 2979 2980 static void locationWithPerWorldBindingsAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 2981 { 2982 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 2983 TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetterForMainWorld(info); 2984 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 2985 } 2986 2987 static void locationWithPerWorldBindingsAttributeSetterForMainWorld(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2988 { 2989 v8::Handle<v8::Object> holder = info.Holder(); 2990 TestObject* proxyImpl = V8TestObject::toImpl(holder); 2991 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationWithPerWorldBindings()); 2992 if (!impl) 2993 return; 2994 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 2995 impl->setHref(cppValue); 2996 } 2997 2998 static void locationWithPerWorldBindingsAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 2999 { 3000 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3001 TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetterForMainWorld(v8Value, info); 3002 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3003 } 3004 3005 static void locationTypeCheckingInterfaceAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3006 { 3007 v8::Handle<v8::Object> holder = info.Holder(); 3008 TestObject* impl = V8TestObject::toImpl(holder); 3009 v8SetReturnValueFast(info, WTF::getPtr(impl->locationTypeCheckingInterface()), impl); 3010 } 3011 3012 static void locationTypeCheckingInterfaceAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3013 { 3014 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3015 TestObjectV8Internal::locationTypeCheckingInterfaceAttributeGetter(info); 3016 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3017 } 3018 3019 static void locationTypeCheckingInterfaceAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3020 { 3021 v8::Handle<v8::Object> holder = info.Holder(); 3022 TestObject* proxyImpl = V8TestObject::toImpl(holder); 3023 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationTypeCheckingInterface()); 3024 if (!impl) 3025 return; 3026 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3027 impl->setHref(cppValue); 3028 } 3029 3030 static void locationTypeCheckingInterfaceAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3031 { 3032 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3033 TestObjectV8Internal::locationTypeCheckingInterfaceAttributeSetter(v8Value, info); 3034 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3035 } 3036 3037 static void locationGarbageCollectedAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3038 { 3039 v8::Handle<v8::Object> holder = info.Holder(); 3040 TestObject* impl = V8TestObject::toImpl(holder); 3041 RawPtr<TestInterfaceGarbageCollected> cppValue(impl->locationGarbageCollected()); 3042 if (cppValue && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceGarbageCollected>(info.GetReturnValue(), cppValue.get())) 3043 return; 3044 v8::Handle<v8::Value> wrapper = toV8(cppValue.get(), holder, info.GetIsolate()); 3045 if (!wrapper.IsEmpty()) { 3046 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "locationGarbageCollected"), wrapper); 3047 v8SetReturnValue(info, wrapper); 3048 } 3049 } 3050 3051 static void locationGarbageCollectedAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3052 { 3053 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3054 TestObjectV8Internal::locationGarbageCollectedAttributeGetter(info); 3055 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3056 } 3057 3058 static void locationGarbageCollectedAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3059 { 3060 v8::Handle<v8::Object> holder = info.Holder(); 3061 TestObject* proxyImpl = V8TestObject::toImpl(holder); 3062 RawPtr<TestInterfaceGarbageCollected> impl = WTF::getPtr(proxyImpl->locationGarbageCollected()); 3063 if (!impl) 3064 return; 3065 TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value); 3066 impl->setAttr1(WTF::getPtr(cppValue)); 3067 } 3068 3069 static void locationGarbageCollectedAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3070 { 3071 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3072 TestObjectV8Internal::locationGarbageCollectedAttributeSetter(v8Value, info); 3073 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3074 } 3075 3076 static void locationWillBeGarbageCollectedAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3077 { 3078 v8::Handle<v8::Object> holder = info.Holder(); 3079 TestObject* impl = V8TestObject::toImpl(holder); 3080 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> cppValue(impl->locationWillBeGarbageCollected()); 3081 if (cppValue && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceWillBeGarbageCollected>(info.GetReturnValue(), cppValue.get())) 3082 return; 3083 v8::Handle<v8::Value> wrapper = toV8(cppValue.get(), holder, info.GetIsolate()); 3084 if (!wrapper.IsEmpty()) { 3085 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "locationWillBeGarbageCollected"), wrapper); 3086 v8SetReturnValue(info, wrapper); 3087 } 3088 } 3089 3090 static void locationWillBeGarbageCollectedAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3091 { 3092 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3093 TestObjectV8Internal::locationWillBeGarbageCollectedAttributeGetter(info); 3094 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3095 } 3096 3097 static void locationWillBeGarbageCollectedAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3098 { 3099 v8::Handle<v8::Object> holder = info.Holder(); 3100 TestObject* proxyImpl = V8TestObject::toImpl(holder); 3101 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = WTF::getPtr(proxyImpl->locationWillBeGarbageCollected()); 3102 if (!impl) 3103 return; 3104 TestInterfaceWillBeGarbageCollected* cppValue = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value); 3105 impl->setAttr1(WTF::getPtr(cppValue)); 3106 } 3107 3108 static void locationWillBeGarbageCollectedAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3109 { 3110 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3111 TestObjectV8Internal::locationWillBeGarbageCollectedAttributeSetter(v8Value, info); 3112 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3113 } 3114 3115 static void raisesExceptionLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3116 { 3117 v8::Handle<v8::Object> holder = info.Holder(); 3118 TestObject* impl = V8TestObject::toImpl(holder); 3119 ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate()); 3120 int cppValue(impl->raisesExceptionLongAttribute(exceptionState)); 3121 if (UNLIKELY(exceptionState.throwIfNeeded())) 3122 return; 3123 v8SetReturnValueInt(info, cppValue); 3124 } 3125 3126 static void raisesExceptionLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3127 { 3128 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3129 TestObjectV8Internal::raisesExceptionLongAttributeAttributeGetter(info); 3130 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3131 } 3132 3133 static void raisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3134 { 3135 v8::Handle<v8::Object> holder = info.Holder(); 3136 ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate()); 3137 TestObject* impl = V8TestObject::toImpl(holder); 3138 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3139 impl->setRaisesExceptionLongAttribute(cppValue, exceptionState); 3140 exceptionState.throwIfNeeded(); 3141 } 3142 3143 static void raisesExceptionLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3144 { 3145 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3146 TestObjectV8Internal::raisesExceptionLongAttributeAttributeSetter(v8Value, info); 3147 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3148 } 3149 3150 static void raisesExceptionGetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3151 { 3152 v8::Handle<v8::Object> holder = info.Holder(); 3153 TestObject* impl = V8TestObject::toImpl(holder); 3154 ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionGetterLongAttribute", "TestObject", holder, info.GetIsolate()); 3155 int cppValue(impl->raisesExceptionGetterLongAttribute(exceptionState)); 3156 if (UNLIKELY(exceptionState.throwIfNeeded())) 3157 return; 3158 v8SetReturnValueInt(info, cppValue); 3159 } 3160 3161 static void raisesExceptionGetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3162 { 3163 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3164 TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeGetter(info); 3165 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3166 } 3167 3168 static void raisesExceptionGetterLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3169 { 3170 v8::Handle<v8::Object> holder = info.Holder(); 3171 ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionGetterLongAttribute", "TestObject", holder, info.GetIsolate()); 3172 TestObject* impl = V8TestObject::toImpl(holder); 3173 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3174 impl->setRaisesExceptionGetterLongAttribute(cppValue); 3175 } 3176 3177 static void raisesExceptionGetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3178 { 3179 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3180 TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeSetter(v8Value, info); 3181 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3182 } 3183 3184 static void setterRaisesExceptionLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3185 { 3186 v8::Handle<v8::Object> holder = info.Holder(); 3187 TestObject* impl = V8TestObject::toImpl(holder); 3188 v8SetReturnValueInt(info, impl->setterRaisesExceptionLongAttribute()); 3189 } 3190 3191 static void setterRaisesExceptionLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3192 { 3193 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3194 TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeGetter(info); 3195 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3196 } 3197 3198 static void setterRaisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3199 { 3200 v8::Handle<v8::Object> holder = info.Holder(); 3201 ExceptionState exceptionState(ExceptionState::SetterContext, "setterRaisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate()); 3202 TestObject* impl = V8TestObject::toImpl(holder); 3203 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3204 impl->setSetterRaisesExceptionLongAttribute(cppValue, exceptionState); 3205 exceptionState.throwIfNeeded(); 3206 } 3207 3208 static void setterRaisesExceptionLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3209 { 3210 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3211 TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeSetter(v8Value, info); 3212 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3213 } 3214 3215 static void raisesExceptionTestInterfaceEmptyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3216 { 3217 v8::Handle<v8::Object> holder = info.Holder(); 3218 TestObject* impl = V8TestObject::toImpl(holder); 3219 ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionTestInterfaceEmptyAttribute", "TestObject", holder, info.GetIsolate()); 3220 RefPtr<TestInterfaceEmpty> cppValue(impl->raisesExceptionTestInterfaceEmptyAttribute(exceptionState)); 3221 if (UNLIKELY(exceptionState.throwIfNeeded())) 3222 return; 3223 v8SetReturnValueFast(info, WTF::getPtr(cppValue.release()), impl); 3224 } 3225 3226 static void raisesExceptionTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3227 { 3228 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3229 TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeGetter(info); 3230 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3231 } 3232 3233 static void raisesExceptionTestInterfaceEmptyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3234 { 3235 v8::Handle<v8::Object> holder = info.Holder(); 3236 ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionTestInterfaceEmptyAttribute", "TestObject", holder, info.GetIsolate()); 3237 TestObject* impl = V8TestObject::toImpl(holder); 3238 TestInterfaceEmpty* cppValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value); 3239 impl->setRaisesExceptionTestInterfaceEmptyAttribute(WTF::getPtr(cppValue), exceptionState); 3240 exceptionState.throwIfNeeded(); 3241 } 3242 3243 static void raisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3244 { 3245 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3246 TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeSetter(v8Value, info); 3247 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3248 } 3249 3250 static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3251 { 3252 v8::Handle<v8::Object> holder = info.Holder(); 3253 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedAttributeRaisesExceptionGetterAnyAttribute"); 3254 TestObject* impl = V8TestObject::toImpl(holder); 3255 if (!impl->isValueDirty()) { 3256 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); 3257 if (!v8Value.IsEmpty()) { 3258 v8SetReturnValue(info, v8Value); 3259 return; 3260 } 3261 } 3262 ExceptionState exceptionState(ExceptionState::GetterContext, "cachedAttributeRaisesExceptionGetterAnyAttribute", "TestObject", holder, info.GetIsolate()); 3263 ScriptValue cppValue(impl->cachedAttributeRaisesExceptionGetterAnyAttribute(exceptionState)); 3264 if (UNLIKELY(exceptionState.throwIfNeeded())) 3265 return; 3266 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, cppValue.v8Value()); 3267 v8SetReturnValue(info, cppValue.v8Value()); 3268 } 3269 3270 static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3271 { 3272 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3273 TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetter(info); 3274 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3275 } 3276 3277 static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3278 { 3279 v8::Handle<v8::Object> holder = info.Holder(); 3280 ExceptionState exceptionState(ExceptionState::SetterContext, "cachedAttributeRaisesExceptionGetterAnyAttribute", "TestObject", holder, info.GetIsolate()); 3281 TestObject* impl = V8TestObject::toImpl(holder); 3282 ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value); 3283 impl->setCachedAttributeRaisesExceptionGetterAnyAttribute(cppValue, exceptionState); 3284 exceptionState.throwIfNeeded(); 3285 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "cachedAttributeRaisesExceptionGetterAnyAttribute")); // Invalidate the cached value. 3286 } 3287 3288 static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3289 { 3290 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3291 TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetter(v8Value, info); 3292 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3293 } 3294 3295 static void reflectTestInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3296 { 3297 v8::Handle<v8::Object> holder = info.Holder(); 3298 TestObject* impl = V8TestObject::toImpl(holder); 3299 v8SetReturnValueFast(info, WTF::getPtr(impl->fastGetAttribute(HTMLNames::reflecttestinterfaceattributeAttr)), impl); 3300 } 3301 3302 static void reflectTestInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3303 { 3304 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3305 TestObjectV8Internal::reflectTestInterfaceAttributeAttributeGetter(info); 3306 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3307 } 3308 3309 static void reflectTestInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3310 { 3311 v8::Handle<v8::Object> holder = info.Holder(); 3312 TestObject* impl = V8TestObject::toImpl(holder); 3313 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value); 3314 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3315 impl->setAttribute(HTMLNames::reflecttestinterfaceattributeAttr, WTF::getPtr(cppValue)); 3316 } 3317 3318 static void reflectTestInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3319 { 3320 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3321 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3322 TestObjectV8Internal::reflectTestInterfaceAttributeAttributeSetter(v8Value, info); 3323 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3324 } 3325 3326 static void reflectReflectedNameAttributeTestAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3327 { 3328 v8::Handle<v8::Object> holder = info.Holder(); 3329 TestObject* impl = V8TestObject::toImpl(holder); 3330 v8SetReturnValueFast(info, WTF::getPtr(impl->fastGetAttribute(HTMLNames::reflectedNameAttributeAttr)), impl); 3331 } 3332 3333 static void reflectReflectedNameAttributeTestAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3334 { 3335 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3336 TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeGetter(info); 3337 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3338 } 3339 3340 static void reflectReflectedNameAttributeTestAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3341 { 3342 v8::Handle<v8::Object> holder = info.Holder(); 3343 TestObject* impl = V8TestObject::toImpl(holder); 3344 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value); 3345 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3346 impl->setAttribute(HTMLNames::reflectedNameAttributeAttr, WTF::getPtr(cppValue)); 3347 } 3348 3349 static void reflectReflectedNameAttributeTestAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3350 { 3351 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3352 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3353 TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeSetter(v8Value, info); 3354 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3355 } 3356 3357 static void reflectBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3358 { 3359 v8::Handle<v8::Object> holder = info.Holder(); 3360 TestObject* impl = V8TestObject::toImpl(holder); 3361 v8SetReturnValueBool(info, impl->fastHasAttribute(HTMLNames::reflectbooleanattributeAttr)); 3362 } 3363 3364 static void reflectBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3365 { 3366 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3367 TestObjectV8Internal::reflectBooleanAttributeAttributeGetter(info); 3368 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3369 } 3370 3371 static void reflectBooleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3372 { 3373 v8::Handle<v8::Object> holder = info.Holder(); 3374 TestObject* impl = V8TestObject::toImpl(holder); 3375 bool cppValue = v8Value->BooleanValue(); 3376 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3377 impl->setBooleanAttribute(HTMLNames::reflectbooleanattributeAttr, cppValue); 3378 } 3379 3380 static void reflectBooleanAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3381 { 3382 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3383 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3384 TestObjectV8Internal::reflectBooleanAttributeAttributeSetter(v8Value, info); 3385 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3386 } 3387 3388 static void reflectLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3389 { 3390 v8::Handle<v8::Object> holder = info.Holder(); 3391 TestObject* impl = V8TestObject::toImpl(holder); 3392 v8SetReturnValueInt(info, impl->getIntegralAttribute(HTMLNames::reflectlongattributeAttr)); 3393 } 3394 3395 static void reflectLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3396 { 3397 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3398 TestObjectV8Internal::reflectLongAttributeAttributeGetter(info); 3399 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3400 } 3401 3402 static void reflectLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3403 { 3404 v8::Handle<v8::Object> holder = info.Holder(); 3405 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectLongAttribute", "TestObject", holder, info.GetIsolate()); 3406 TestObject* impl = V8TestObject::toImpl(holder); 3407 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3408 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3409 impl->setIntegralAttribute(HTMLNames::reflectlongattributeAttr, cppValue); 3410 } 3411 3412 static void reflectLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3413 { 3414 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3415 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3416 TestObjectV8Internal::reflectLongAttributeAttributeSetter(v8Value, info); 3417 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3418 } 3419 3420 static void reflectUnsignedShortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3421 { 3422 v8::Handle<v8::Object> holder = info.Holder(); 3423 TestObject* impl = V8TestObject::toImpl(holder); 3424 v8SetReturnValueUnsigned(info, std::max(0, static_cast<int>(impl->fastGetAttribute(HTMLNames::reflectunsignedshortattributeAttr)))); 3425 } 3426 3427 static void reflectUnsignedShortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3428 { 3429 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3430 TestObjectV8Internal::reflectUnsignedShortAttributeAttributeGetter(info); 3431 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3432 } 3433 3434 static void reflectUnsignedShortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3435 { 3436 v8::Handle<v8::Object> holder = info.Holder(); 3437 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectUnsignedShortAttribute", "TestObject", holder, info.GetIsolate()); 3438 TestObject* impl = V8TestObject::toImpl(holder); 3439 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt16(v8Value, exceptionState), exceptionState); 3440 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3441 impl->setAttribute(HTMLNames::reflectunsignedshortattributeAttr, cppValue); 3442 } 3443 3444 static void reflectUnsignedShortAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3445 { 3446 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3447 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3448 TestObjectV8Internal::reflectUnsignedShortAttributeAttributeSetter(v8Value, info); 3449 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3450 } 3451 3452 static void reflectUnsignedLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3453 { 3454 v8::Handle<v8::Object> holder = info.Holder(); 3455 TestObject* impl = V8TestObject::toImpl(holder); 3456 v8SetReturnValueUnsigned(info, std::max(0, static_cast<int>(impl->getIntegralAttribute(HTMLNames::reflectunsignedlongattributeAttr)))); 3457 } 3458 3459 static void reflectUnsignedLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3460 { 3461 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3462 TestObjectV8Internal::reflectUnsignedLongAttributeAttributeGetter(info); 3463 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3464 } 3465 3466 static void reflectUnsignedLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3467 { 3468 v8::Handle<v8::Object> holder = info.Holder(); 3469 ExceptionState exceptionState(ExceptionState::SetterContext, "reflectUnsignedLongAttribute", "TestObject", holder, info.GetIsolate()); 3470 TestObject* impl = V8TestObject::toImpl(holder); 3471 TONATIVE_VOID_EXCEPTIONSTATE(unsigned, cppValue, toUInt32(v8Value, exceptionState), exceptionState); 3472 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3473 impl->setUnsignedIntegralAttribute(HTMLNames::reflectunsignedlongattributeAttr, cppValue); 3474 } 3475 3476 static void reflectUnsignedLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3477 { 3478 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3479 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3480 TestObjectV8Internal::reflectUnsignedLongAttributeAttributeSetter(v8Value, info); 3481 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3482 } 3483 3484 static void idAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3485 { 3486 v8::Handle<v8::Object> holder = info.Holder(); 3487 TestObject* impl = V8TestObject::toImpl(holder); 3488 v8SetReturnValueString(info, impl->getIdAttribute(), info.GetIsolate()); 3489 } 3490 3491 static void idAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3492 { 3493 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3494 TestObjectV8Internal::idAttributeGetter(info); 3495 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3496 } 3497 3498 static void idAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3499 { 3500 v8::Handle<v8::Object> holder = info.Holder(); 3501 TestObject* impl = V8TestObject::toImpl(holder); 3502 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3503 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3504 impl->setAttribute(HTMLNames::idAttr, cppValue); 3505 } 3506 3507 static void idAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3508 { 3509 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3510 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3511 TestObjectV8Internal::idAttributeSetter(v8Value, info); 3512 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3513 } 3514 3515 static void nameAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3516 { 3517 v8::Handle<v8::Object> holder = info.Holder(); 3518 TestObject* impl = V8TestObject::toImpl(holder); 3519 v8SetReturnValueString(info, impl->getNameAttribute(), info.GetIsolate()); 3520 } 3521 3522 static void nameAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3523 { 3524 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3525 TestObjectV8Internal::nameAttributeGetter(info); 3526 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3527 } 3528 3529 static void nameAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3530 { 3531 v8::Handle<v8::Object> holder = info.Holder(); 3532 TestObject* impl = V8TestObject::toImpl(holder); 3533 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3534 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3535 impl->setAttribute(HTMLNames::nameAttr, cppValue); 3536 } 3537 3538 static void nameAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3539 { 3540 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3541 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3542 TestObjectV8Internal::nameAttributeSetter(v8Value, info); 3543 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3544 } 3545 3546 static void classAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3547 { 3548 v8::Handle<v8::Object> holder = info.Holder(); 3549 TestObject* impl = V8TestObject::toImpl(holder); 3550 v8SetReturnValueString(info, impl->getClassAttribute(), info.GetIsolate()); 3551 } 3552 3553 static void classAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3554 { 3555 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3556 TestObjectV8Internal::classAttributeGetter(info); 3557 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3558 } 3559 3560 static void classAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3561 { 3562 v8::Handle<v8::Object> holder = info.Holder(); 3563 TestObject* impl = V8TestObject::toImpl(holder); 3564 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3565 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3566 impl->setAttribute(HTMLNames::classAttr, cppValue); 3567 } 3568 3569 static void classAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3570 { 3571 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3572 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3573 TestObjectV8Internal::classAttributeSetter(v8Value, info); 3574 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3575 } 3576 3577 static void reflectedIdAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3578 { 3579 v8::Handle<v8::Object> holder = info.Holder(); 3580 TestObject* impl = V8TestObject::toImpl(holder); 3581 v8SetReturnValueString(info, impl->getIdAttribute(), info.GetIsolate()); 3582 } 3583 3584 static void reflectedIdAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3585 { 3586 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3587 TestObjectV8Internal::reflectedIdAttributeGetter(info); 3588 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3589 } 3590 3591 static void reflectedIdAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3592 { 3593 v8::Handle<v8::Object> holder = info.Holder(); 3594 TestObject* impl = V8TestObject::toImpl(holder); 3595 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3596 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3597 impl->setAttribute(HTMLNames::idAttr, cppValue); 3598 } 3599 3600 static void reflectedIdAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3601 { 3602 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3603 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3604 TestObjectV8Internal::reflectedIdAttributeSetter(v8Value, info); 3605 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3606 } 3607 3608 static void reflectedNameAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3609 { 3610 v8::Handle<v8::Object> holder = info.Holder(); 3611 TestObject* impl = V8TestObject::toImpl(holder); 3612 v8SetReturnValueString(info, impl->getNameAttribute(), info.GetIsolate()); 3613 } 3614 3615 static void reflectedNameAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3616 { 3617 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3618 TestObjectV8Internal::reflectedNameAttributeGetter(info); 3619 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3620 } 3621 3622 static void reflectedNameAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3623 { 3624 v8::Handle<v8::Object> holder = info.Holder(); 3625 TestObject* impl = V8TestObject::toImpl(holder); 3626 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3627 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3628 impl->setAttribute(HTMLNames::nameAttr, cppValue); 3629 } 3630 3631 static void reflectedNameAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3632 { 3633 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3634 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3635 TestObjectV8Internal::reflectedNameAttributeSetter(v8Value, info); 3636 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3637 } 3638 3639 static void reflectedClassAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3640 { 3641 v8::Handle<v8::Object> holder = info.Holder(); 3642 TestObject* impl = V8TestObject::toImpl(holder); 3643 v8SetReturnValueString(info, impl->getClassAttribute(), info.GetIsolate()); 3644 } 3645 3646 static void reflectedClassAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3647 { 3648 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3649 TestObjectV8Internal::reflectedClassAttributeGetter(info); 3650 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3651 } 3652 3653 static void reflectedClassAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3654 { 3655 v8::Handle<v8::Object> holder = info.Holder(); 3656 TestObject* impl = V8TestObject::toImpl(holder); 3657 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3658 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3659 impl->setAttribute(HTMLNames::classAttr, cppValue); 3660 } 3661 3662 static void reflectedClassAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3663 { 3664 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3665 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3666 TestObjectV8Internal::reflectedClassAttributeSetter(v8Value, info); 3667 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3668 } 3669 3670 static void limitedToOnlyOneAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3671 { 3672 v8::Handle<v8::Object> holder = info.Holder(); 3673 TestObject* impl = V8TestObject::toImpl(holder); 3674 String cppValue(impl->fastGetAttribute(HTMLNames::limitedtoonlyoneattributeAttr)); 3675 if (cppValue.isEmpty()) { 3676 ; 3677 } else if (equalIgnoringCase(cppValue, "unique")) { 3678 cppValue = "unique"; 3679 } else { 3680 cppValue = ""; 3681 } 3682 v8SetReturnValueString(info, cppValue, info.GetIsolate()); 3683 } 3684 3685 static void limitedToOnlyOneAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3686 { 3687 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3688 TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetter(info); 3689 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3690 } 3691 3692 static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3693 { 3694 v8::Handle<v8::Object> holder = info.Holder(); 3695 TestObject* impl = V8TestObject::toImpl(holder); 3696 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3697 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3698 impl->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue); 3699 } 3700 3701 static void limitedToOnlyOneAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3702 { 3703 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3704 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3705 TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetter(v8Value, info); 3706 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3707 } 3708 3709 static void limitedToOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3710 { 3711 v8::Handle<v8::Object> holder = info.Holder(); 3712 TestObject* impl = V8TestObject::toImpl(holder); 3713 String cppValue(impl->fastGetAttribute(HTMLNames::limitedtoonlyattributeAttr)); 3714 if (cppValue.isEmpty()) { 3715 ; 3716 } else if (equalIgnoringCase(cppValue, "Per")) { 3717 cppValue = "Per"; 3718 } else if (equalIgnoringCase(cppValue, "Paal")) { 3719 cppValue = "Paal"; 3720 } else if (equalIgnoringCase(cppValue, "Espen")) { 3721 cppValue = "Espen"; 3722 } else { 3723 cppValue = ""; 3724 } 3725 v8SetReturnValueString(info, cppValue, info.GetIsolate()); 3726 } 3727 3728 static void limitedToOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3729 { 3730 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3731 TestObjectV8Internal::limitedToOnlyAttributeAttributeGetter(info); 3732 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3733 } 3734 3735 static void limitedToOnlyAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3736 { 3737 v8::Handle<v8::Object> holder = info.Holder(); 3738 TestObject* impl = V8TestObject::toImpl(holder); 3739 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3740 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3741 impl->setAttribute(HTMLNames::limitedtoonlyattributeAttr, cppValue); 3742 } 3743 3744 static void limitedToOnlyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3745 { 3746 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3747 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3748 TestObjectV8Internal::limitedToOnlyAttributeAttributeSetter(v8Value, info); 3749 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3750 } 3751 3752 static void limitedToOnlyOtherAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3753 { 3754 v8::Handle<v8::Object> holder = info.Holder(); 3755 TestObject* impl = V8TestObject::toImpl(holder); 3756 String cppValue(impl->fastGetAttribute(HTMLNames::otherAttr)); 3757 if (cppValue.isEmpty()) { 3758 ; 3759 } else if (equalIgnoringCase(cppValue, "Value1")) { 3760 cppValue = "Value1"; 3761 } else if (equalIgnoringCase(cppValue, "Value2")) { 3762 cppValue = "Value2"; 3763 } else { 3764 cppValue = ""; 3765 } 3766 v8SetReturnValueString(info, cppValue, info.GetIsolate()); 3767 } 3768 3769 static void limitedToOnlyOtherAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3770 { 3771 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3772 TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetter(info); 3773 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3774 } 3775 3776 static void limitedToOnlyOtherAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3777 { 3778 v8::Handle<v8::Object> holder = info.Holder(); 3779 TestObject* impl = V8TestObject::toImpl(holder); 3780 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3781 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3782 impl->setAttribute(HTMLNames::otherAttr, cppValue); 3783 } 3784 3785 static void limitedToOnlyOtherAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3786 { 3787 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3788 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3789 TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetter(v8Value, info); 3790 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3791 } 3792 3793 static void limitedWithMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3794 { 3795 v8::Handle<v8::Object> holder = info.Holder(); 3796 TestObject* impl = V8TestObject::toImpl(holder); 3797 String cppValue(impl->fastGetAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr)); 3798 if (cppValue.isEmpty()) { 3799 cppValue = "rsa"; 3800 } else if (equalIgnoringCase(cppValue, "rsa")) { 3801 cppValue = "rsa"; 3802 } else if (equalIgnoringCase(cppValue, "dsa")) { 3803 cppValue = "dsa"; 3804 } else { 3805 cppValue = ""; 3806 } 3807 v8SetReturnValueString(info, cppValue, info.GetIsolate()); 3808 } 3809 3810 static void limitedWithMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3811 { 3812 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3813 TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetter(info); 3814 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3815 } 3816 3817 static void limitedWithMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3818 { 3819 v8::Handle<v8::Object> holder = info.Holder(); 3820 TestObject* impl = V8TestObject::toImpl(holder); 3821 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3822 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3823 impl->setAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr, cppValue); 3824 } 3825 3826 static void limitedWithMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3827 { 3828 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3829 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3830 TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetter(v8Value, info); 3831 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3832 } 3833 3834 static void limitedWithInvalidMissingDefaultAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3835 { 3836 v8::Handle<v8::Object> holder = info.Holder(); 3837 TestObject* impl = V8TestObject::toImpl(holder); 3838 String cppValue(impl->fastGetAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr)); 3839 if (cppValue.isEmpty()) { 3840 cppValue = "auto"; 3841 } else if (equalIgnoringCase(cppValue, "ltr")) { 3842 cppValue = "ltr"; 3843 } else if (equalIgnoringCase(cppValue, "rtl")) { 3844 cppValue = "rtl"; 3845 } else if (equalIgnoringCase(cppValue, "auto")) { 3846 cppValue = "auto"; 3847 } else { 3848 cppValue = "ltr"; 3849 } 3850 v8SetReturnValueString(info, cppValue, info.GetIsolate()); 3851 } 3852 3853 static void limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3854 { 3855 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3856 TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetter(info); 3857 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3858 } 3859 3860 static void limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3861 { 3862 v8::Handle<v8::Object> holder = info.Holder(); 3863 TestObject* impl = V8TestObject::toImpl(holder); 3864 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3865 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3866 impl->setAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr, cppValue); 3867 } 3868 3869 static void limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3870 { 3871 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 3872 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 3873 TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8Value, info); 3874 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3875 } 3876 3877 static void corsSettingAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3878 { 3879 v8::Handle<v8::Object> holder = info.Holder(); 3880 TestObject* impl = V8TestObject::toImpl(holder); 3881 String cppValue(impl->fastGetAttribute(HTMLNames::corssettingattributeAttr)); 3882 if (cppValue.isNull()) { 3883 ; 3884 } else if (cppValue.isEmpty()) { 3885 cppValue = "anonymous"; 3886 } else if (equalIgnoringCase(cppValue, "anonymous")) { 3887 cppValue = "anonymous"; 3888 } else if (equalIgnoringCase(cppValue, "use-credentials")) { 3889 cppValue = "use-credentials"; 3890 } else { 3891 cppValue = "anonymous"; 3892 } 3893 v8SetReturnValueString(info, cppValue, info.GetIsolate()); 3894 } 3895 3896 static void corsSettingAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3897 { 3898 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3899 TestObjectV8Internal::corsSettingAttributeAttributeGetter(info); 3900 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3901 } 3902 3903 static void limitedWithEmptyMissingInvalidAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3904 { 3905 v8::Handle<v8::Object> holder = info.Holder(); 3906 TestObject* impl = V8TestObject::toImpl(holder); 3907 String cppValue(impl->fastGetAttribute(HTMLNames::limitedwithemptymissinginvalidattributeAttr)); 3908 if (cppValue.isNull()) { 3909 cppValue = "missing"; 3910 } else if (cppValue.isEmpty()) { 3911 cppValue = "empty"; 3912 } else if (equalIgnoringCase(cppValue, "empty")) { 3913 cppValue = "empty"; 3914 } else if (equalIgnoringCase(cppValue, "missing")) { 3915 cppValue = "missing"; 3916 } else if (equalIgnoringCase(cppValue, "invalid")) { 3917 cppValue = "invalid"; 3918 } else if (equalIgnoringCase(cppValue, "a-normal")) { 3919 cppValue = "a-normal"; 3920 } else { 3921 cppValue = "invalid"; 3922 } 3923 v8SetReturnValueString(info, cppValue, info.GetIsolate()); 3924 } 3925 3926 static void limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3927 { 3928 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3929 TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetter(info); 3930 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3931 } 3932 3933 static void replaceableReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3934 { 3935 v8::Handle<v8::Object> holder = info.Holder(); 3936 TestObject* impl = V8TestObject::toImpl(holder); 3937 v8SetReturnValueInt(info, impl->replaceableReadonlyLongAttribute()); 3938 } 3939 3940 static void replaceableReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3941 { 3942 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3943 TestObjectV8Internal::replaceableReadonlyLongAttributeAttributeGetter(info); 3944 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3945 } 3946 3947 static void locationReplaceableAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3948 { 3949 v8::Handle<v8::Object> holder = info.Holder(); 3950 TestObject* impl = V8TestObject::toImpl(holder); 3951 v8SetReturnValueFast(info, WTF::getPtr(impl->locationReplaceable()), impl); 3952 } 3953 3954 static void locationReplaceableAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3955 { 3956 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3957 TestObjectV8Internal::locationReplaceableAttributeGetter(info); 3958 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3959 } 3960 3961 static void locationReplaceableAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3962 { 3963 v8::Handle<v8::Object> holder = info.Holder(); 3964 TestObject* proxyImpl = V8TestObject::toImpl(holder); 3965 RefPtrWillBeRawPtr<TestNode> impl = WTF::getPtr(proxyImpl->locationReplaceable()); 3966 if (!impl) 3967 return; 3968 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 3969 impl->setHref(cppValue); 3970 } 3971 3972 static void locationReplaceableAttributeSetterCallback(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::locationReplaceableAttributeSetter(v8Value, info); 3976 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3977 } 3978 3979 static void runtimeEnabledLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 3980 { 3981 v8::Handle<v8::Object> holder = info.Holder(); 3982 TestObject* impl = V8TestObject::toImpl(holder); 3983 v8SetReturnValueInt(info, impl->runtimeEnabledLongAttribute()); 3984 } 3985 3986 static void runtimeEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 3987 { 3988 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 3989 TestObjectV8Internal::runtimeEnabledLongAttributeAttributeGetter(info); 3990 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 3991 } 3992 3993 static void runtimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 3994 { 3995 v8::Handle<v8::Object> holder = info.Holder(); 3996 ExceptionState exceptionState(ExceptionState::SetterContext, "runtimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); 3997 TestObject* impl = V8TestObject::toImpl(holder); 3998 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 3999 impl->setRuntimeEnabledLongAttribute(cppValue); 4000 } 4001 4002 static void runtimeEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4003 { 4004 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4005 TestObjectV8Internal::runtimeEnabledLongAttributeAttributeSetter(v8Value, info); 4006 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4007 } 4008 4009 static void perContextEnabledRuntimeEnabledLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4010 { 4011 v8::Handle<v8::Object> holder = info.Holder(); 4012 TestObject* impl = V8TestObject::toImpl(holder); 4013 v8SetReturnValueInt(info, impl->perContextEnabledRuntimeEnabledLongAttribute()); 4014 } 4015 4016 static void perContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4017 { 4018 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4019 TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeGetter(info); 4020 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4021 } 4022 4023 static void perContextEnabledRuntimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4024 { 4025 v8::Handle<v8::Object> holder = info.Holder(); 4026 ExceptionState exceptionState(ExceptionState::SetterContext, "perContextEnabledRuntimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); 4027 TestObject* impl = V8TestObject::toImpl(holder); 4028 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 4029 impl->setPerContextEnabledRuntimeEnabledLongAttribute(cppValue); 4030 } 4031 4032 static void perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4033 { 4034 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4035 TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetter(v8Value, info); 4036 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4037 } 4038 4039 #if ENABLE(CONDITION) 4040 static void conditionalRuntimeEnabledLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4041 { 4042 v8::Handle<v8::Object> holder = info.Holder(); 4043 TestObject* impl = V8TestObject::toImpl(holder); 4044 v8SetReturnValueInt(info, impl->conditionalRuntimeEnabledLongAttribute()); 4045 } 4046 #endif // ENABLE(CONDITION) 4047 4048 #if ENABLE(CONDITION) 4049 static void conditionalRuntimeEnabledLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4050 { 4051 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4052 TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeGetter(info); 4053 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4054 } 4055 #endif // ENABLE(CONDITION) 4056 4057 #if ENABLE(CONDITION) 4058 static void conditionalRuntimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4059 { 4060 v8::Handle<v8::Object> holder = info.Holder(); 4061 ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalRuntimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); 4062 TestObject* impl = V8TestObject::toImpl(holder); 4063 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 4064 impl->setConditionalRuntimeEnabledLongAttribute(cppValue); 4065 } 4066 #endif // ENABLE(CONDITION) 4067 4068 #if ENABLE(CONDITION) 4069 static void conditionalRuntimeEnabledLongAttributeAttributeSetterCallback(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::conditionalRuntimeEnabledLongAttributeAttributeSetter(v8Value, info); 4073 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4074 } 4075 #endif // ENABLE(CONDITION) 4076 4077 static void setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4078 { 4079 v8::Handle<v8::Object> holder = info.Holder(); 4080 TestObject* impl = V8TestObject::toImpl(holder); 4081 v8SetReturnValueString(info, impl->setterCallWithActiveWindowAndFirstWindowStringAttribute(), info.GetIsolate()); 4082 } 4083 4084 static void setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4085 { 4086 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4087 TestObjectV8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGetter(info); 4088 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4089 } 4090 4091 static void setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4092 { 4093 v8::Handle<v8::Object> holder = info.Holder(); 4094 TestObject* impl = V8TestObject::toImpl(holder); 4095 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4096 impl->setSetterCallWithActiveWindowAndFirstWindowStringAttribute(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), cppValue); 4097 } 4098 4099 static void setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4100 { 4101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4102 TestObjectV8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeSetter(v8Value, info); 4103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4104 } 4105 4106 static void setterCallWithExecutionContextStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4107 { 4108 v8::Handle<v8::Object> holder = info.Holder(); 4109 TestObject* impl = V8TestObject::toImpl(holder); 4110 v8SetReturnValueString(info, impl->setterCallWithExecutionContextStringAttribute(), info.GetIsolate()); 4111 } 4112 4113 static void setterCallWithExecutionContextStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4114 { 4115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4116 TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeGetter(info); 4117 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4118 } 4119 4120 static void setterCallWithExecutionContextStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4121 { 4122 v8::Handle<v8::Object> holder = info.Holder(); 4123 TestObject* impl = V8TestObject::toImpl(holder); 4124 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4125 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 4126 impl->setSetterCallWithExecutionContextStringAttribute(executionContext, cppValue); 4127 } 4128 4129 static void setterCallWithExecutionContextStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4130 { 4131 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4132 TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeSetter(v8Value, info); 4133 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4134 } 4135 4136 static void treatNullAsEmptyStringStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4137 { 4138 v8::Handle<v8::Object> holder = info.Holder(); 4139 TestObject* impl = V8TestObject::toImpl(holder); 4140 v8SetReturnValueString(info, impl->treatNullAsEmptyStringStringAttribute(), info.GetIsolate()); 4141 } 4142 4143 static void treatNullAsEmptyStringStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4144 { 4145 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4146 TestObjectV8Internal::treatNullAsEmptyStringStringAttributeAttributeGetter(info); 4147 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4148 } 4149 4150 static void treatNullAsEmptyStringStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4151 { 4152 v8::Handle<v8::Object> holder = info.Holder(); 4153 TestObject* impl = V8TestObject::toImpl(holder); 4154 TOSTRING_VOID(V8StringResource<TreatNullAsEmptyString>, cppValue, v8Value); 4155 impl->setTreatNullAsEmptyStringStringAttribute(cppValue); 4156 } 4157 4158 static void treatNullAsEmptyStringStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4159 { 4160 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4161 TestObjectV8Internal::treatNullAsEmptyStringStringAttributeAttributeSetter(v8Value, info); 4162 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4163 } 4164 4165 static void treatNullAsNullStringStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4166 { 4167 v8::Handle<v8::Object> holder = info.Holder(); 4168 TestObject* impl = V8TestObject::toImpl(holder); 4169 v8SetReturnValueString(info, impl->treatNullAsNullStringStringAttribute(), info.GetIsolate()); 4170 } 4171 4172 static void treatNullAsNullStringStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4173 { 4174 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4175 TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeGetter(info); 4176 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4177 } 4178 4179 static void treatNullAsNullStringStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4180 { 4181 v8::Handle<v8::Object> holder = info.Holder(); 4182 TestObject* impl = V8TestObject::toImpl(holder); 4183 TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, cppValue, v8Value); 4184 impl->setTreatNullAsNullStringStringAttribute(cppValue); 4185 } 4186 4187 static void treatNullAsNullStringStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4188 { 4189 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4190 TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeSetter(v8Value, info); 4191 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4192 } 4193 4194 static void treatReturnedNullStringAsNullStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4195 { 4196 v8::Handle<v8::Object> holder = info.Holder(); 4197 TestObject* impl = V8TestObject::toImpl(holder); 4198 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullStringAttribute(), info.GetIsolate()); 4199 } 4200 4201 static void treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4202 { 4203 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4204 TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeGetter(info); 4205 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4206 } 4207 4208 static void treatReturnedNullStringAsNullStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4209 { 4210 v8::Handle<v8::Object> holder = info.Holder(); 4211 TestObject* impl = V8TestObject::toImpl(holder); 4212 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4213 impl->setTreatReturnedNullStringAsNullStringAttribute(cppValue); 4214 } 4215 4216 static void treatReturnedNullStringAsNullStringAttributeAttributeSetterCallback(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::treatReturnedNullStringAsNullStringAttributeAttributeSetter(v8Value, info); 4220 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4221 } 4222 4223 static void treatReturnedNullStringAsUndefinedStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4224 { 4225 v8::Handle<v8::Object> holder = info.Holder(); 4226 TestObject* impl = V8TestObject::toImpl(holder); 4227 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedStringAttribute(), info.GetIsolate()); 4228 } 4229 4230 static void treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4231 { 4232 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4233 TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetter(info); 4234 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4235 } 4236 4237 static void treatReturnedNullStringAsUndefinedStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4238 { 4239 v8::Handle<v8::Object> holder = info.Holder(); 4240 TestObject* impl = V8TestObject::toImpl(holder); 4241 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4242 impl->setTreatReturnedNullStringAsUndefinedStringAttribute(cppValue); 4243 } 4244 4245 static void treatReturnedNullStringAsUndefinedStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4246 { 4247 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4248 TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeSetter(v8Value, info); 4249 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4250 } 4251 4252 static void cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4253 { 4254 v8::Handle<v8::Object> holder = info.Holder(); 4255 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedTreatReturnedNullStringAsUndefinedStringAttribute"); 4256 TestObject* impl = V8TestObject::toImpl(holder); 4257 if (!impl->isStringDirty()) { 4258 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIsolate(), holder, propertyName); 4259 if (!v8Value.IsEmpty()) { 4260 v8SetReturnValue(info, v8Value); 4261 return; 4262 } 4263 } 4264 String cppValue(impl->cachedTreatReturnedNullStringAsUndefinedStringAttribute()); 4265 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, cppValue.isNull() ? v8Undefined() : v8String(info.GetIsolate(), cppValue)); 4266 v8SetReturnValueStringOrUndefined(info, cppValue, info.GetIsolate()); 4267 } 4268 4269 static void cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4270 { 4271 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4272 TestObjectV8Internal::cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeGetter(info); 4273 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4274 } 4275 4276 static void cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4277 { 4278 v8::Handle<v8::Object> holder = info.Holder(); 4279 TestObject* impl = V8TestObject::toImpl(holder); 4280 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4281 impl->setCachedTreatReturnedNullStringAsUndefinedStringAttribute(cppValue); 4282 V8HiddenValue::deleteHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "cachedTreatReturnedNullStringAsUndefinedStringAttribute")); // Invalidate the cached value. 4283 } 4284 4285 static void cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4286 { 4287 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4288 TestObjectV8Internal::cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeSetter(v8Value, info); 4289 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4290 } 4291 4292 static void treatReturnedNullStringAsNullByteStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4293 { 4294 v8::Handle<v8::Object> holder = info.Holder(); 4295 TestObject* impl = V8TestObject::toImpl(holder); 4296 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullByteStringAttribute(), info.GetIsolate()); 4297 } 4298 4299 static void treatReturnedNullStringAsNullByteStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4300 { 4301 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4302 TestObjectV8Internal::treatReturnedNullStringAsNullByteStringAttributeAttributeGetter(info); 4303 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4304 } 4305 4306 static void treatReturnedNullStringAsNullByteStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4307 { 4308 v8::Handle<v8::Object> holder = info.Holder(); 4309 ExceptionState exceptionState(ExceptionState::SetterContext, "treatReturnedNullStringAsNullByteStringAttribute", "TestObject", holder, info.GetIsolate()); 4310 TestObject* impl = V8TestObject::toImpl(holder); 4311 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toByteString(v8Value, exceptionState), exceptionState); 4312 impl->setTreatReturnedNullStringAsNullByteStringAttribute(cppValue); 4313 } 4314 4315 static void treatReturnedNullStringAsNullByteStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4316 { 4317 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4318 TestObjectV8Internal::treatReturnedNullStringAsNullByteStringAttributeAttributeSetter(v8Value, info); 4319 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4320 } 4321 4322 static void treatReturnedNullStringAsUndefinedByteStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4323 { 4324 v8::Handle<v8::Object> holder = info.Holder(); 4325 TestObject* impl = V8TestObject::toImpl(holder); 4326 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedByteStringAttribute(), info.GetIsolate()); 4327 } 4328 4329 static void treatReturnedNullStringAsUndefinedByteStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4330 { 4331 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4332 TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringAttributeAttributeGetter(info); 4333 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4334 } 4335 4336 static void treatReturnedNullStringAsUndefinedByteStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4337 { 4338 v8::Handle<v8::Object> holder = info.Holder(); 4339 ExceptionState exceptionState(ExceptionState::SetterContext, "treatReturnedNullStringAsUndefinedByteStringAttribute", "TestObject", holder, info.GetIsolate()); 4340 TestObject* impl = V8TestObject::toImpl(holder); 4341 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toByteString(v8Value, exceptionState), exceptionState); 4342 impl->setTreatReturnedNullStringAsUndefinedByteStringAttribute(cppValue); 4343 } 4344 4345 static void treatReturnedNullStringAsUndefinedByteStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4346 { 4347 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4348 TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringAttributeAttributeSetter(v8Value, info); 4349 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4350 } 4351 4352 static void treatReturnedNullStringAsNullScalarValueStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4353 { 4354 v8::Handle<v8::Object> holder = info.Holder(); 4355 TestObject* impl = V8TestObject::toImpl(holder); 4356 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullScalarValueStringAttribute(), info.GetIsolate()); 4357 } 4358 4359 static void treatReturnedNullStringAsNullScalarValueStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4360 { 4361 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4362 TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringAttributeAttributeGetter(info); 4363 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4364 } 4365 4366 static void treatReturnedNullStringAsNullScalarValueStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4367 { 4368 v8::Handle<v8::Object> holder = info.Holder(); 4369 ExceptionState exceptionState(ExceptionState::SetterContext, "treatReturnedNullStringAsNullScalarValueStringAttribute", "TestObject", holder, info.GetIsolate()); 4370 TestObject* impl = V8TestObject::toImpl(holder); 4371 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toScalarValueString(v8Value, exceptionState), exceptionState); 4372 impl->setTreatReturnedNullStringAsNullScalarValueStringAttribute(cppValue); 4373 } 4374 4375 static void treatReturnedNullStringAsNullScalarValueStringAttributeAttributeSetterCallback(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::treatReturnedNullStringAsNullScalarValueStringAttributeAttributeSetter(v8Value, info); 4379 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4380 } 4381 4382 static void treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4383 { 4384 v8::Handle<v8::Object> holder = info.Holder(); 4385 TestObject* impl = V8TestObject::toImpl(holder); 4386 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedScalarValueStringAttribute(), info.GetIsolate()); 4387 } 4388 4389 static void treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4390 { 4391 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4392 TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeGetter(info); 4393 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4394 } 4395 4396 static void treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4397 { 4398 v8::Handle<v8::Object> holder = info.Holder(); 4399 ExceptionState exceptionState(ExceptionState::SetterContext, "treatReturnedNullStringAsUndefinedScalarValueStringAttribute", "TestObject", holder, info.GetIsolate()); 4400 TestObject* impl = V8TestObject::toImpl(holder); 4401 TONATIVE_VOID_EXCEPTIONSTATE(V8StringResource<>, cppValue, toScalarValueString(v8Value, exceptionState), exceptionState); 4402 impl->setTreatReturnedNullStringAsUndefinedScalarValueStringAttribute(cppValue); 4403 } 4404 4405 static void treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4406 { 4407 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4408 TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeSetter(v8Value, info); 4409 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4410 } 4411 4412 static void typeCheckingInterfaceFloatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4413 { 4414 v8::Handle<v8::Object> holder = info.Holder(); 4415 TestObject* impl = V8TestObject::toImpl(holder); 4416 v8SetReturnValue(info, impl->typeCheckingInterfaceFloatAttribute()); 4417 } 4418 4419 static void typeCheckingInterfaceFloatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4420 { 4421 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4422 TestObjectV8Internal::typeCheckingInterfaceFloatAttributeAttributeGetter(info); 4423 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4424 } 4425 4426 static void typeCheckingInterfaceFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4427 { 4428 v8::Handle<v8::Object> holder = info.Holder(); 4429 ExceptionState exceptionState(ExceptionState::SetterContext, "typeCheckingInterfaceFloatAttribute", "TestObject", holder, info.GetIsolate()); 4430 TestObject* impl = V8TestObject::toImpl(holder); 4431 TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toFloat(v8Value, exceptionState), exceptionState); 4432 impl->setTypeCheckingInterfaceFloatAttribute(cppValue); 4433 } 4434 4435 static void typeCheckingInterfaceFloatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4436 { 4437 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4438 TestObjectV8Internal::typeCheckingInterfaceFloatAttributeAttributeSetter(v8Value, info); 4439 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4440 } 4441 4442 static void typeCheckingInterfaceTestInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4443 { 4444 v8::Handle<v8::Object> holder = info.Holder(); 4445 TestObject* impl = V8TestObject::toImpl(holder); 4446 v8SetReturnValueFast(info, WTF::getPtr(impl->typeCheckingInterfaceTestInterfaceAttribute()), impl); 4447 } 4448 4449 static void typeCheckingInterfaceTestInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4450 { 4451 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4452 TestObjectV8Internal::typeCheckingInterfaceTestInterfaceAttributeAttributeGetter(info); 4453 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4454 } 4455 4456 static void typeCheckingInterfaceTestInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4457 { 4458 v8::Handle<v8::Object> holder = info.Holder(); 4459 ExceptionState exceptionState(ExceptionState::SetterContext, "typeCheckingInterfaceTestInterfaceAttribute", "TestObject", holder, info.GetIsolate()); 4460 if (!V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { 4461 exceptionState.throwTypeError("The provided value is not of type 'TestInterface'."); 4462 exceptionState.throwIfNeeded(); 4463 return; 4464 } 4465 TestObject* impl = V8TestObject::toImpl(holder); 4466 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value); 4467 impl->setTypeCheckingInterfaceTestInterfaceAttribute(WTF::getPtr(cppValue)); 4468 } 4469 4470 static void typeCheckingInterfaceTestInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4471 { 4472 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4473 TestObjectV8Internal::typeCheckingInterfaceTestInterfaceAttributeAttributeSetter(v8Value, info); 4474 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4475 } 4476 4477 static void typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4478 { 4479 v8::Handle<v8::Object> holder = info.Holder(); 4480 TestObject* impl = V8TestObject::toImpl(holder); 4481 v8SetReturnValueFast(info, WTF::getPtr(impl->typeCheckingInterfaceTestInterfaceOrNullAttribute()), impl); 4482 } 4483 4484 static void typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4485 { 4486 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4487 TestObjectV8Internal::typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeGetter(info); 4488 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4489 } 4490 4491 static void typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4492 { 4493 v8::Handle<v8::Object> holder = info.Holder(); 4494 ExceptionState exceptionState(ExceptionState::SetterContext, "typeCheckingInterfaceTestInterfaceOrNullAttribute", "TestObject", holder, info.GetIsolate()); 4495 if (!isUndefinedOrNull(v8Value) && !V8TestInterface::hasInstance(v8Value, info.GetIsolate())) { 4496 exceptionState.throwTypeError("The provided value is not of type 'TestInterface'."); 4497 exceptionState.throwIfNeeded(); 4498 return; 4499 } 4500 TestObject* impl = V8TestObject::toImpl(holder); 4501 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value); 4502 impl->setTypeCheckingInterfaceTestInterfaceOrNullAttribute(WTF::getPtr(cppValue)); 4503 } 4504 4505 static void typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4506 { 4507 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4508 TestObjectV8Internal::typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeSetter(v8Value, info); 4509 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4510 } 4511 4512 static void urlStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4513 { 4514 v8::Handle<v8::Object> holder = info.Holder(); 4515 TestObject* impl = V8TestObject::toImpl(holder); 4516 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::urlstringattributeAttr), info.GetIsolate()); 4517 } 4518 4519 static void urlStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4520 { 4521 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4522 TestObjectV8Internal::urlStringAttributeAttributeGetter(info); 4523 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4524 } 4525 4526 static void urlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4527 { 4528 v8::Handle<v8::Object> holder = info.Holder(); 4529 TestObject* impl = V8TestObject::toImpl(holder); 4530 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4531 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 4532 impl->setAttribute(HTMLNames::urlstringattributeAttr, cppValue); 4533 } 4534 4535 static void urlStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4536 { 4537 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4538 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 4539 TestObjectV8Internal::urlStringAttributeAttributeSetter(v8Value, info); 4540 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4541 } 4542 4543 static void urlStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4544 { 4545 v8::Handle<v8::Object> holder = info.Holder(); 4546 TestObject* impl = V8TestObject::toImpl(holder); 4547 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflectUrlAttributeAttr), info.GetIsolate()); 4548 } 4549 4550 static void urlStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4551 { 4552 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4553 TestObjectV8Internal::urlStringAttributeAttributeGetter(info); 4554 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4555 } 4556 4557 static void urlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4558 { 4559 v8::Handle<v8::Object> holder = info.Holder(); 4560 TestObject* impl = V8TestObject::toImpl(holder); 4561 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4562 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 4563 impl->setAttribute(HTMLNames::reflectUrlAttributeAttr, cppValue); 4564 } 4565 4566 static void urlStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4567 { 4568 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4569 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 4570 TestObjectV8Internal::urlStringAttributeAttributeSetter(v8Value, info); 4571 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4572 } 4573 4574 static void unforgeableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4575 { 4576 v8::Handle<v8::Object> holder = info.Holder(); 4577 TestObject* impl = V8TestObject::toImpl(holder); 4578 v8SetReturnValueInt(info, impl->unforgeableLongAttribute()); 4579 } 4580 4581 static void unforgeableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4582 { 4583 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4584 TestObjectV8Internal::unforgeableLongAttributeAttributeGetter(info); 4585 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4586 } 4587 4588 static void unforgeableLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4589 { 4590 v8::Handle<v8::Object> holder = info.Holder(); 4591 ExceptionState exceptionState(ExceptionState::SetterContext, "unforgeableLongAttribute", "TestObject", holder, info.GetIsolate()); 4592 TestObject* impl = V8TestObject::toImpl(holder); 4593 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState); 4594 impl->setUnforgeableLongAttribute(cppValue); 4595 } 4596 4597 static void unforgeableLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4598 { 4599 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4600 TestObjectV8Internal::unforgeableLongAttributeAttributeSetter(v8Value, info); 4601 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4602 } 4603 4604 static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4605 { 4606 v8::Handle<v8::Object> holder = info.Holder(); 4607 TestObject* impl = V8TestObject::toImpl(holder); 4608 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl); 4609 } 4610 4611 static void testInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4612 { 4613 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4614 TestObjectV8Internal::testInterfaceAttributeAttributeGetter(info); 4615 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4616 } 4617 4618 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4619 { 4620 v8::Handle<v8::Object> holder = info.Holder(); 4621 TestObject* impl = V8TestObject::toImpl(holder); 4622 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value); 4623 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue)); 4624 } 4625 4626 static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4627 { 4628 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4629 TestObjectV8Internal::testInterfaceAttributeAttributeSetter(v8Value, info); 4630 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4631 } 4632 4633 static void testInterfaceGarbageCollectedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4634 { 4635 v8::Handle<v8::Object> holder = info.Holder(); 4636 TestObject* impl = V8TestObject::toImpl(holder); 4637 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceGarbageCollectedAttribute()), impl); 4638 } 4639 4640 static void testInterfaceGarbageCollectedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4641 { 4642 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4643 TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeGetter(info); 4644 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4645 } 4646 4647 static void testInterfaceGarbageCollectedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4648 { 4649 v8::Handle<v8::Object> holder = info.Holder(); 4650 TestObject* impl = V8TestObject::toImpl(holder); 4651 TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value); 4652 impl->setTestInterfaceGarbageCollectedAttribute(WTF::getPtr(cppValue)); 4653 } 4654 4655 static void testInterfaceGarbageCollectedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4656 { 4657 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4658 TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeSetter(v8Value, info); 4659 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4660 } 4661 4662 static void testInterfaceGarbageCollectedOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4663 { 4664 v8::Handle<v8::Object> holder = info.Holder(); 4665 TestObject* impl = V8TestObject::toImpl(holder); 4666 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceGarbageCollectedOrNullAttribute()), impl); 4667 } 4668 4669 static void testInterfaceGarbageCollectedOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4670 { 4671 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4672 TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeGetter(info); 4673 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4674 } 4675 4676 static void testInterfaceGarbageCollectedOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4677 { 4678 v8::Handle<v8::Object> holder = info.Holder(); 4679 TestObject* impl = V8TestObject::toImpl(holder); 4680 TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value); 4681 impl->setTestInterfaceGarbageCollectedOrNullAttribute(WTF::getPtr(cppValue)); 4682 } 4683 4684 static void testInterfaceGarbageCollectedOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4685 { 4686 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4687 TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeSetter(v8Value, info); 4688 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4689 } 4690 4691 static void testInterfaceWillBeGarbageCollectedAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4692 { 4693 v8::Handle<v8::Object> holder = info.Holder(); 4694 TestObject* impl = V8TestObject::toImpl(holder); 4695 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceWillBeGarbageCollectedAttribute()), impl); 4696 } 4697 4698 static void testInterfaceWillBeGarbageCollectedAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4699 { 4700 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4701 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeGetter(info); 4702 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4703 } 4704 4705 static void testInterfaceWillBeGarbageCollectedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4706 { 4707 v8::Handle<v8::Object> holder = info.Holder(); 4708 TestObject* impl = V8TestObject::toImpl(holder); 4709 TestInterfaceWillBeGarbageCollected* cppValue = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value); 4710 impl->setTestInterfaceWillBeGarbageCollectedAttribute(WTF::getPtr(cppValue)); 4711 } 4712 4713 static void testInterfaceWillBeGarbageCollectedAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4714 { 4715 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4716 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeSetter(v8Value, info); 4717 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4718 } 4719 4720 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4721 { 4722 v8::Handle<v8::Object> holder = info.Holder(); 4723 TestObject* impl = V8TestObject::toImpl(holder); 4724 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceWillBeGarbageCollectedOrNullAttribute()), impl); 4725 } 4726 4727 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4728 { 4729 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4730 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetter(info); 4731 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4732 } 4733 4734 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4735 { 4736 v8::Handle<v8::Object> holder = info.Holder(); 4737 TestObject* impl = V8TestObject::toImpl(holder); 4738 TestInterfaceWillBeGarbageCollected* cppValue = V8TestInterfaceWillBeGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value); 4739 impl->setTestInterfaceWillBeGarbageCollectedOrNullAttribute(WTF::getPtr(cppValue)); 4740 } 4741 4742 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4743 { 4744 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4745 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetter(v8Value, info); 4746 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4747 } 4748 4749 static void readonlyShortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4750 { 4751 v8::Handle<v8::Object> holder = info.Holder(); 4752 TestObject* impl = V8TestObject::toImpl(holder); 4753 int result = 0; 4754 if (!V8TestObject::PrivateScript::readonlyShortAttributeAttributeGetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result)) 4755 return; 4756 v8SetReturnValueInt(info, result); 4757 } 4758 4759 static void readonlyShortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4760 { 4761 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4762 TestObjectV8Internal::readonlyShortAttributeAttributeGetter(info); 4763 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4764 } 4765 4766 static void shortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4767 { 4768 v8::Handle<v8::Object> holder = info.Holder(); 4769 TestObject* impl = V8TestObject::toImpl(holder); 4770 int result = 0; 4771 if (!V8TestObject::PrivateScript::shortAttributeAttributeGetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result)) 4772 return; 4773 v8SetReturnValueInt(info, result); 4774 } 4775 4776 static void shortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4777 { 4778 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4779 TestObjectV8Internal::shortAttributeAttributeGetter(info); 4780 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4781 } 4782 4783 static void shortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4784 { 4785 v8::Handle<v8::Object> holder = info.Holder(); 4786 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute", "TestObject", holder, info.GetIsolate()); 4787 TestObject* impl = V8TestObject::toImpl(holder); 4788 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState); 4789 V8TestObject::PrivateScript::shortAttributeAttributeSetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, cppValue); 4790 } 4791 4792 static void shortAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4793 { 4794 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4795 TestObjectV8Internal::shortAttributeAttributeSetter(v8Value, info); 4796 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4797 } 4798 4799 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4800 { 4801 v8::Handle<v8::Object> holder = info.Holder(); 4802 TestObject* impl = V8TestObject::toImpl(holder); 4803 String result; 4804 if (!V8TestObject::PrivateScript::stringAttributeAttributeGetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result)) 4805 return; 4806 v8SetReturnValueString(info, result, info.GetIsolate()); 4807 } 4808 4809 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4810 { 4811 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4812 TestObjectV8Internal::stringAttributeAttributeGetter(info); 4813 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4814 } 4815 4816 static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4817 { 4818 v8::Handle<v8::Object> holder = info.Holder(); 4819 TestObject* impl = V8TestObject::toImpl(holder); 4820 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4821 V8TestObject::PrivateScript::stringAttributeAttributeSetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, cppValue); 4822 } 4823 4824 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4825 { 4826 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4827 TestObjectV8Internal::stringAttributeAttributeSetter(v8Value, info); 4828 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4829 } 4830 4831 static void nodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4832 { 4833 v8::Handle<v8::Object> holder = info.Holder(); 4834 TestObject* impl = V8TestObject::toImpl(holder); 4835 RefPtrWillBeRawPtr<Node> result = nullptr; 4836 if (!V8TestObject::PrivateScript::nodeAttributeAttributeGetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result)) 4837 return; 4838 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); 4839 } 4840 4841 static void nodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4842 { 4843 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4844 TestObjectV8Internal::nodeAttributeAttributeGetter(info); 4845 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4846 } 4847 4848 static void nodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4849 { 4850 v8::Handle<v8::Object> holder = info.Holder(); 4851 TestObject* impl = V8TestObject::toImpl(holder); 4852 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); 4853 V8TestObject::PrivateScript::nodeAttributeAttributeSetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, cppValue); 4854 } 4855 4856 static void nodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4857 { 4858 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4859 TestObjectV8Internal::nodeAttributeAttributeSetter(v8Value, info); 4860 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4861 } 4862 4863 static void attributeImplementedInCPPForPrivateScriptOnlyAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4864 { 4865 v8::Handle<v8::Object> holder = info.Holder(); 4866 TestObject* impl = V8TestObject::toImpl(holder); 4867 v8SetReturnValueString(info, impl->attributeImplementedInCPPForPrivateScriptOnly(), info.GetIsolate()); 4868 } 4869 4870 static void attributeImplementedInCPPForPrivateScriptOnlyAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4871 { 4872 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4873 TestObjectV8Internal::attributeImplementedInCPPForPrivateScriptOnlyAttributeGetter(info); 4874 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4875 } 4876 4877 static void attributeImplementedInCPPForPrivateScriptOnlyAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4878 { 4879 v8::Handle<v8::Object> holder = info.Holder(); 4880 TestObject* impl = V8TestObject::toImpl(holder); 4881 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4882 impl->setAttributeImplementedInCPPForPrivateScriptOnly(cppValue); 4883 } 4884 4885 static void attributeImplementedInCPPForPrivateScriptOnlyAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4886 { 4887 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4888 TestObjectV8Internal::attributeImplementedInCPPForPrivateScriptOnlyAttributeSetter(v8Value, info); 4889 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4890 } 4891 4892 static void enumForPrivateScriptAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 4893 { 4894 v8::Handle<v8::Object> holder = info.Holder(); 4895 TestObject* impl = V8TestObject::toImpl(holder); 4896 String result; 4897 if (!V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result)) 4898 return; 4899 v8SetReturnValueString(info, result, info.GetIsolate()); 4900 } 4901 4902 static void enumForPrivateScriptAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4903 { 4904 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4905 TestObjectV8Internal::enumForPrivateScriptAttributeGetter(info); 4906 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4907 } 4908 4909 static void enumForPrivateScriptAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4910 { 4911 v8::Handle<v8::Object> holder = info.Holder(); 4912 TestObject* impl = V8TestObject::toImpl(holder); 4913 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); 4914 String string = cppValue; 4915 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) 4916 return; 4917 V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, cppValue); 4918 } 4919 4920 static void enumForPrivateScriptAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4921 { 4922 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 4923 TestObjectV8Internal::enumForPrivateScriptAttributeSetter(v8Value, info); 4924 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4925 } 4926 4927 static void TestObjectConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 4928 { 4929 v8::Handle<v8::Value> data = info.Data(); 4930 ASSERT(data->IsExternal()); 4931 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); 4932 if (!perContextData) 4933 return; 4934 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data))); 4935 } 4936 4937 static void testInterfaceEmptyConstructorAttributeConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) 4938 { 4939 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4940 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::deprecatedTestInterfaceEmptyConstructorAttribute); 4941 TestObjectV8Internal::TestObjectConstructorGetter(property, info); 4942 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4943 } 4944 4945 static void measureAsFeatureNameTestInterfaceEmptyConstructorAttributeConstructorGetterCallback(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) 4946 { 4947 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); 4948 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::FeatureName); 4949 TestObjectV8Internal::TestObjectConstructorGetter(property, info); 4950 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4951 } 4952 4953 static void TestObjectForceSetAttributeOnThis(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4954 { 4955 if (info.This()->IsObject()) 4956 v8::Handle<v8::Object>::Cast(info.This())->ForceSet(name, v8Value); 4957 } 4958 4959 static void TestObjectForceSetAttributeOnThisCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 4960 { 4961 TestObjectV8Internal::TestObjectForceSetAttributeOnThis(name, v8Value, info); 4962 } 4963 4964 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4965 { 4966 TestObject* impl = V8TestObject::toImpl(info.Holder()); 4967 impl->voidMethod(); 4968 } 4969 4970 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4971 { 4972 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 4973 TestObjectV8Internal::voidMethodMethod(info); 4974 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4975 } 4976 4977 static void staticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4978 { 4979 TestObject::staticVoidMethod(); 4980 } 4981 4982 static void staticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4983 { 4984 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 4985 TestObjectV8Internal::staticVoidMethodMethod(info); 4986 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 4987 } 4988 4989 static void dateMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4990 { 4991 TestObject* impl = V8TestObject::toImpl(info.Holder()); 4992 v8SetReturnValue(info, v8DateOrNaN(impl->dateMethod(), info.GetIsolate())); 4993 } 4994 4995 static void dateMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 4996 { 4997 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 4998 TestObjectV8Internal::dateMethodMethod(info); 4999 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5000 } 5001 5002 static void stringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5003 { 5004 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5005 v8SetReturnValueString(info, impl->stringMethod(), info.GetIsolate()); 5006 } 5007 5008 static void stringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5009 { 5010 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5011 TestObjectV8Internal::stringMethodMethod(info); 5012 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5013 } 5014 5015 static void byteStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5016 { 5017 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5018 v8SetReturnValueString(info, impl->byteStringMethod(), info.GetIsolate()); 5019 } 5020 5021 static void byteStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5022 { 5023 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5024 TestObjectV8Internal::byteStringMethodMethod(info); 5025 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5026 } 5027 5028 static void scalarValueStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5029 { 5030 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5031 v8SetReturnValueString(info, impl->scalarValueStringMethod(), info.GetIsolate()); 5032 } 5033 5034 static void scalarValueStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5035 { 5036 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5037 TestObjectV8Internal::scalarValueStringMethodMethod(info); 5038 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5039 } 5040 5041 static void readonlyDOMTimeStampMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5042 { 5043 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5044 v8SetReturnValue(info, static_cast<double>(impl->readonlyDOMTimeStampMethod())); 5045 } 5046 5047 static void readonlyDOMTimeStampMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5048 { 5049 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5050 TestObjectV8Internal::readonlyDOMTimeStampMethodMethod(info); 5051 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5052 } 5053 5054 static void booleanMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5055 { 5056 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5057 v8SetReturnValueBool(info, impl->booleanMethod()); 5058 } 5059 5060 static void booleanMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5061 { 5062 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5063 TestObjectV8Internal::booleanMethodMethod(info); 5064 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5065 } 5066 5067 static void byteMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5068 { 5069 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5070 v8SetReturnValueInt(info, impl->byteMethod()); 5071 } 5072 5073 static void byteMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5074 { 5075 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5076 TestObjectV8Internal::byteMethodMethod(info); 5077 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5078 } 5079 5080 static void doubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5081 { 5082 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5083 v8SetReturnValue(info, impl->doubleMethod()); 5084 } 5085 5086 static void doubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5087 { 5088 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5089 TestObjectV8Internal::doubleMethodMethod(info); 5090 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5091 } 5092 5093 static void floatMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5094 { 5095 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5096 v8SetReturnValue(info, impl->floatMethod()); 5097 } 5098 5099 static void floatMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5100 { 5101 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5102 TestObjectV8Internal::floatMethodMethod(info); 5103 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5104 } 5105 5106 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5107 { 5108 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5109 v8SetReturnValueInt(info, impl->longMethod()); 5110 } 5111 5112 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5113 { 5114 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5115 TestObjectV8Internal::longMethodMethod(info); 5116 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5117 } 5118 5119 static void longLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5120 { 5121 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5122 v8SetReturnValue(info, static_cast<double>(impl->longLongMethod())); 5123 } 5124 5125 static void longLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5126 { 5127 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5128 TestObjectV8Internal::longLongMethodMethod(info); 5129 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5130 } 5131 5132 static void octetMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5133 { 5134 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5135 v8SetReturnValueUnsigned(info, impl->octetMethod()); 5136 } 5137 5138 static void octetMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5139 { 5140 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5141 TestObjectV8Internal::octetMethodMethod(info); 5142 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5143 } 5144 5145 static void shortMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5146 { 5147 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5148 v8SetReturnValueInt(info, impl->shortMethod()); 5149 } 5150 5151 static void shortMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5152 { 5153 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5154 TestObjectV8Internal::shortMethodMethod(info); 5155 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5156 } 5157 5158 static void unsignedLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5159 { 5160 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5161 v8SetReturnValueUnsigned(info, impl->unsignedLongMethod()); 5162 } 5163 5164 static void unsignedLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5165 { 5166 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5167 TestObjectV8Internal::unsignedLongMethodMethod(info); 5168 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5169 } 5170 5171 static void unsignedLongLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5172 { 5173 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5174 v8SetReturnValue(info, static_cast<double>(impl->unsignedLongLongMethod())); 5175 } 5176 5177 static void unsignedLongLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5178 { 5179 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5180 TestObjectV8Internal::unsignedLongLongMethodMethod(info); 5181 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5182 } 5183 5184 static void unsignedShortMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5185 { 5186 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5187 v8SetReturnValueUnsigned(info, impl->unsignedShortMethod()); 5188 } 5189 5190 static void unsignedShortMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5191 { 5192 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5193 TestObjectV8Internal::unsignedShortMethodMethod(info); 5194 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5195 } 5196 5197 static void voidMethodDateArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5198 { 5199 if (UNLIKELY(info.Length() < 1)) { 5200 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodDateArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5201 return; 5202 } 5203 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5204 double dateArg; 5205 { 5206 dateArg = toCoreDate(info[0]); 5207 } 5208 impl->voidMethodDateArg(dateArg); 5209 } 5210 5211 static void voidMethodDateArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5212 { 5213 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5214 TestObjectV8Internal::voidMethodDateArgMethod(info); 5215 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5216 } 5217 5218 static void voidMethodStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5219 { 5220 if (UNLIKELY(info.Length() < 1)) { 5221 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodStringArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5222 return; 5223 } 5224 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5225 V8StringResource<> stringArg; 5226 { 5227 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 5228 } 5229 impl->voidMethodStringArg(stringArg); 5230 } 5231 5232 static void voidMethodStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5233 { 5234 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5235 TestObjectV8Internal::voidMethodStringArgMethod(info); 5236 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5237 } 5238 5239 static void voidMethodByteStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5240 { 5241 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodByteStringArg", "TestObject", info.Holder(), info.GetIsolate()); 5242 if (UNLIKELY(info.Length() < 1)) { 5243 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5244 exceptionState.throwIfNeeded(); 5245 return; 5246 } 5247 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5248 V8StringResource<> stringArg; 5249 { 5250 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(stringArg, toByteString(info[0], exceptionState), exceptionState); 5251 } 5252 impl->voidMethodByteStringArg(stringArg); 5253 } 5254 5255 static void voidMethodByteStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5256 { 5257 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5258 TestObjectV8Internal::voidMethodByteStringArgMethod(info); 5259 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5260 } 5261 5262 static void voidMethodScalarValueStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5263 { 5264 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodScalarValueStringArg", "TestObject", info.Holder(), info.GetIsolate()); 5265 if (UNLIKELY(info.Length() < 1)) { 5266 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5267 exceptionState.throwIfNeeded(); 5268 return; 5269 } 5270 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5271 V8StringResource<> scalarValueStringArg; 5272 { 5273 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(scalarValueStringArg, toScalarValueString(info[0], exceptionState), exceptionState); 5274 } 5275 impl->voidMethodScalarValueStringArg(scalarValueStringArg); 5276 } 5277 5278 static void voidMethodScalarValueStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5279 { 5280 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5281 TestObjectV8Internal::voidMethodScalarValueStringArgMethod(info); 5282 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5283 } 5284 5285 static void voidMethodDOMTimeStampArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5286 { 5287 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDOMTimeStampArg", "TestObject", info.Holder(), info.GetIsolate()); 5288 if (UNLIKELY(info.Length() < 1)) { 5289 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5290 exceptionState.throwIfNeeded(); 5291 return; 5292 } 5293 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5294 unsigned long long domTimeStampArg; 5295 { 5296 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(domTimeStampArg, toUInt64(info[0], exceptionState), exceptionState); 5297 } 5298 impl->voidMethodDOMTimeStampArg(domTimeStampArg); 5299 } 5300 5301 static void voidMethodDOMTimeStampArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5302 { 5303 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5304 TestObjectV8Internal::voidMethodDOMTimeStampArgMethod(info); 5305 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5306 } 5307 5308 static void voidMethodBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5309 { 5310 if (UNLIKELY(info.Length() < 1)) { 5311 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodBooleanArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5312 return; 5313 } 5314 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5315 bool booleanArg; 5316 { 5317 booleanArg = info[0]->BooleanValue(); 5318 } 5319 impl->voidMethodBooleanArg(booleanArg); 5320 } 5321 5322 static void voidMethodBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5323 { 5324 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5325 TestObjectV8Internal::voidMethodBooleanArgMethod(info); 5326 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5327 } 5328 5329 static void voidMethodByteArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5330 { 5331 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodByteArg", "TestObject", info.Holder(), info.GetIsolate()); 5332 if (UNLIKELY(info.Length() < 1)) { 5333 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5334 exceptionState.throwIfNeeded(); 5335 return; 5336 } 5337 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5338 int byteArg; 5339 { 5340 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(byteArg, toInt8(info[0], exceptionState), exceptionState); 5341 } 5342 impl->voidMethodByteArg(byteArg); 5343 } 5344 5345 static void voidMethodByteArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5346 { 5347 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5348 TestObjectV8Internal::voidMethodByteArgMethod(info); 5349 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5350 } 5351 5352 static void voidMethodDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5353 { 5354 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleArg", "TestObject", info.Holder(), info.GetIsolate()); 5355 if (UNLIKELY(info.Length() < 1)) { 5356 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5357 exceptionState.throwIfNeeded(); 5358 return; 5359 } 5360 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5361 double doubleArg; 5362 { 5363 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], exceptionState), exceptionState); 5364 } 5365 impl->voidMethodDoubleArg(doubleArg); 5366 } 5367 5368 static void voidMethodDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5369 { 5370 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5371 TestObjectV8Internal::voidMethodDoubleArgMethod(info); 5372 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5373 } 5374 5375 static void voidMethodFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5376 { 5377 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodFloatArg", "TestObject", info.Holder(), info.GetIsolate()); 5378 if (UNLIKELY(info.Length() < 1)) { 5379 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5380 exceptionState.throwIfNeeded(); 5381 return; 5382 } 5383 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5384 float floatArg; 5385 { 5386 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toFloat(info[0], exceptionState), exceptionState); 5387 } 5388 impl->voidMethodFloatArg(floatArg); 5389 } 5390 5391 static void voidMethodFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5392 { 5393 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5394 TestObjectV8Internal::voidMethodFloatArgMethod(info); 5395 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5396 } 5397 5398 static void voidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5399 { 5400 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArg", "TestObject", info.Holder(), info.GetIsolate()); 5401 if (UNLIKELY(info.Length() < 1)) { 5402 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5403 exceptionState.throwIfNeeded(); 5404 return; 5405 } 5406 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5407 int longArg; 5408 { 5409 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 5410 } 5411 impl->voidMethodLongArg(longArg); 5412 } 5413 5414 static void voidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5415 { 5416 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5417 TestObjectV8Internal::voidMethodLongArgMethod(info); 5418 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5419 } 5420 5421 static void voidMethodLongLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5422 { 5423 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongLongArg", "TestObject", info.Holder(), info.GetIsolate()); 5424 if (UNLIKELY(info.Length() < 1)) { 5425 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5426 exceptionState.throwIfNeeded(); 5427 return; 5428 } 5429 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5430 long long longLongArg; 5431 { 5432 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longLongArg, toInt64(info[0], exceptionState), exceptionState); 5433 } 5434 impl->voidMethodLongLongArg(longLongArg); 5435 } 5436 5437 static void voidMethodLongLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5438 { 5439 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5440 TestObjectV8Internal::voidMethodLongLongArgMethod(info); 5441 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5442 } 5443 5444 static void voidMethodOctetArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5445 { 5446 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodOctetArg", "TestObject", info.Holder(), info.GetIsolate()); 5447 if (UNLIKELY(info.Length() < 1)) { 5448 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5449 exceptionState.throwIfNeeded(); 5450 return; 5451 } 5452 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5453 unsigned octetArg; 5454 { 5455 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(octetArg, toUInt8(info[0], exceptionState), exceptionState); 5456 } 5457 impl->voidMethodOctetArg(octetArg); 5458 } 5459 5460 static void voidMethodOctetArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5461 { 5462 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5463 TestObjectV8Internal::voidMethodOctetArgMethod(info); 5464 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5465 } 5466 5467 static void voidMethodShortArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5468 { 5469 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodShortArg", "TestObject", info.Holder(), info.GetIsolate()); 5470 if (UNLIKELY(info.Length() < 1)) { 5471 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5472 exceptionState.throwIfNeeded(); 5473 return; 5474 } 5475 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5476 int shortArg; 5477 { 5478 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(shortArg, toInt16(info[0], exceptionState), exceptionState); 5479 } 5480 impl->voidMethodShortArg(shortArg); 5481 } 5482 5483 static void voidMethodShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5484 { 5485 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5486 TestObjectV8Internal::voidMethodShortArgMethod(info); 5487 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5488 } 5489 5490 static void voidMethodUnsignedLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5491 { 5492 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedLongArg", "TestObject", info.Holder(), info.GetIsolate()); 5493 if (UNLIKELY(info.Length() < 1)) { 5494 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5495 exceptionState.throwIfNeeded(); 5496 return; 5497 } 5498 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5499 unsigned unsignedLongArg; 5500 { 5501 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(unsignedLongArg, toUInt32(info[0], exceptionState), exceptionState); 5502 } 5503 impl->voidMethodUnsignedLongArg(unsignedLongArg); 5504 } 5505 5506 static void voidMethodUnsignedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5507 { 5508 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5509 TestObjectV8Internal::voidMethodUnsignedLongArgMethod(info); 5510 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5511 } 5512 5513 static void voidMethodUnsignedLongLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5514 { 5515 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedLongLongArg", "TestObject", info.Holder(), info.GetIsolate()); 5516 if (UNLIKELY(info.Length() < 1)) { 5517 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5518 exceptionState.throwIfNeeded(); 5519 return; 5520 } 5521 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5522 unsigned long long unsignedLongLongArg; 5523 { 5524 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(unsignedLongLongArg, toUInt64(info[0], exceptionState), exceptionState); 5525 } 5526 impl->voidMethodUnsignedLongLongArg(unsignedLongLongArg); 5527 } 5528 5529 static void voidMethodUnsignedLongLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5530 { 5531 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5532 TestObjectV8Internal::voidMethodUnsignedLongLongArgMethod(info); 5533 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5534 } 5535 5536 static void voidMethodUnsignedShortArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5537 { 5538 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedShortArg", "TestObject", info.Holder(), info.GetIsolate()); 5539 if (UNLIKELY(info.Length() < 1)) { 5540 setMinimumArityTypeError(exceptionState, 1, info.Length()); 5541 exceptionState.throwIfNeeded(); 5542 return; 5543 } 5544 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5545 unsigned unsignedShortArg; 5546 { 5547 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(unsignedShortArg, toUInt16(info[0], exceptionState), exceptionState); 5548 } 5549 impl->voidMethodUnsignedShortArg(unsignedShortArg); 5550 } 5551 5552 static void voidMethodUnsignedShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5553 { 5554 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5555 TestObjectV8Internal::voidMethodUnsignedShortArgMethod(info); 5556 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5557 } 5558 5559 static void testInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5560 { 5561 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5562 v8SetReturnValue(info, impl->testInterfaceEmptyMethod()); 5563 } 5564 5565 static void testInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5566 { 5567 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5568 TestObjectV8Internal::testInterfaceEmptyMethodMethod(info); 5569 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5570 } 5571 5572 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5573 { 5574 if (UNLIKELY(info.Length() < 1)) { 5575 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5576 return; 5577 } 5578 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5579 TestInterfaceEmpty* testInterfaceEmptyArg; 5580 { 5581 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 5582 } 5583 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 5584 } 5585 5586 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5587 { 5588 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5589 TestObjectV8Internal::voidMethodTestInterfaceEmptyArgMethod(info); 5590 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5591 } 5592 5593 static void voidMethodLongArgTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5594 { 5595 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate()); 5596 if (UNLIKELY(info.Length() < 2)) { 5597 setMinimumArityTypeError(exceptionState, 2, info.Length()); 5598 exceptionState.throwIfNeeded(); 5599 return; 5600 } 5601 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5602 int longArg; 5603 TestInterfaceEmpty* testInterfaceEmptyArg; 5604 { 5605 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 5606 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]); 5607 } 5608 impl->voidMethodLongArgTestInterfaceEmptyArg(longArg, testInterfaceEmptyArg); 5609 } 5610 5611 static void voidMethodLongArgTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5612 { 5613 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5614 TestObjectV8Internal::voidMethodLongArgTestInterfaceEmptyArgMethod(info); 5615 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5616 } 5617 5618 static void voidCallbackFunctionMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5619 { 5620 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5621 v8SetReturnValue(info, impl->voidCallbackFunctionMethod().v8Value()); 5622 } 5623 5624 static void voidCallbackFunctionMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5625 { 5626 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5627 TestObjectV8Internal::voidCallbackFunctionMethodMethod(info); 5628 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5629 } 5630 5631 static void anyCallbackFunctionOptionalAnyArgMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5632 { 5633 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5634 v8SetReturnValue(info, impl->anyCallbackFunctionOptionalAnyArgMethod().v8Value()); 5635 } 5636 5637 static void anyCallbackFunctionOptionalAnyArgMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5638 { 5639 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5640 TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgMethodMethod(info); 5641 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5642 } 5643 5644 static void voidMethodVoidCallbackFunctionArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5645 { 5646 if (UNLIKELY(info.Length() < 1)) { 5647 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodVoidCallbackFunctionArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5648 return; 5649 } 5650 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5651 ScriptValue voidCallbackFunctionArg; 5652 { 5653 voidCallbackFunctionArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); 5654 } 5655 impl->voidMethodVoidCallbackFunctionArg(voidCallbackFunctionArg); 5656 } 5657 5658 static void voidMethodVoidCallbackFunctionArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5659 { 5660 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5661 TestObjectV8Internal::voidMethodVoidCallbackFunctionArgMethod(info); 5662 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5663 } 5664 5665 static void voidMethodAnyCallbackFunctionOptionalAnyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5666 { 5667 if (UNLIKELY(info.Length() < 1)) { 5668 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodAnyCallbackFunctionOptionalAnyArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5669 return; 5670 } 5671 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5672 ScriptValue anyCallbackFunctionOptionalAnyArgArg; 5673 { 5674 anyCallbackFunctionOptionalAnyArgArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); 5675 } 5676 impl->voidMethodAnyCallbackFunctionOptionalAnyArg(anyCallbackFunctionOptionalAnyArgArg); 5677 } 5678 5679 static void voidMethodAnyCallbackFunctionOptionalAnyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5680 { 5681 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5682 TestObjectV8Internal::voidMethodAnyCallbackFunctionOptionalAnyArgMethod(info); 5683 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5684 } 5685 5686 static void anyMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5687 { 5688 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5689 v8SetReturnValue(info, impl->anyMethod().v8Value()); 5690 } 5691 5692 static void anyMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5693 { 5694 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5695 TestObjectV8Internal::anyMethodMethod(info); 5696 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5697 } 5698 5699 static void voidMethodEventTargetArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5700 { 5701 if (UNLIKELY(info.Length() < 1)) { 5702 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodEventTargetArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5703 return; 5704 } 5705 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5706 EventTarget* eventTargetArg; 5707 { 5708 eventTargetArg = V8DOMWrapper::isDOMWrapper(info[0]) ? toWrapperTypeInfo(v8::Handle<v8::Object>::Cast(info[0]))->toEventTarget(v8::Handle<v8::Object>::Cast(info[0])) : 0; 5709 } 5710 impl->voidMethodEventTargetArg(eventTargetArg); 5711 } 5712 5713 static void voidMethodEventTargetArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5714 { 5715 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5716 TestObjectV8Internal::voidMethodEventTargetArgMethod(info); 5717 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5718 } 5719 5720 static void voidMethodAnyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5721 { 5722 if (UNLIKELY(info.Length() < 1)) { 5723 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodAnyArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5724 return; 5725 } 5726 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5727 ScriptValue anyArg; 5728 { 5729 anyArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); 5730 } 5731 impl->voidMethodAnyArg(anyArg); 5732 } 5733 5734 static void voidMethodAnyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5735 { 5736 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5737 TestObjectV8Internal::voidMethodAnyArgMethod(info); 5738 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5739 } 5740 5741 static void voidMethodAttrArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5742 { 5743 if (UNLIKELY(info.Length() < 1)) { 5744 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodAttrArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5745 return; 5746 } 5747 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5748 Attr* attrArg; 5749 { 5750 attrArg = V8Attr::toImplWithTypeCheck(info.GetIsolate(), info[0]); 5751 } 5752 impl->voidMethodAttrArg(attrArg); 5753 } 5754 5755 static void voidMethodAttrArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5756 { 5757 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5758 TestObjectV8Internal::voidMethodAttrArgMethod(info); 5759 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5760 } 5761 5762 static void voidMethodDocumentArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5763 { 5764 if (UNLIKELY(info.Length() < 1)) { 5765 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodDocumentArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5766 return; 5767 } 5768 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5769 Document* documentArg; 5770 { 5771 documentArg = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]); 5772 } 5773 impl->voidMethodDocumentArg(documentArg); 5774 } 5775 5776 static void voidMethodDocumentArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5777 { 5778 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5779 TestObjectV8Internal::voidMethodDocumentArgMethod(info); 5780 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5781 } 5782 5783 static void voidMethodDocumentTypeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5784 { 5785 if (UNLIKELY(info.Length() < 1)) { 5786 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodDocumentTypeArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5787 return; 5788 } 5789 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5790 DocumentType* documentTypeArg; 5791 { 5792 documentTypeArg = V8DocumentType::toImplWithTypeCheck(info.GetIsolate(), info[0]); 5793 } 5794 impl->voidMethodDocumentTypeArg(documentTypeArg); 5795 } 5796 5797 static void voidMethodDocumentTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5798 { 5799 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5800 TestObjectV8Internal::voidMethodDocumentTypeArgMethod(info); 5801 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5802 } 5803 5804 static void voidMethodElementArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5805 { 5806 if (UNLIKELY(info.Length() < 1)) { 5807 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodElementArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5808 return; 5809 } 5810 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5811 Element* elementArg; 5812 { 5813 elementArg = V8Element::toImplWithTypeCheck(info.GetIsolate(), info[0]); 5814 } 5815 impl->voidMethodElementArg(elementArg); 5816 } 5817 5818 static void voidMethodElementArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5819 { 5820 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5821 TestObjectV8Internal::voidMethodElementArgMethod(info); 5822 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5823 } 5824 5825 static void voidMethodNodeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5826 { 5827 if (UNLIKELY(info.Length() < 1)) { 5828 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodNodeArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5829 return; 5830 } 5831 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5832 Node* nodeArg; 5833 { 5834 nodeArg = V8Node::toImplWithTypeCheck(info.GetIsolate(), info[0]); 5835 } 5836 impl->voidMethodNodeArg(nodeArg); 5837 } 5838 5839 static void voidMethodNodeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5840 { 5841 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5842 TestObjectV8Internal::voidMethodNodeArgMethod(info); 5843 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5844 } 5845 5846 static void arrayBufferMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5847 { 5848 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5849 v8SetReturnValue(info, impl->arrayBufferMethod()); 5850 } 5851 5852 static void arrayBufferMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5853 { 5854 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5855 TestObjectV8Internal::arrayBufferMethodMethod(info); 5856 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5857 } 5858 5859 static void arrayBufferViewMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5860 { 5861 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5862 v8SetReturnValue(info, impl->arrayBufferViewMethod()); 5863 } 5864 5865 static void arrayBufferViewMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5866 { 5867 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5868 TestObjectV8Internal::arrayBufferViewMethodMethod(info); 5869 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5870 } 5871 5872 static void float32ArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5873 { 5874 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5875 v8SetReturnValue(info, impl->float32ArrayMethod()); 5876 } 5877 5878 static void float32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5879 { 5880 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5881 TestObjectV8Internal::float32ArrayMethodMethod(info); 5882 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5883 } 5884 5885 static void int32ArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5886 { 5887 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5888 v8SetReturnValue(info, impl->int32ArrayMethod()); 5889 } 5890 5891 static void int32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5892 { 5893 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5894 TestObjectV8Internal::int32ArrayMethodMethod(info); 5895 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5896 } 5897 5898 static void uint8ArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5899 { 5900 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5901 v8SetReturnValue(info, impl->uint8ArrayMethod()); 5902 } 5903 5904 static void uint8ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5905 { 5906 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5907 TestObjectV8Internal::uint8ArrayMethodMethod(info); 5908 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5909 } 5910 5911 static void voidMethodArrayBufferArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5912 { 5913 if (UNLIKELY(info.Length() < 1)) { 5914 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodArrayBufferArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5915 return; 5916 } 5917 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5918 ArrayBuffer* arrayBufferArg; 5919 { 5920 arrayBufferArg = info[0]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Handle<v8::ArrayBuffer>::Cast(info[0])) : 0; 5921 } 5922 impl->voidMethodArrayBufferArg(arrayBufferArg); 5923 } 5924 5925 static void voidMethodArrayBufferArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5926 { 5927 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5928 TestObjectV8Internal::voidMethodArrayBufferArgMethod(info); 5929 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5930 } 5931 5932 static void voidMethodArrayBufferOrNullArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5933 { 5934 if (UNLIKELY(info.Length() < 1)) { 5935 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodArrayBufferOrNullArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5936 return; 5937 } 5938 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5939 ArrayBuffer* arrayBufferArg; 5940 { 5941 arrayBufferArg = info[0]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Handle<v8::ArrayBuffer>::Cast(info[0])) : 0; 5942 } 5943 impl->voidMethodArrayBufferOrNullArg(arrayBufferArg); 5944 } 5945 5946 static void voidMethodArrayBufferOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5947 { 5948 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5949 TestObjectV8Internal::voidMethodArrayBufferOrNullArgMethod(info); 5950 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5951 } 5952 5953 static void voidMethodArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5954 { 5955 if (UNLIKELY(info.Length() < 1)) { 5956 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodArrayBufferViewArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5957 return; 5958 } 5959 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5960 ArrayBufferView* arrayBufferViewArg; 5961 { 5962 arrayBufferViewArg = info[0]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Handle<v8::ArrayBufferView>::Cast(info[0])) : 0; 5963 } 5964 impl->voidMethodArrayBufferViewArg(arrayBufferViewArg); 5965 } 5966 5967 static void voidMethodArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5968 { 5969 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5970 TestObjectV8Internal::voidMethodArrayBufferViewArgMethod(info); 5971 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5972 } 5973 5974 static void voidMethodFloat32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5975 { 5976 if (UNLIKELY(info.Length() < 1)) { 5977 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodFloat32ArrayArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5978 return; 5979 } 5980 TestObject* impl = V8TestObject::toImpl(info.Holder()); 5981 Float32Array* float32ArrayArg; 5982 { 5983 float32ArrayArg = info[0]->IsFloat32Array() ? V8Float32Array::toImpl(v8::Handle<v8::Float32Array>::Cast(info[0])) : 0; 5984 } 5985 impl->voidMethodFloat32ArrayArg(float32ArrayArg); 5986 } 5987 5988 static void voidMethodFloat32ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 5989 { 5990 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 5991 TestObjectV8Internal::voidMethodFloat32ArrayArgMethod(info); 5992 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 5993 } 5994 5995 static void voidMethodInt32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 5996 { 5997 if (UNLIKELY(info.Length() < 1)) { 5998 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodInt32ArrayArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 5999 return; 6000 } 6001 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6002 Int32Array* int32ArrayArg; 6003 { 6004 int32ArrayArg = info[0]->IsInt32Array() ? V8Int32Array::toImpl(v8::Handle<v8::Int32Array>::Cast(info[0])) : 0; 6005 } 6006 impl->voidMethodInt32ArrayArg(int32ArrayArg); 6007 } 6008 6009 static void voidMethodInt32ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6010 { 6011 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6012 TestObjectV8Internal::voidMethodInt32ArrayArgMethod(info); 6013 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6014 } 6015 6016 static void voidMethodUint8ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6017 { 6018 if (UNLIKELY(info.Length() < 1)) { 6019 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodUint8ArrayArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6020 return; 6021 } 6022 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6023 Uint8Array* uint8ArrayArg; 6024 { 6025 uint8ArrayArg = info[0]->IsUint8Array() ? V8Uint8Array::toImpl(v8::Handle<v8::Uint8Array>::Cast(info[0])) : 0; 6026 } 6027 impl->voidMethodUint8ArrayArg(uint8ArrayArg); 6028 } 6029 6030 static void voidMethodUint8ArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6031 { 6032 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6033 TestObjectV8Internal::voidMethodUint8ArrayArgMethod(info); 6034 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6035 } 6036 6037 static void longArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6038 { 6039 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6040 v8SetReturnValue(info, v8Array(impl->longArrayMethod(), info.Holder(), info.GetIsolate())); 6041 } 6042 6043 static void longArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6044 { 6045 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6046 TestObjectV8Internal::longArrayMethodMethod(info); 6047 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6048 } 6049 6050 static void stringArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6051 { 6052 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6053 v8SetReturnValue(info, v8Array(impl->stringArrayMethod(), info.Holder(), info.GetIsolate())); 6054 } 6055 6056 static void stringArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6057 { 6058 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6059 TestObjectV8Internal::stringArrayMethodMethod(info); 6060 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6061 } 6062 6063 static void testInterfaceEmptyArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6064 { 6065 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6066 v8SetReturnValue(info, v8Array(impl->testInterfaceEmptyArrayMethod(), info.Holder(), info.GetIsolate())); 6067 } 6068 6069 static void testInterfaceEmptyArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6070 { 6071 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6072 TestObjectV8Internal::testInterfaceEmptyArrayMethodMethod(info); 6073 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6074 } 6075 6076 static void voidMethodArrayLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6077 { 6078 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodArrayLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6079 if (UNLIKELY(info.Length() < 1)) { 6080 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6081 exceptionState.throwIfNeeded(); 6082 return; 6083 } 6084 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6085 Vector<int> arrayLongArg; 6086 { 6087 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arrayLongArg, toImplArray<int>(info[0], 1, info.GetIsolate(), exceptionState), exceptionState); 6088 } 6089 impl->voidMethodArrayLongArg(arrayLongArg); 6090 } 6091 6092 static void voidMethodArrayLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6093 { 6094 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6095 TestObjectV8Internal::voidMethodArrayLongArgMethod(info); 6096 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6097 } 6098 6099 static void voidMethodArrayStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6100 { 6101 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodArrayStringArg", "TestObject", info.Holder(), info.GetIsolate()); 6102 if (UNLIKELY(info.Length() < 1)) { 6103 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6104 exceptionState.throwIfNeeded(); 6105 return; 6106 } 6107 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6108 Vector<String> arrayStringArg; 6109 { 6110 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arrayStringArg, toImplArray<String>(info[0], 1, info.GetIsolate(), exceptionState), exceptionState); 6111 } 6112 impl->voidMethodArrayStringArg(arrayStringArg); 6113 } 6114 6115 static void voidMethodArrayStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6116 { 6117 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6118 TestObjectV8Internal::voidMethodArrayStringArgMethod(info); 6119 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6120 } 6121 6122 static void voidMethodArrayTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6123 { 6124 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodArrayTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate()); 6125 if (UNLIKELY(info.Length() < 1)) { 6126 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6127 exceptionState.throwIfNeeded(); 6128 return; 6129 } 6130 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6131 Vector<RefPtr<TestInterfaceEmpty> > arrayTestInterfaceEmptyArg; 6132 { 6133 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arrayTestInterfaceEmptyArg, (toRefPtrNativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(info[0], 1, info.GetIsolate(), exceptionState)), exceptionState); 6134 } 6135 impl->voidMethodArrayTestInterfaceEmptyArg(arrayTestInterfaceEmptyArg); 6136 } 6137 6138 static void voidMethodArrayTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6139 { 6140 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6141 TestObjectV8Internal::voidMethodArrayTestInterfaceEmptyArgMethod(info); 6142 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6143 } 6144 6145 static void longSequenceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6146 { 6147 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6148 v8SetReturnValue(info, v8Array(impl->longSequenceMethod(), info.Holder(), info.GetIsolate())); 6149 } 6150 6151 static void longSequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6152 { 6153 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6154 TestObjectV8Internal::longSequenceMethodMethod(info); 6155 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6156 } 6157 6158 static void stringSequenceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6159 { 6160 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6161 v8SetReturnValue(info, v8Array(impl->stringSequenceMethod(), info.Holder(), info.GetIsolate())); 6162 } 6163 6164 static void stringSequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6165 { 6166 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6167 TestObjectV8Internal::stringSequenceMethodMethod(info); 6168 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6169 } 6170 6171 static void testInterfaceEmptySequenceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6172 { 6173 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6174 v8SetReturnValue(info, v8Array(impl->testInterfaceEmptySequenceMethod(), info.Holder(), info.GetIsolate())); 6175 } 6176 6177 static void testInterfaceEmptySequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6178 { 6179 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6180 TestObjectV8Internal::testInterfaceEmptySequenceMethodMethod(info); 6181 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6182 } 6183 6184 static void voidMethodSequenceLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6185 { 6186 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSequenceLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6187 if (UNLIKELY(info.Length() < 1)) { 6188 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6189 exceptionState.throwIfNeeded(); 6190 return; 6191 } 6192 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6193 Vector<int> longSequenceArg; 6194 { 6195 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longSequenceArg, toImplArray<int>(info[0], 1, info.GetIsolate(), exceptionState), exceptionState); 6196 } 6197 impl->voidMethodSequenceLongArg(longSequenceArg); 6198 } 6199 6200 static void voidMethodSequenceLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6201 { 6202 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6203 TestObjectV8Internal::voidMethodSequenceLongArgMethod(info); 6204 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6205 } 6206 6207 static void voidMethodSequenceStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6208 { 6209 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSequenceStringArg", "TestObject", info.Holder(), info.GetIsolate()); 6210 if (UNLIKELY(info.Length() < 1)) { 6211 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6212 exceptionState.throwIfNeeded(); 6213 return; 6214 } 6215 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6216 Vector<String> stringSequenceArg; 6217 { 6218 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(stringSequenceArg, toImplArray<String>(info[0], 1, info.GetIsolate(), exceptionState), exceptionState); 6219 } 6220 impl->voidMethodSequenceStringArg(stringSequenceArg); 6221 } 6222 6223 static void voidMethodSequenceStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6224 { 6225 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6226 TestObjectV8Internal::voidMethodSequenceStringArgMethod(info); 6227 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6228 } 6229 6230 static void voidMethodSequenceTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6231 { 6232 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSequenceTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate()); 6233 if (UNLIKELY(info.Length() < 1)) { 6234 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6235 exceptionState.throwIfNeeded(); 6236 return; 6237 } 6238 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6239 Vector<RefPtr<TestInterfaceEmpty> > testInterfaceEmptySequenceArg; 6240 { 6241 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(testInterfaceEmptySequenceArg, (toRefPtrNativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(info[0], 1, info.GetIsolate(), exceptionState)), exceptionState); 6242 } 6243 impl->voidMethodSequenceTestInterfaceEmptyArg(testInterfaceEmptySequenceArg); 6244 } 6245 6246 static void voidMethodSequenceTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6247 { 6248 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6249 TestObjectV8Internal::voidMethodSequenceTestInterfaceEmptyArgMethod(info); 6250 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6251 } 6252 6253 static void voidMethodSequenceSequenceDOMStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6254 { 6255 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSequenceSequenceDOMStringArg", "TestObject", info.Holder(), info.GetIsolate()); 6256 if (UNLIKELY(info.Length() < 1)) { 6257 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6258 exceptionState.throwIfNeeded(); 6259 return; 6260 } 6261 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6262 Vector<Vector<String> > stringSequenceSequenceArg; 6263 { 6264 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(stringSequenceSequenceArg, toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState), exceptionState); 6265 } 6266 impl->voidMethodSequenceSequenceDOMStringArg(stringSequenceSequenceArg); 6267 } 6268 6269 static void voidMethodSequenceSequenceDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6270 { 6271 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6272 TestObjectV8Internal::voidMethodSequenceSequenceDOMStringArgMethod(info); 6273 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6274 } 6275 6276 static void nullableLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6277 { 6278 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6279 Nullable<int> result = impl->nullableLongMethod(); 6280 if (result.isNull()) 6281 v8SetReturnValueNull(info); 6282 else 6283 v8SetReturnValueInt(info, result.get()); 6284 } 6285 6286 static void nullableLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6287 { 6288 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6289 TestObjectV8Internal::nullableLongMethodMethod(info); 6290 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6291 } 6292 6293 static void nullableStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6294 { 6295 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6296 v8SetReturnValueStringOrNull(info, impl->nullableStringMethod(), info.GetIsolate()); 6297 } 6298 6299 static void nullableStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6300 { 6301 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6302 TestObjectV8Internal::nullableStringMethodMethod(info); 6303 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6304 } 6305 6306 static void nullableTestInterfaceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6307 { 6308 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6309 v8SetReturnValue(info, impl->nullableTestInterfaceMethod()); 6310 } 6311 6312 static void nullableTestInterfaceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6313 { 6314 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6315 TestObjectV8Internal::nullableTestInterfaceMethodMethod(info); 6316 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6317 } 6318 6319 static void nullableLongSequenceMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6320 { 6321 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6322 Nullable<Vector<int> > result = impl->nullableLongSequenceMethod(); 6323 if (result.isNull()) 6324 v8SetReturnValueNull(info); 6325 else 6326 v8SetReturnValue(info, v8Array(result.get(), info.Holder(), info.GetIsolate())); 6327 } 6328 6329 static void nullableLongSequenceMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6330 { 6331 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6332 TestObjectV8Internal::nullableLongSequenceMethodMethod(info); 6333 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6334 } 6335 6336 static void testInterfaceGarbageCollectedOrDOMStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6337 { 6338 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6339 RawPtr<TestInterfaceGarbageCollected> result0 = nullptr; 6340 String result1; 6341 impl->testInterfaceGarbageCollectedOrDOMStringMethod(result0, result1); 6342 if (result0) { 6343 v8SetReturnValue(info, result0.release()); 6344 return; 6345 } 6346 if (!result1.isNull()) { 6347 v8SetReturnValueString(info, result1, info.GetIsolate()); 6348 return; 6349 } 6350 v8SetReturnValueNull(info); 6351 } 6352 6353 static void testInterfaceGarbageCollectedOrDOMStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6354 { 6355 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6356 TestObjectV8Internal::testInterfaceGarbageCollectedOrDOMStringMethodMethod(info); 6357 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6358 } 6359 6360 static void testInterfaceWillBeGarbageCollectedOrTestDictionaryMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6361 { 6362 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6363 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> result0 = nullptr; 6364 TestDictionary* result1 = nullptr; 6365 impl->testInterfaceWillBeGarbageCollectedOrTestDictionaryMethod(result0, result1); 6366 if (result0) { 6367 v8SetReturnValue(info, result0.release()); 6368 return; 6369 } 6370 if (result1) { 6371 v8SetReturnValue(info, result1); 6372 return; 6373 } 6374 v8SetReturnValueNull(info); 6375 } 6376 6377 static void testInterfaceWillBeGarbageCollectedOrTestDictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6378 { 6379 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6380 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrTestDictionaryMethodMethod(info); 6381 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6382 } 6383 6384 static void longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6385 { 6386 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6387 Nullable<Vector<int> > result0; 6388 Nullable<Vector<String> > result1; 6389 Nullable<double> result2; 6390 impl->longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethod(result0, result1, result2); 6391 if (result0) { 6392 v8SetReturnValue(info, v8Array(result0.get(), info.Holder(), info.GetIsolate())); 6393 return; 6394 } 6395 if (result1) { 6396 v8SetReturnValue(info, v8Array(result1.get(), info.Holder(), info.GetIsolate())); 6397 return; 6398 } 6399 if (result2) { 6400 v8SetReturnValue(info, result2.get()); 6401 return; 6402 } 6403 v8SetReturnValueNull(info); 6404 } 6405 6406 static void longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6407 { 6408 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6409 TestObjectV8Internal::longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethodMethod(info); 6410 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6411 } 6412 6413 static void voidMethodTestInterfaceEmptyOrNullArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6414 { 6415 if (UNLIKELY(info.Length() < 1)) { 6416 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTestInterfaceEmptyOrNullArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6417 return; 6418 } 6419 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6420 TestInterfaceEmpty* nullableTestInterfaceEmptyArg; 6421 { 6422 nullableTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 6423 } 6424 impl->voidMethodTestInterfaceEmptyOrNullArg(nullableTestInterfaceEmptyArg); 6425 } 6426 6427 static void voidMethodTestInterfaceEmptyOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6428 { 6429 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6430 TestObjectV8Internal::voidMethodTestInterfaceEmptyOrNullArgMethod(info); 6431 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6432 } 6433 6434 static void voidMethodTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6435 { 6436 if (UNLIKELY(info.Length() < 1)) { 6437 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTestCallbackInterfaceArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6438 return; 6439 } 6440 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6441 TestCallbackInterface* testCallbackInterfaceArg; 6442 { 6443 if (info.Length() <= 0 || !info[0]->IsFunction()) { 6444 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestCallbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); 6445 return; 6446 } 6447 testCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 6448 } 6449 impl->voidMethodTestCallbackInterfaceArg(testCallbackInterfaceArg); 6450 } 6451 6452 static void voidMethodTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6453 { 6454 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6455 TestObjectV8Internal::voidMethodTestCallbackInterfaceArgMethod(info); 6456 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6457 } 6458 6459 static void voidMethodOptionalTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6460 { 6461 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6462 TestCallbackInterface* optionalTestCallbackInterfaceArg; 6463 { 6464 if (!isUndefinedOrNull(info[0])) { 6465 if (!info[0]->IsFunction()) { 6466 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodOptionalTestCallbackInterfaceArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); 6467 return; 6468 } 6469 optionalTestCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 6470 } else { 6471 optionalTestCallbackInterfaceArg = nullptr; 6472 } 6473 } 6474 impl->voidMethodOptionalTestCallbackInterfaceArg(optionalTestCallbackInterfaceArg); 6475 } 6476 6477 static void voidMethodOptionalTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6478 { 6479 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6480 TestObjectV8Internal::voidMethodOptionalTestCallbackInterfaceArgMethod(info); 6481 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6482 } 6483 6484 static void voidMethodTestCallbackInterfaceOrNullArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6485 { 6486 if (UNLIKELY(info.Length() < 1)) { 6487 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTestCallbackInterfaceOrNullArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6488 return; 6489 } 6490 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6491 TestCallbackInterface* testCallbackInterfaceArg; 6492 { 6493 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { 6494 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestCallbackInterfaceOrNullArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); 6495 return; 6496 } 6497 testCallbackInterfaceArg = info[0]->IsNull() ? nullptr : V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 6498 } 6499 impl->voidMethodTestCallbackInterfaceOrNullArg(testCallbackInterfaceArg); 6500 } 6501 6502 static void voidMethodTestCallbackInterfaceOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6503 { 6504 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6505 TestObjectV8Internal::voidMethodTestCallbackInterfaceOrNullArgMethod(info); 6506 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6507 } 6508 6509 static void testEnumMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6510 { 6511 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6512 v8SetReturnValueString(info, impl->testEnumMethod(), info.GetIsolate()); 6513 } 6514 6515 static void testEnumMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6516 { 6517 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6518 TestObjectV8Internal::testEnumMethodMethod(info); 6519 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6520 } 6521 6522 static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6523 { 6524 if (UNLIKELY(info.Length() < 1)) { 6525 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTestEnumArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6526 return; 6527 } 6528 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6529 V8StringResource<> testEnumTypeArg; 6530 { 6531 TOSTRING_VOID_INTERNAL(testEnumTypeArg, info[0]); 6532 String string = testEnumTypeArg; 6533 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { 6534 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestEnumArg", "TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.GetIsolate()); 6535 return; 6536 } 6537 } 6538 impl->voidMethodTestEnumArg(testEnumTypeArg); 6539 } 6540 6541 static void voidMethodTestEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6542 { 6543 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6544 TestObjectV8Internal::voidMethodTestEnumArgMethod(info); 6545 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6546 } 6547 6548 static void dictionaryMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6549 { 6550 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6551 v8SetReturnValue(info, impl->dictionaryMethod()); 6552 } 6553 6554 static void dictionaryMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6555 { 6556 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6557 TestObjectV8Internal::dictionaryMethodMethod(info); 6558 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6559 } 6560 6561 static void nodeFilterMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6562 { 6563 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6564 v8SetReturnValue(info, impl->nodeFilterMethod()); 6565 } 6566 6567 static void nodeFilterMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6568 { 6569 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6570 TestObjectV8Internal::nodeFilterMethodMethod(info); 6571 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6572 } 6573 6574 static void promiseMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6575 { 6576 ExceptionState exceptionState(ExceptionState::ExecutionContext, "promiseMethod", "TestObject", info.Holder(), info.GetIsolate()); 6577 if (UNLIKELY(info.Length() < 3)) { 6578 setMinimumArityTypeError(exceptionState, 3, info.Length()); 6579 v8SetReturnValue(info, exceptionState.reject(ScriptState::current(info.GetIsolate())).v8Value()); 6580 return; 6581 } 6582 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6583 int arg1; 6584 Dictionary arg2; 6585 V8StringResource<> arg3; 6586 Vector<String> variadic; 6587 { 6588 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg1, toInt32(info[0], exceptionState), exceptionState, info, ScriptState::current(info.GetIsolate())); 6589 if (!isUndefinedOrNull(info[1]) && !info[1]->IsObject()) { 6590 exceptionState.throwTypeError("parameter 2 ('arg2') is not an object."); 6591 v8SetReturnValue(info, exceptionState.reject(ScriptState::current(info.GetIsolate())).v8Value()); 6592 return; 6593 } 6594 arg2 = Dictionary(info[1], info.GetIsolate()); 6595 TOSTRING_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg3, info[2], exceptionState, info, ScriptState::current(info.GetIsolate())); 6596 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(variadic, toImplArguments<String>(info, 3, exceptionState), exceptionState, info, ScriptState::current(info.GetIsolate())); 6597 } 6598 v8SetReturnValue(info, impl->promiseMethod(arg1, arg2, arg3, variadic).v8Value()); 6599 } 6600 6601 static void promiseMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6602 { 6603 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6604 TestObjectV8Internal::promiseMethodMethod(info); 6605 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6606 } 6607 6608 static void promiseMethodWithoutExceptionStateMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6609 { 6610 if (UNLIKELY(info.Length() < 1)) { 6611 v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), createMinimumArityTypeErrorForMethod("promiseMethodWithoutExceptionState", "TestObject", 1, info.Length(), info.GetIsolate()))); 6612 return; 6613 } 6614 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6615 Dictionary arg1; 6616 { 6617 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { 6618 v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), V8ThrowException::createTypeError(ExceptionMessages::failedToExecute("promiseMethodWithoutExceptionState", "TestObject", "parameter 1 ('arg1') is not an object."), info.GetIsolate()))); 6619 return; 6620 } 6621 arg1 = Dictionary(info[0], info.GetIsolate()); 6622 } 6623 v8SetReturnValue(info, impl->promiseMethodWithoutExceptionState(arg1).v8Value()); 6624 } 6625 6626 static void promiseMethodWithoutExceptionStateMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6627 { 6628 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6629 TestObjectV8Internal::promiseMethodWithoutExceptionStateMethod(info); 6630 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6631 } 6632 6633 static void serializedScriptValueMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6634 { 6635 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6636 v8SetReturnValue(info, impl->serializedScriptValueMethod() ? impl->serializedScriptValueMethod()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()))); 6637 } 6638 6639 static void serializedScriptValueMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6640 { 6641 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6642 TestObjectV8Internal::serializedScriptValueMethodMethod(info); 6643 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6644 } 6645 6646 static void xPathNSResolverMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6647 { 6648 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6649 v8SetReturnValue(info, impl->xPathNSResolverMethod()); 6650 } 6651 6652 static void xPathNSResolverMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6653 { 6654 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6655 TestObjectV8Internal::xPathNSResolverMethodMethod(info); 6656 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6657 } 6658 6659 static void voidMethodDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6660 { 6661 if (UNLIKELY(info.Length() < 1)) { 6662 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodDictionaryArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6663 return; 6664 } 6665 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6666 Dictionary dictionaryArg; 6667 { 6668 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { 6669 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodDictionaryArg", "TestObject", "parameter 1 ('dictionaryArg') is not an object."), info.GetIsolate()); 6670 return; 6671 } 6672 dictionaryArg = Dictionary(info[0], info.GetIsolate()); 6673 } 6674 impl->voidMethodDictionaryArg(dictionaryArg); 6675 } 6676 6677 static void voidMethodDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6678 { 6679 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6680 TestObjectV8Internal::voidMethodDictionaryArgMethod(info); 6681 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6682 } 6683 6684 static void voidMethodNodeFilterArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6685 { 6686 if (UNLIKELY(info.Length() < 1)) { 6687 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodNodeFilterArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6688 return; 6689 } 6690 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6691 RefPtrWillBeRawPtr<NodeFilter> nodeFilterArg; 6692 { 6693 nodeFilterArg = toNodeFilter(info[0], info.Holder(), ScriptState::current(info.GetIsolate())); 6694 } 6695 impl->voidMethodNodeFilterArg(nodeFilterArg.release()); 6696 } 6697 6698 static void voidMethodNodeFilterArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6699 { 6700 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6701 TestObjectV8Internal::voidMethodNodeFilterArgMethod(info); 6702 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6703 } 6704 6705 static void voidMethodPromiseArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6706 { 6707 if (UNLIKELY(info.Length() < 1)) { 6708 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodPromiseArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6709 return; 6710 } 6711 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6712 ScriptPromise promiseArg; 6713 { 6714 promiseArg = ScriptPromise::cast(ScriptState::current(info.GetIsolate()), info[0]); 6715 if (!promiseArg.isUndefinedOrNull() && !promiseArg.isObject()) { 6716 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodPromiseArg", "TestObject", "parameter 1 ('promiseArg') is not an object."), info.GetIsolate()); 6717 return; 6718 } 6719 } 6720 impl->voidMethodPromiseArg(promiseArg); 6721 } 6722 6723 static void voidMethodPromiseArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6724 { 6725 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6726 TestObjectV8Internal::voidMethodPromiseArgMethod(info); 6727 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6728 } 6729 6730 static void voidMethodSerializedScriptValueArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6731 { 6732 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSerializedScriptValueArg", "TestObject", info.Holder(), info.GetIsolate()); 6733 if (UNLIKELY(info.Length() < 1)) { 6734 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6735 exceptionState.throwIfNeeded(); 6736 return; 6737 } 6738 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6739 RefPtr<SerializedScriptValue> serializedScriptValueArg; 6740 { 6741 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(serializedScriptValueArg, SerializedScriptValue::create(info[0], 0, 0, exceptionState, info.GetIsolate()), exceptionState); 6742 } 6743 impl->voidMethodSerializedScriptValueArg(serializedScriptValueArg); 6744 } 6745 6746 static void voidMethodSerializedScriptValueArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6747 { 6748 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6749 TestObjectV8Internal::voidMethodSerializedScriptValueArgMethod(info); 6750 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6751 } 6752 6753 static void voidMethodXPathNSResolverArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6754 { 6755 if (UNLIKELY(info.Length() < 1)) { 6756 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodXPathNSResolverArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 6757 return; 6758 } 6759 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6760 RefPtrWillBeRawPtr<XPathNSResolver> xPathNSResolverArg; 6761 { 6762 xPathNSResolverArg = toXPathNSResolver(info[0], info.GetIsolate()); 6763 } 6764 impl->voidMethodXPathNSResolverArg(xPathNSResolverArg.release()); 6765 } 6766 6767 static void voidMethodXPathNSResolverArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6768 { 6769 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6770 TestObjectV8Internal::voidMethodXPathNSResolverArgMethod(info); 6771 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6772 } 6773 6774 static void voidMethodDictionarySequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6775 { 6776 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDictionarySequenceArg", "TestObject", info.Holder(), info.GetIsolate()); 6777 if (UNLIKELY(info.Length() < 1)) { 6778 setMinimumArityTypeError(exceptionState, 1, info.Length()); 6779 exceptionState.throwIfNeeded(); 6780 return; 6781 } 6782 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6783 Vector<Dictionary> dictionarySequenceArg; 6784 { 6785 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(dictionarySequenceArg, toImplArray<Dictionary>(info[0], 1, info.GetIsolate(), exceptionState), exceptionState); 6786 } 6787 impl->voidMethodDictionarySequenceArg(dictionarySequenceArg); 6788 } 6789 6790 static void voidMethodDictionarySequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6791 { 6792 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6793 TestObjectV8Internal::voidMethodDictionarySequenceArgMethod(info); 6794 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6795 } 6796 6797 static void overloadedPromiseMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 6798 { 6799 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPromiseMethod", "TestObject", info.Holder(), info.GetIsolate()); 6800 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6801 int arg; 6802 { 6803 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState, info, ScriptState::current(info.GetIsolate())); 6804 } 6805 v8SetReturnValue(info, impl->overloadedPromiseMethod(arg).v8Value()); 6806 } 6807 6808 static void overloadedPromiseMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 6809 { 6810 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPromiseMethod", "TestObject", info.Holder(), info.GetIsolate()); 6811 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6812 V8StringResource<> arg; 6813 { 6814 TOSTRING_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg, info[0], exceptionState, info, ScriptState::current(info.GetIsolate())); 6815 } 6816 v8SetReturnValue(info, impl->overloadedPromiseMethod(arg).v8Value()); 6817 } 6818 6819 static void overloadedPromiseMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6820 { 6821 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPromiseMethod", "TestObject", info.Holder(), info.GetIsolate()); 6822 switch (std::min(1, info.Length())) { 6823 case 1: 6824 if (info[0]->IsNumber()) { 6825 overloadedPromiseMethod1Method(info); 6826 return; 6827 } 6828 if (true) { 6829 overloadedPromiseMethod2Method(info); 6830 return; 6831 } 6832 if (true) { 6833 overloadedPromiseMethod1Method(info); 6834 return; 6835 } 6836 break; 6837 default: 6838 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 6839 exceptionState.throwIfNeeded(); 6840 return; 6841 } 6842 exceptionState.throwTypeError("No function was found that matched the signature provided."); 6843 exceptionState.throwIfNeeded(); 6844 } 6845 6846 static void overloadedPromiseMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6847 { 6848 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6849 TestObjectV8Internal::overloadedPromiseMethodMethod(info); 6850 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6851 } 6852 6853 static void voidMethodStringArgLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6854 { 6855 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodStringArgLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6856 if (UNLIKELY(info.Length() < 2)) { 6857 setMinimumArityTypeError(exceptionState, 2, info.Length()); 6858 exceptionState.throwIfNeeded(); 6859 return; 6860 } 6861 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6862 V8StringResource<> stringArg; 6863 int longArg; 6864 { 6865 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 6866 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptionState), exceptionState); 6867 } 6868 impl->voidMethodStringArgLongArg(stringArg, longArg); 6869 } 6870 6871 static void voidMethodStringArgLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6872 { 6873 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6874 TestObjectV8Internal::voidMethodStringArgLongArgMethod(info); 6875 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6876 } 6877 6878 static void voidMethodOptionalStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6879 { 6880 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6881 V8StringResource<> optionalStringArg; 6882 { 6883 if (UNLIKELY(info.Length() <= 0)) { 6884 impl->voidMethodOptionalStringArg(); 6885 return; 6886 } 6887 TOSTRING_VOID_INTERNAL(optionalStringArg, info[0]); 6888 } 6889 impl->voidMethodOptionalStringArg(optionalStringArg); 6890 } 6891 6892 static void voidMethodOptionalStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6893 { 6894 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6895 TestObjectV8Internal::voidMethodOptionalStringArgMethod(info); 6896 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6897 } 6898 6899 static void voidMethodOptionalTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6900 { 6901 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6902 TestInterfaceEmpty* optionalTestInterfaceEmptyArg; 6903 { 6904 if (UNLIKELY(info.Length() <= 0)) { 6905 impl->voidMethodOptionalTestInterfaceEmptyArg(); 6906 return; 6907 } 6908 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 6909 } 6910 impl->voidMethodOptionalTestInterfaceEmptyArg(optionalTestInterfaceEmptyArg); 6911 } 6912 6913 static void voidMethodOptionalTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6914 { 6915 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6916 TestObjectV8Internal::voidMethodOptionalTestInterfaceEmptyArgMethod(info); 6917 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6918 } 6919 6920 static void voidMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6921 { 6922 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6923 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6924 int optionalLongArg; 6925 { 6926 if (UNLIKELY(info.Length() <= 0)) { 6927 impl->voidMethodOptionalLongArg(); 6928 return; 6929 } 6930 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 6931 } 6932 impl->voidMethodOptionalLongArg(optionalLongArg); 6933 } 6934 6935 static void voidMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6936 { 6937 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6938 TestObjectV8Internal::voidMethodOptionalLongArgMethod(info); 6939 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6940 } 6941 6942 static void stringMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6943 { 6944 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6945 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6946 int optionalLongArg; 6947 { 6948 if (UNLIKELY(info.Length() <= 0)) { 6949 v8SetReturnValueString(info, impl->stringMethodOptionalLongArg(), info.GetIsolate()); 6950 return; 6951 } 6952 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 6953 } 6954 v8SetReturnValueString(info, impl->stringMethodOptionalLongArg(optionalLongArg), info.GetIsolate()); 6955 } 6956 6957 static void stringMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6958 { 6959 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6960 TestObjectV8Internal::stringMethodOptionalLongArgMethod(info); 6961 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6962 } 6963 6964 static void testInterfaceEmptyMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6965 { 6966 ExceptionState exceptionState(ExceptionState::ExecutionContext, "testInterfaceEmptyMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6967 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6968 int optionalLongArg; 6969 { 6970 if (UNLIKELY(info.Length() <= 0)) { 6971 v8SetReturnValue(info, impl->testInterfaceEmptyMethodOptionalLongArg()); 6972 return; 6973 } 6974 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 6975 } 6976 v8SetReturnValue(info, impl->testInterfaceEmptyMethodOptionalLongArg(optionalLongArg)); 6977 } 6978 6979 static void testInterfaceEmptyMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 6980 { 6981 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6982 TestObjectV8Internal::testInterfaceEmptyMethodOptionalLongArgMethod(info); 6983 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6984 } 6985 6986 static void longMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 6987 { 6988 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 6989 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6990 int optionalLongArg; 6991 { 6992 if (UNLIKELY(info.Length() <= 0)) { 6993 v8SetReturnValueInt(info, impl->longMethodOptionalLongArg()); 6994 return; 6995 } 6996 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 6997 } 6998 v8SetReturnValueInt(info, impl->longMethodOptionalLongArg(optionalLongArg)); 6999 } 7000 7001 static void longMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7002 { 7003 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7004 TestObjectV8Internal::longMethodOptionalLongArgMethod(info); 7005 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7006 } 7007 7008 static void voidMethodLongArgOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7009 { 7010 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 7011 if (UNLIKELY(info.Length() < 1)) { 7012 setMinimumArityTypeError(exceptionState, 1, info.Length()); 7013 exceptionState.throwIfNeeded(); 7014 return; 7015 } 7016 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7017 int longArg; 7018 int optionalLongArg; 7019 { 7020 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7021 if (UNLIKELY(info.Length() <= 1)) { 7022 impl->voidMethodLongArgOptionalLongArg(longArg); 7023 return; 7024 } 7025 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[1], exceptionState), exceptionState); 7026 } 7027 impl->voidMethodLongArgOptionalLongArg(longArg, optionalLongArg); 7028 } 7029 7030 static void voidMethodLongArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7031 { 7032 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7033 TestObjectV8Internal::voidMethodLongArgOptionalLongArgMethod(info); 7034 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7035 } 7036 7037 static void voidMethodLongArgOptionalLongArgOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7038 { 7039 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalLongArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 7040 if (UNLIKELY(info.Length() < 1)) { 7041 setMinimumArityTypeError(exceptionState, 1, info.Length()); 7042 exceptionState.throwIfNeeded(); 7043 return; 7044 } 7045 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7046 int longArg; 7047 int optionalLongArg1; 7048 int optionalLongArg2; 7049 { 7050 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7051 if (UNLIKELY(info.Length() <= 1)) { 7052 impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg); 7053 return; 7054 } 7055 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg1, toInt32(info[1], exceptionState), exceptionState); 7056 if (UNLIKELY(info.Length() <= 2)) { 7057 impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg, optionalLongArg1); 7058 return; 7059 } 7060 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg2, toInt32(info[2], exceptionState), exceptionState); 7061 } 7062 impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg, optionalLongArg1, optionalLongArg2); 7063 } 7064 7065 static void voidMethodLongArgOptionalLongArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7066 { 7067 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7068 TestObjectV8Internal::voidMethodLongArgOptionalLongArgOptionalLongArgMethod(info); 7069 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7070 } 7071 7072 static void voidMethodLongArgOptionalTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7073 { 7074 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate()); 7075 if (UNLIKELY(info.Length() < 1)) { 7076 setMinimumArityTypeError(exceptionState, 1, info.Length()); 7077 exceptionState.throwIfNeeded(); 7078 return; 7079 } 7080 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7081 int longArg; 7082 TestInterfaceEmpty* optionalTestInterfaceEmpty; 7083 { 7084 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7085 if (UNLIKELY(info.Length() <= 1)) { 7086 impl->voidMethodLongArgOptionalTestInterfaceEmptyArg(longArg); 7087 return; 7088 } 7089 optionalTestInterfaceEmpty = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]); 7090 } 7091 impl->voidMethodLongArgOptionalTestInterfaceEmptyArg(longArg, optionalTestInterfaceEmpty); 7092 } 7093 7094 static void voidMethodLongArgOptionalTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7095 { 7096 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7097 TestObjectV8Internal::voidMethodLongArgOptionalTestInterfaceEmptyArgMethod(info); 7098 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7099 } 7100 7101 static void voidMethodTestInterfaceEmptyArgOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7102 { 7103 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceEmptyArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 7104 if (UNLIKELY(info.Length() < 1)) { 7105 setMinimumArityTypeError(exceptionState, 1, info.Length()); 7106 exceptionState.throwIfNeeded(); 7107 return; 7108 } 7109 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7110 TestInterfaceEmpty* optionalTestInterfaceEmpty; 7111 int longArg; 7112 { 7113 optionalTestInterfaceEmpty = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 7114 if (UNLIKELY(info.Length() <= 1)) { 7115 impl->voidMethodTestInterfaceEmptyArgOptionalLongArg(optionalTestInterfaceEmpty); 7116 return; 7117 } 7118 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptionState), exceptionState); 7119 } 7120 impl->voidMethodTestInterfaceEmptyArgOptionalLongArg(optionalTestInterfaceEmpty, longArg); 7121 } 7122 7123 static void voidMethodTestInterfaceEmptyArgOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7124 { 7125 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7126 TestObjectV8Internal::voidMethodTestInterfaceEmptyArgOptionalLongArgMethod(info); 7127 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7128 } 7129 7130 static void voidMethodOptionalDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7131 { 7132 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7133 Dictionary optionalDictionaryArg; 7134 { 7135 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { 7136 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodOptionalDictionaryArg", "TestObject", "parameter 1 ('optionalDictionaryArg') is not an object."), info.GetIsolate()); 7137 return; 7138 } 7139 optionalDictionaryArg = Dictionary(info[0], info.GetIsolate()); 7140 } 7141 impl->voidMethodOptionalDictionaryArg(optionalDictionaryArg); 7142 } 7143 7144 static void voidMethodOptionalDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7145 { 7146 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7147 TestObjectV8Internal::voidMethodOptionalDictionaryArgMethod(info); 7148 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7149 } 7150 7151 static void voidMethodDefaultByteStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7152 { 7153 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDefaultByteStringArg", "TestObject", info.Holder(), info.GetIsolate()); 7154 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7155 V8StringResource<> defaultByteStringArg; 7156 { 7157 if (!info[0]->IsUndefined()) { 7158 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultByteStringArg, toByteString(info[0], exceptionState), exceptionState); 7159 } else { 7160 defaultByteStringArg = String("foo"); 7161 } 7162 } 7163 impl->voidMethodDefaultByteStringArg(defaultByteStringArg); 7164 } 7165 7166 static void voidMethodDefaultByteStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7167 { 7168 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7169 TestObjectV8Internal::voidMethodDefaultByteStringArgMethod(info); 7170 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7171 } 7172 7173 static void voidMethodDefaultStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7174 { 7175 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7176 V8StringResource<> defaultStringArg; 7177 { 7178 if (!info[0]->IsUndefined()) { 7179 TOSTRING_VOID_INTERNAL(defaultStringArg, info[0]); 7180 } else { 7181 defaultStringArg = String("foo"); 7182 } 7183 } 7184 impl->voidMethodDefaultStringArg(defaultStringArg); 7185 } 7186 7187 static void voidMethodDefaultStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7188 { 7189 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7190 TestObjectV8Internal::voidMethodDefaultStringArgMethod(info); 7191 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7192 } 7193 7194 static void voidMethodDefaultIntegerArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7195 { 7196 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDefaultIntegerArgs", "TestObject", info.Holder(), info.GetIsolate()); 7197 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7198 int defaultLongArg; 7199 long long defaultLongLongArg; 7200 unsigned defaultUnsignedArg; 7201 { 7202 if (!info[0]->IsUndefined()) { 7203 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultLongArg, toInt32(info[0], exceptionState), exceptionState); 7204 } else { 7205 defaultLongArg = 10; 7206 } 7207 if (!info[1]->IsUndefined()) { 7208 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultLongLongArg, toInt64(info[1], exceptionState), exceptionState); 7209 } else { 7210 defaultLongLongArg = -10; 7211 } 7212 if (!info[2]->IsUndefined()) { 7213 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultUnsignedArg, toUInt32(info[2], exceptionState), exceptionState); 7214 } else { 7215 defaultUnsignedArg = 4294967295u; 7216 } 7217 } 7218 impl->voidMethodDefaultIntegerArgs(defaultLongArg, defaultLongLongArg, defaultUnsignedArg); 7219 } 7220 7221 static void voidMethodDefaultIntegerArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7222 { 7223 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7224 TestObjectV8Internal::voidMethodDefaultIntegerArgsMethod(info); 7225 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7226 } 7227 7228 static void voidMethodDefaultDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7229 { 7230 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDefaultDoubleArg", "TestObject", info.Holder(), info.GetIsolate()); 7231 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7232 double defaultDoubleArg; 7233 { 7234 if (!info[0]->IsUndefined()) { 7235 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultDoubleArg, toDouble(info[0], exceptionState), exceptionState); 7236 } else { 7237 defaultDoubleArg = 0.5; 7238 } 7239 } 7240 impl->voidMethodDefaultDoubleArg(defaultDoubleArg); 7241 } 7242 7243 static void voidMethodDefaultDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7244 { 7245 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7246 TestObjectV8Internal::voidMethodDefaultDoubleArgMethod(info); 7247 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7248 } 7249 7250 static void voidMethodDefaultTrueBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7251 { 7252 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7253 bool defaultBooleanArg; 7254 { 7255 if (!info[0]->IsUndefined()) { 7256 defaultBooleanArg = info[0]->BooleanValue(); 7257 } else { 7258 defaultBooleanArg = true; 7259 } 7260 } 7261 impl->voidMethodDefaultTrueBooleanArg(defaultBooleanArg); 7262 } 7263 7264 static void voidMethodDefaultTrueBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7265 { 7266 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7267 TestObjectV8Internal::voidMethodDefaultTrueBooleanArgMethod(info); 7268 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7269 } 7270 7271 static void voidMethodDefaultFalseBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7272 { 7273 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7274 bool defaultBooleanArg; 7275 { 7276 if (!info[0]->IsUndefined()) { 7277 defaultBooleanArg = info[0]->BooleanValue(); 7278 } else { 7279 defaultBooleanArg = false; 7280 } 7281 } 7282 impl->voidMethodDefaultFalseBooleanArg(defaultBooleanArg); 7283 } 7284 7285 static void voidMethodDefaultFalseBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7286 { 7287 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7288 TestObjectV8Internal::voidMethodDefaultFalseBooleanArgMethod(info); 7289 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7290 } 7291 7292 static void voidMethodDefaultNullableByteStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7293 { 7294 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDefaultNullableByteStringArg", "TestObject", info.Holder(), info.GetIsolate()); 7295 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7296 V8StringResource<TreatNullAsNullString> defaultStringArg; 7297 { 7298 if (!info[0]->IsUndefined()) { 7299 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultStringArg, toByteString(info[0], exceptionState), exceptionState); 7300 } else { 7301 defaultStringArg = nullptr; 7302 } 7303 } 7304 impl->voidMethodDefaultNullableByteStringArg(defaultStringArg); 7305 } 7306 7307 static void voidMethodDefaultNullableByteStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7308 { 7309 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7310 TestObjectV8Internal::voidMethodDefaultNullableByteStringArgMethod(info); 7311 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7312 } 7313 7314 static void voidMethodDefaultNullableStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7315 { 7316 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7317 V8StringResource<TreatNullAsNullString> defaultStringArg; 7318 { 7319 if (!info[0]->IsUndefined()) { 7320 TOSTRING_VOID_INTERNAL(defaultStringArg, info[0]); 7321 } else { 7322 defaultStringArg = nullptr; 7323 } 7324 } 7325 impl->voidMethodDefaultNullableStringArg(defaultStringArg); 7326 } 7327 7328 static void voidMethodDefaultNullableStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7329 { 7330 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7331 TestObjectV8Internal::voidMethodDefaultNullableStringArgMethod(info); 7332 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7333 } 7334 7335 static void voidMethodDefaultNullableTestInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7336 { 7337 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7338 TestInterfaceImplementation* defaultTestInterfaceArg; 7339 { 7340 if (!info[0]->IsUndefined()) { 7341 defaultTestInterfaceArg = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), info[0]); 7342 } else { 7343 defaultTestInterfaceArg = nullptr; 7344 } 7345 } 7346 impl->voidMethodDefaultNullableTestInterfaceArg(defaultTestInterfaceArg); 7347 } 7348 7349 static void voidMethodDefaultNullableTestInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7350 { 7351 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7352 TestObjectV8Internal::voidMethodDefaultNullableTestInterfaceArgMethod(info); 7353 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7354 } 7355 7356 static void voidMethodVariadicStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7357 { 7358 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodVariadicStringArg", "TestObject", info.Holder(), info.GetIsolate()); 7359 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7360 Vector<String> variadicStringArgs; 7361 { 7362 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(variadicStringArgs, toImplArguments<String>(info, 0, exceptionState), exceptionState); 7363 } 7364 impl->voidMethodVariadicStringArg(variadicStringArgs); 7365 } 7366 7367 static void voidMethodVariadicStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7368 { 7369 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7370 TestObjectV8Internal::voidMethodVariadicStringArgMethod(info); 7371 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7372 } 7373 7374 static void voidMethodStringArgVariadicStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7375 { 7376 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodStringArgVariadicStringArg", "TestObject", info.Holder(), info.GetIsolate()); 7377 if (UNLIKELY(info.Length() < 1)) { 7378 setMinimumArityTypeError(exceptionState, 1, info.Length()); 7379 exceptionState.throwIfNeeded(); 7380 return; 7381 } 7382 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7383 V8StringResource<> stringArg; 7384 Vector<String> variadicStringArgs; 7385 { 7386 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7387 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(variadicStringArgs, toImplArguments<String>(info, 1, exceptionState), exceptionState); 7388 } 7389 impl->voidMethodStringArgVariadicStringArg(stringArg, variadicStringArgs); 7390 } 7391 7392 static void voidMethodStringArgVariadicStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7393 { 7394 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7395 TestObjectV8Internal::voidMethodStringArgVariadicStringArgMethod(info); 7396 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7397 } 7398 7399 static void voidMethodVariadicTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7400 { 7401 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodVariadicTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate()); 7402 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7403 Vector<RefPtr<TestInterfaceEmpty> > variadicTestInterfaceEmptyArgs; 7404 { 7405 for (int i = 0; i < info.Length(); ++i) { 7406 if (!V8TestInterfaceEmpty::hasInstance(info[i], info.GetIsolate())) { 7407 exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceEmpty'."); 7408 exceptionState.throwIfNeeded(); 7409 return; 7410 } 7411 variadicTestInterfaceEmptyArgs.append(V8TestInterfaceEmpty::toImpl(v8::Handle<v8::Object>::Cast(info[i]))); 7412 } 7413 } 7414 impl->voidMethodVariadicTestInterfaceEmptyArg(variadicTestInterfaceEmptyArgs); 7415 } 7416 7417 static void voidMethodVariadicTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7418 { 7419 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7420 TestObjectV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethod(info); 7421 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7422 } 7423 7424 static void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7425 { 7426 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate()); 7427 if (UNLIKELY(info.Length() < 1)) { 7428 setMinimumArityTypeError(exceptionState, 1, info.Length()); 7429 exceptionState.throwIfNeeded(); 7430 return; 7431 } 7432 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7433 TestInterfaceEmpty* testInterfaceEmptyArg; 7434 Vector<RefPtr<TestInterfaceEmpty> > variadicTestInterfaceEmptyArgs; 7435 { 7436 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 7437 for (int i = 1; i < info.Length(); ++i) { 7438 if (!V8TestInterfaceEmpty::hasInstance(info[i], info.GetIsolate())) { 7439 exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'."); 7440 exceptionState.throwIfNeeded(); 7441 return; 7442 } 7443 variadicTestInterfaceEmptyArgs.append(V8TestInterfaceEmpty::toImpl(v8::Handle<v8::Object>::Cast(info[i]))); 7444 } 7445 } 7446 impl->voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg(testInterfaceEmptyArg, variadicTestInterfaceEmptyArgs); 7447 } 7448 7449 static void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7450 { 7451 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7452 TestObjectV8Internal::voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethod(info); 7453 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7454 } 7455 7456 static void voidMethodVariadicTestInterfaceGarbageCollectedArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7457 { 7458 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodVariadicTestInterfaceGarbageCollectedArg", "TestObject", info.Holder(), info.GetIsolate()); 7459 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7460 HeapVector<Member<TestInterfaceGarbageCollected> > variadicTestInterfaceGarbageCollectedArg; 7461 { 7462 for (int i = 0; i < info.Length(); ++i) { 7463 if (!V8TestInterfaceGarbageCollected::hasInstance(info[i], info.GetIsolate())) { 7464 exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceGarbageCollected'."); 7465 exceptionState.throwIfNeeded(); 7466 return; 7467 } 7468 variadicTestInterfaceGarbageCollectedArg.append(V8TestInterfaceGarbageCollected::toImpl(v8::Handle<v8::Object>::Cast(info[i]))); 7469 } 7470 } 7471 impl->voidMethodVariadicTestInterfaceGarbageCollectedArg(variadicTestInterfaceGarbageCollectedArg); 7472 } 7473 7474 static void voidMethodVariadicTestInterfaceGarbageCollectedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7475 { 7476 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7477 TestObjectV8Internal::voidMethodVariadicTestInterfaceGarbageCollectedArgMethod(info); 7478 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7479 } 7480 7481 static void voidMethodVariadicTestInterfaceWillBeGarbageCollectedArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7482 { 7483 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg", "TestObject", info.Holder(), info.GetIsolate()); 7484 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7485 WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected> > variadicTestInterfaceWillBeGarbageCollectedArg; 7486 { 7487 for (int i = 0; i < info.Length(); ++i) { 7488 if (!V8TestInterfaceWillBeGarbageCollected::hasInstance(info[i], info.GetIsolate())) { 7489 exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceWillBeGarbageCollected'."); 7490 exceptionState.throwIfNeeded(); 7491 return; 7492 } 7493 variadicTestInterfaceWillBeGarbageCollectedArg.append(V8TestInterfaceWillBeGarbageCollected::toImpl(v8::Handle<v8::Object>::Cast(info[i]))); 7494 } 7495 } 7496 impl->voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg(variadicTestInterfaceWillBeGarbageCollectedArg); 7497 } 7498 7499 static void voidMethodVariadicTestInterfaceWillBeGarbageCollectedArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7500 { 7501 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7502 TestObjectV8Internal::voidMethodVariadicTestInterfaceWillBeGarbageCollectedArgMethod(info); 7503 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7504 } 7505 7506 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7507 { 7508 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate()); 7509 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7510 int longArg; 7511 { 7512 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7513 } 7514 impl->overloadedMethodA(longArg); 7515 } 7516 7517 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7518 { 7519 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate()); 7520 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7521 int longArg1; 7522 int longArg2; 7523 { 7524 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg1, toInt32(info[0], exceptionState), exceptionState); 7525 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg2, toInt32(info[1], exceptionState), exceptionState); 7526 } 7527 impl->overloadedMethodA(longArg1, longArg2); 7528 } 7529 7530 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7531 { 7532 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate()); 7533 switch (std::min(2, info.Length())) { 7534 case 1: 7535 if (true) { 7536 overloadedMethodA1Method(info); 7537 return; 7538 } 7539 break; 7540 case 2: 7541 if (true) { 7542 overloadedMethodA2Method(info); 7543 return; 7544 } 7545 break; 7546 default: 7547 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7548 exceptionState.throwIfNeeded(); 7549 return; 7550 } 7551 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7552 exceptionState.throwIfNeeded(); 7553 } 7554 7555 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7556 { 7557 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7558 TestObjectV8Internal::overloadedMethodAMethod(info); 7559 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7560 } 7561 7562 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7563 { 7564 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate()); 7565 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7566 int longArg; 7567 { 7568 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7569 } 7570 impl->overloadedMethodB(longArg); 7571 } 7572 7573 static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7574 { 7575 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate()); 7576 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7577 V8StringResource<> stringArg; 7578 int longArg; 7579 { 7580 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7581 if (UNLIKELY(info.Length() <= 1)) { 7582 impl->overloadedMethodB(stringArg); 7583 return; 7584 } 7585 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptionState), exceptionState); 7586 } 7587 impl->overloadedMethodB(stringArg, longArg); 7588 } 7589 7590 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7591 { 7592 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate()); 7593 switch (std::min(2, info.Length())) { 7594 case 1: 7595 if (info[0]->IsNumber()) { 7596 overloadedMethodB1Method(info); 7597 return; 7598 } 7599 if (true) { 7600 overloadedMethodB2Method(info); 7601 return; 7602 } 7603 if (true) { 7604 overloadedMethodB1Method(info); 7605 return; 7606 } 7607 break; 7608 case 2: 7609 if (true) { 7610 overloadedMethodB2Method(info); 7611 return; 7612 } 7613 break; 7614 default: 7615 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7616 exceptionState.throwIfNeeded(); 7617 return; 7618 } 7619 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7620 exceptionState.throwIfNeeded(); 7621 } 7622 7623 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7624 { 7625 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7626 TestObjectV8Internal::overloadedMethodBMethod(info); 7627 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7628 } 7629 7630 static void overloadedMethodC1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7631 { 7632 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObject", info.Holder(), info.GetIsolate()); 7633 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7634 int longArg; 7635 { 7636 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7637 } 7638 impl->overloadedMethodC(longArg); 7639 } 7640 7641 static void overloadedMethodC2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7642 { 7643 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7644 TestInterfaceEmpty* testInterfaceEmptyArg; 7645 { 7646 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 7647 } 7648 impl->overloadedMethodC(testInterfaceEmptyArg); 7649 } 7650 7651 static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7652 { 7653 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObject", info.Holder(), info.GetIsolate()); 7654 switch (std::min(1, info.Length())) { 7655 case 1: 7656 if (V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) { 7657 overloadedMethodC2Method(info); 7658 return; 7659 } 7660 if (true) { 7661 overloadedMethodC1Method(info); 7662 return; 7663 } 7664 break; 7665 default: 7666 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7667 exceptionState.throwIfNeeded(); 7668 return; 7669 } 7670 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7671 exceptionState.throwIfNeeded(); 7672 } 7673 7674 static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7675 { 7676 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7677 TestObjectV8Internal::overloadedMethodCMethod(info); 7678 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7679 } 7680 7681 static void overloadedMethodD1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7682 { 7683 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodD", "TestObject", info.Holder(), info.GetIsolate()); 7684 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7685 int longArg; 7686 { 7687 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7688 } 7689 impl->overloadedMethodD(longArg); 7690 } 7691 7692 static void overloadedMethodD2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7693 { 7694 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodD", "TestObject", info.Holder(), info.GetIsolate()); 7695 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7696 Vector<int> longArrayArg; 7697 { 7698 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArrayArg, toImplArray<int>(info[0], 1, info.GetIsolate(), exceptionState), exceptionState); 7699 } 7700 impl->overloadedMethodD(longArrayArg); 7701 } 7702 7703 static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7704 { 7705 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodD", "TestObject", info.Holder(), info.GetIsolate()); 7706 switch (std::min(1, info.Length())) { 7707 case 1: 7708 if (info[0]->IsArray()) { 7709 overloadedMethodD2Method(info); 7710 return; 7711 } 7712 if (true) { 7713 overloadedMethodD1Method(info); 7714 return; 7715 } 7716 break; 7717 default: 7718 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7719 exceptionState.throwIfNeeded(); 7720 return; 7721 } 7722 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7723 exceptionState.throwIfNeeded(); 7724 } 7725 7726 static void overloadedMethodDMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7727 { 7728 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7729 TestObjectV8Internal::overloadedMethodDMethod(info); 7730 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7731 } 7732 7733 static void overloadedMethodE1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7734 { 7735 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodE", "TestObject", info.Holder(), info.GetIsolate()); 7736 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7737 int longArg; 7738 { 7739 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7740 } 7741 impl->overloadedMethodE(longArg); 7742 } 7743 7744 static void overloadedMethodE2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7745 { 7746 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7747 TestInterfaceEmpty* testInterfaceEmptyOrNullArg; 7748 { 7749 testInterfaceEmptyOrNullArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 7750 } 7751 impl->overloadedMethodE(testInterfaceEmptyOrNullArg); 7752 } 7753 7754 static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7755 { 7756 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodE", "TestObject", info.Holder(), info.GetIsolate()); 7757 switch (std::min(1, info.Length())) { 7758 case 1: 7759 if (isUndefinedOrNull(info[0])) { 7760 overloadedMethodE2Method(info); 7761 return; 7762 } 7763 if (V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) { 7764 overloadedMethodE2Method(info); 7765 return; 7766 } 7767 if (true) { 7768 overloadedMethodE1Method(info); 7769 return; 7770 } 7771 break; 7772 default: 7773 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7774 exceptionState.throwIfNeeded(); 7775 return; 7776 } 7777 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7778 exceptionState.throwIfNeeded(); 7779 } 7780 7781 static void overloadedMethodEMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7782 { 7783 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7784 TestObjectV8Internal::overloadedMethodEMethod(info); 7785 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7786 } 7787 7788 static void overloadedMethodF1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7789 { 7790 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7791 V8StringResource<> stringArg; 7792 { 7793 if (UNLIKELY(info.Length() <= 0)) { 7794 impl->overloadedMethodF(); 7795 return; 7796 } 7797 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7798 } 7799 impl->overloadedMethodF(stringArg); 7800 } 7801 7802 static void overloadedMethodF2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7803 { 7804 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodF", "TestObject", info.Holder(), info.GetIsolate()); 7805 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7806 double doubleArg; 7807 { 7808 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], exceptionState), exceptionState); 7809 } 7810 impl->overloadedMethodF(doubleArg); 7811 } 7812 7813 static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7814 { 7815 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodF", "TestObject", info.Holder(), info.GetIsolate()); 7816 switch (std::min(1, info.Length())) { 7817 case 0: 7818 if (true) { 7819 overloadedMethodF1Method(info); 7820 return; 7821 } 7822 break; 7823 case 1: 7824 if (info[0]->IsUndefined()) { 7825 overloadedMethodF1Method(info); 7826 return; 7827 } 7828 if (info[0]->IsNumber()) { 7829 overloadedMethodF2Method(info); 7830 return; 7831 } 7832 if (true) { 7833 overloadedMethodF1Method(info); 7834 return; 7835 } 7836 if (true) { 7837 overloadedMethodF2Method(info); 7838 return; 7839 } 7840 break; 7841 default: 7842 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 7843 exceptionState.throwIfNeeded(); 7844 return; 7845 } 7846 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7847 exceptionState.throwIfNeeded(); 7848 } 7849 7850 static void overloadedMethodFMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7851 { 7852 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7853 TestObjectV8Internal::overloadedMethodFMethod(info); 7854 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7855 } 7856 7857 static void overloadedMethodG1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7858 { 7859 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodG", "TestObject", info.Holder(), info.GetIsolate()); 7860 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7861 int longArg; 7862 { 7863 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 7864 } 7865 impl->overloadedMethodG(longArg); 7866 } 7867 7868 static void overloadedMethodG2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7869 { 7870 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7871 TestInterfaceEmpty* testInterfaceEmptyOrNullArg; 7872 { 7873 if (!info[0]->IsUndefined()) { 7874 testInterfaceEmptyOrNullArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 7875 } else { 7876 testInterfaceEmptyOrNullArg = nullptr; 7877 } 7878 } 7879 impl->overloadedMethodG(testInterfaceEmptyOrNullArg); 7880 } 7881 7882 static void overloadedMethodGMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7883 { 7884 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodG", "TestObject", info.Holder(), info.GetIsolate()); 7885 switch (std::min(1, info.Length())) { 7886 case 0: 7887 if (true) { 7888 overloadedMethodG2Method(info); 7889 return; 7890 } 7891 break; 7892 case 1: 7893 if (info[0]->IsUndefined()) { 7894 overloadedMethodG2Method(info); 7895 return; 7896 } 7897 if (isUndefinedOrNull(info[0])) { 7898 overloadedMethodG2Method(info); 7899 return; 7900 } 7901 if (V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) { 7902 overloadedMethodG2Method(info); 7903 return; 7904 } 7905 if (true) { 7906 overloadedMethodG1Method(info); 7907 return; 7908 } 7909 break; 7910 default: 7911 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 7912 exceptionState.throwIfNeeded(); 7913 return; 7914 } 7915 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7916 exceptionState.throwIfNeeded(); 7917 } 7918 7919 static void overloadedMethodGMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7920 { 7921 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7922 TestObjectV8Internal::overloadedMethodGMethod(info); 7923 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7924 } 7925 7926 static void overloadedMethodH1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7927 { 7928 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7929 TestInterfaceImplementation* testInterfaceArg; 7930 { 7931 testInterfaceArg = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), info[0]); 7932 } 7933 impl->overloadedMethodH(testInterfaceArg); 7934 } 7935 7936 static void overloadedMethodH2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7937 { 7938 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7939 TestInterfaceEmpty* testInterfaceEmptyArg; 7940 { 7941 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 7942 } 7943 impl->overloadedMethodH(testInterfaceEmptyArg); 7944 } 7945 7946 static void overloadedMethodHMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7947 { 7948 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodH", "TestObject", info.Holder(), info.GetIsolate()); 7949 switch (std::min(1, info.Length())) { 7950 case 1: 7951 if (V8TestInterface::hasInstance(info[0], info.GetIsolate())) { 7952 overloadedMethodH1Method(info); 7953 return; 7954 } 7955 if (V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) { 7956 overloadedMethodH2Method(info); 7957 return; 7958 } 7959 break; 7960 default: 7961 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 7962 exceptionState.throwIfNeeded(); 7963 return; 7964 } 7965 exceptionState.throwTypeError("No function was found that matched the signature provided."); 7966 exceptionState.throwIfNeeded(); 7967 } 7968 7969 static void overloadedMethodHMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 7970 { 7971 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 7972 TestObjectV8Internal::overloadedMethodHMethod(info); 7973 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 7974 } 7975 7976 static void overloadedMethodI1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7977 { 7978 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7979 V8StringResource<> stringArg; 7980 { 7981 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 7982 } 7983 impl->overloadedMethodI(stringArg); 7984 } 7985 7986 static void overloadedMethodI2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 7987 { 7988 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodI", "TestObject", info.Holder(), info.GetIsolate()); 7989 TestObject* impl = V8TestObject::toImpl(info.Holder()); 7990 double doubleArg; 7991 { 7992 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], exceptionState), exceptionState); 7993 } 7994 impl->overloadedMethodI(doubleArg); 7995 } 7996 7997 static void overloadedMethodIMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 7998 { 7999 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodI", "TestObject", info.Holder(), info.GetIsolate()); 8000 switch (std::min(1, info.Length())) { 8001 case 1: 8002 if (info[0]->IsNumber()) { 8003 overloadedMethodI2Method(info); 8004 return; 8005 } 8006 if (true) { 8007 overloadedMethodI1Method(info); 8008 return; 8009 } 8010 if (true) { 8011 overloadedMethodI2Method(info); 8012 return; 8013 } 8014 break; 8015 default: 8016 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 8017 exceptionState.throwIfNeeded(); 8018 return; 8019 } 8020 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8021 exceptionState.throwIfNeeded(); 8022 } 8023 8024 static void overloadedMethodIMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8025 { 8026 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8027 TestObjectV8Internal::overloadedMethodIMethod(info); 8028 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8029 } 8030 8031 static void overloadedMethodJ1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8032 { 8033 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8034 V8StringResource<> stringArg; 8035 { 8036 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 8037 } 8038 impl->overloadedMethodJ(stringArg); 8039 } 8040 8041 static void overloadedMethodJ2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8042 { 8043 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodJ", "TestObject", info.Holder(), info.GetIsolate()); 8044 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8045 TestDictionary* testDictionaryArg; 8046 { 8047 if (!info[0]->IsUndefined()) { 8048 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { 8049 exceptionState.throwTypeError("parameter 1 ('testDictionaryArg') is not an object."); 8050 exceptionState.throwIfNeeded(); 8051 return; 8052 } 8053 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(testDictionaryArg, V8TestDictionary::toImpl(info.GetIsolate(), info[0], exceptionState), exceptionState); 8054 } else { 8055 testDictionaryArg = TestDictionary::create(); 8056 } 8057 } 8058 impl->overloadedMethodJ(*testDictionaryArg); 8059 } 8060 8061 static void overloadedMethodJMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8062 { 8063 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodJ", "TestObject", info.Holder(), info.GetIsolate()); 8064 switch (std::min(1, info.Length())) { 8065 case 1: 8066 if (info[0]->IsObject()) { 8067 overloadedMethodJ2Method(info); 8068 return; 8069 } 8070 if (true) { 8071 overloadedMethodJ1Method(info); 8072 return; 8073 } 8074 break; 8075 default: 8076 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 8077 exceptionState.throwIfNeeded(); 8078 return; 8079 } 8080 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8081 exceptionState.throwIfNeeded(); 8082 } 8083 8084 static void overloadedMethodJMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8085 { 8086 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8087 TestObjectV8Internal::overloadedMethodJMethod(info); 8088 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8089 } 8090 8091 static void overloadedPerWorldBindingsMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8092 { 8093 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8094 impl->overloadedPerWorldBindingsMethod(); 8095 } 8096 8097 static void overloadedPerWorldBindingsMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8098 { 8099 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8100 impl->overloadedPerWorldBindingsMethod(); 8101 } 8102 8103 static void overloadedPerWorldBindingsMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8104 { 8105 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), info.GetIsolate()); 8106 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8107 int longArg; 8108 { 8109 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 8110 } 8111 impl->overloadedPerWorldBindingsMethod(longArg); 8112 } 8113 8114 static void overloadedPerWorldBindingsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8115 { 8116 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), info.GetIsolate()); 8117 switch (std::min(1, info.Length())) { 8118 case 0: 8119 if (true) { 8120 overloadedPerWorldBindingsMethod1Method(info); 8121 return; 8122 } 8123 break; 8124 case 1: 8125 if (true) { 8126 overloadedPerWorldBindingsMethod2Method(info); 8127 return; 8128 } 8129 break; 8130 default: 8131 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8132 exceptionState.throwIfNeeded(); 8133 return; 8134 } 8135 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8136 exceptionState.throwIfNeeded(); 8137 } 8138 8139 static void overloadedPerWorldBindingsMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8140 { 8141 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8142 TestObjectV8Internal::overloadedPerWorldBindingsMethodMethod(info); 8143 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8144 } 8145 8146 static void overloadedPerWorldBindingsMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8147 { 8148 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), info.GetIsolate()); 8149 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8150 int longArg; 8151 { 8152 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 8153 } 8154 impl->overloadedPerWorldBindingsMethod(longArg); 8155 } 8156 8157 static void overloadedPerWorldBindingsMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8158 { 8159 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), info.GetIsolate()); 8160 switch (std::min(1, info.Length())) { 8161 case 0: 8162 if (true) { 8163 overloadedPerWorldBindingsMethod1MethodForMainWorld(info); 8164 return; 8165 } 8166 break; 8167 case 1: 8168 if (true) { 8169 overloadedPerWorldBindingsMethod2MethodForMainWorld(info); 8170 return; 8171 } 8172 break; 8173 default: 8174 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8175 exceptionState.throwIfNeeded(); 8176 return; 8177 } 8178 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8179 exceptionState.throwIfNeeded(); 8180 } 8181 8182 static void overloadedPerWorldBindingsMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 8183 { 8184 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8185 TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodForMainWorld(info); 8186 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8187 } 8188 8189 static void overloadedStaticMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8190 { 8191 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObject", info.Holder(), info.GetIsolate()); 8192 int longArg; 8193 { 8194 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 8195 } 8196 TestObject::overloadedStaticMethod(longArg); 8197 } 8198 8199 static void overloadedStaticMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8200 { 8201 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObject", info.Holder(), info.GetIsolate()); 8202 int longArg1; 8203 int longArg2; 8204 { 8205 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg1, toInt32(info[0], exceptionState), exceptionState); 8206 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg2, toInt32(info[1], exceptionState), exceptionState); 8207 } 8208 TestObject::overloadedStaticMethod(longArg1, longArg2); 8209 } 8210 8211 static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8212 { 8213 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObject", info.Holder(), info.GetIsolate()); 8214 switch (std::min(2, info.Length())) { 8215 case 1: 8216 if (true) { 8217 overloadedStaticMethod1Method(info); 8218 return; 8219 } 8220 break; 8221 case 2: 8222 if (true) { 8223 overloadedStaticMethod2Method(info); 8224 return; 8225 } 8226 break; 8227 default: 8228 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 8229 exceptionState.throwIfNeeded(); 8230 return; 8231 } 8232 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8233 exceptionState.throwIfNeeded(); 8234 } 8235 8236 static void overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8237 { 8238 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8239 TestObjectV8Internal::overloadedStaticMethodMethod(info); 8240 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8241 } 8242 8243 static void voidMethodClampUnsignedShortArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8244 { 8245 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodClampUnsignedShortArg", "TestObject", info.Holder(), info.GetIsolate()); 8246 if (UNLIKELY(info.Length() < 1)) { 8247 setMinimumArityTypeError(exceptionState, 1, info.Length()); 8248 exceptionState.throwIfNeeded(); 8249 return; 8250 } 8251 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8252 unsigned clampUnsignedShortArg; 8253 { 8254 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(clampUnsignedShortArg, toUInt16(info[0], Clamp, exceptionState), exceptionState); 8255 } 8256 impl->voidMethodClampUnsignedShortArg(clampUnsignedShortArg); 8257 } 8258 8259 static void voidMethodClampUnsignedShortArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8260 { 8261 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8262 TestObjectV8Internal::voidMethodClampUnsignedShortArgMethod(info); 8263 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8264 } 8265 8266 static void voidMethodClampUnsignedLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8267 { 8268 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodClampUnsignedLongArg", "TestObject", info.Holder(), info.GetIsolate()); 8269 if (UNLIKELY(info.Length() < 1)) { 8270 setMinimumArityTypeError(exceptionState, 1, info.Length()); 8271 exceptionState.throwIfNeeded(); 8272 return; 8273 } 8274 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8275 unsigned clampUnsignedLongArg; 8276 { 8277 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(clampUnsignedLongArg, toUInt32(info[0], Clamp, exceptionState), exceptionState); 8278 } 8279 impl->voidMethodClampUnsignedLongArg(clampUnsignedLongArg); 8280 } 8281 8282 static void voidMethodClampUnsignedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8283 { 8284 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8285 TestObjectV8Internal::voidMethodClampUnsignedLongArgMethod(info); 8286 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8287 } 8288 8289 static void voidMethodDefaultUndefinedTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8290 { 8291 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8292 TestInterfaceEmpty* defaultUndefinedTestInterfaceEmptyArg; 8293 { 8294 defaultUndefinedTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 8295 } 8296 impl->voidMethodDefaultUndefinedTestInterfaceEmptyArg(defaultUndefinedTestInterfaceEmptyArg); 8297 } 8298 8299 static void voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8300 { 8301 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8302 TestObjectV8Internal::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethod(info); 8303 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8304 } 8305 8306 static void voidMethodDefaultUndefinedLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8307 { 8308 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDefaultUndefinedLongArg", "TestObject", info.Holder(), info.GetIsolate()); 8309 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8310 int defaultUndefinedLongArg; 8311 { 8312 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(defaultUndefinedLongArg, toInt32(info[0], exceptionState), exceptionState); 8313 } 8314 impl->voidMethodDefaultUndefinedLongArg(defaultUndefinedLongArg); 8315 } 8316 8317 static void voidMethodDefaultUndefinedLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8318 { 8319 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8320 TestObjectV8Internal::voidMethodDefaultUndefinedLongArgMethod(info); 8321 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8322 } 8323 8324 static void voidMethodDefaultUndefinedStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8325 { 8326 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8327 V8StringResource<> defaultUndefinedStringArg; 8328 { 8329 TOSTRING_VOID_INTERNAL(defaultUndefinedStringArg, info[0]); 8330 } 8331 impl->voidMethodDefaultUndefinedStringArg(defaultUndefinedStringArg); 8332 } 8333 8334 static void voidMethodDefaultUndefinedStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8335 { 8336 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8337 TestObjectV8Internal::voidMethodDefaultUndefinedStringArgMethod(info); 8338 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8339 } 8340 8341 static void voidMethodEnforceRangeLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8342 { 8343 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodEnforceRangeLongArg", "TestObject", info.Holder(), info.GetIsolate()); 8344 if (UNLIKELY(info.Length() < 1)) { 8345 setMinimumArityTypeError(exceptionState, 1, info.Length()); 8346 exceptionState.throwIfNeeded(); 8347 return; 8348 } 8349 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8350 int enforceRangeLongArg; 8351 { 8352 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(enforceRangeLongArg, toInt32(info[0], EnforceRange, exceptionState), exceptionState); 8353 } 8354 impl->voidMethodEnforceRangeLongArg(enforceRangeLongArg); 8355 } 8356 8357 static void voidMethodEnforceRangeLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8358 { 8359 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8360 TestObjectV8Internal::voidMethodEnforceRangeLongArgMethod(info); 8361 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8362 } 8363 8364 static void voidMethodTreatNullAsEmptyStringStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8365 { 8366 if (UNLIKELY(info.Length() < 1)) { 8367 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTreatNullAsEmptyStringStringArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 8368 return; 8369 } 8370 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8371 V8StringResource<TreatNullAsEmptyString> treatNullAsEmptyStringStringArg; 8372 { 8373 TOSTRING_VOID_INTERNAL(treatNullAsEmptyStringStringArg, info[0]); 8374 } 8375 impl->voidMethodTreatNullAsEmptyStringStringArg(treatNullAsEmptyStringStringArg); 8376 } 8377 8378 static void voidMethodTreatNullAsEmptyStringStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8379 { 8380 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8381 TestObjectV8Internal::voidMethodTreatNullAsEmptyStringStringArgMethod(info); 8382 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8383 } 8384 8385 static void voidMethodTreatNullAsNullStringStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8386 { 8387 if (UNLIKELY(info.Length() < 1)) { 8388 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTreatNullAsNullStringStringArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 8389 return; 8390 } 8391 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8392 V8StringResource<TreatNullAsNullString> treatNullAsNullStringStringArg; 8393 { 8394 TOSTRING_VOID_INTERNAL(treatNullAsNullStringStringArg, info[0]); 8395 } 8396 impl->voidMethodTreatNullAsNullStringStringArg(treatNullAsNullStringStringArg); 8397 } 8398 8399 static void voidMethodTreatNullAsNullStringStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8400 { 8401 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8402 TestObjectV8Internal::voidMethodTreatNullAsNullStringStringArgMethod(info); 8403 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8404 } 8405 8406 static void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8407 { 8408 if (UNLIKELY(info.Length() < 1)) { 8409 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 8410 return; 8411 } 8412 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8413 V8StringResource<TreatNullAndUndefinedAsNullString> treatNullAsNullStringStringArg; 8414 { 8415 TOSTRING_VOID_INTERNAL(treatNullAsNullStringStringArg, info[0]); 8416 } 8417 impl->voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg(treatNullAsNullStringStringArg); 8418 } 8419 8420 static void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8421 { 8422 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8423 TestObjectV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethod(info); 8424 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8425 } 8426 8427 static void activityLoggingAccessForAllWorldsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8428 { 8429 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8430 impl->activityLoggingAccessForAllWorldsMethod(); 8431 } 8432 8433 static void activityLoggingAccessForAllWorldsMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8434 { 8435 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8436 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 8437 V8PerContextData* contextData = scriptState->perContextData(); 8438 if (contextData && contextData->activityLogger()) { 8439 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggingAccessForAllWorldsMethod", "TestObject", info.Holder(), info.GetIsolate()); 8440 Vector<v8::Handle<v8::Value> > loggerArgs = toImplArguments<v8::Handle<v8::Value> >(info, 0, exceptionState); 8441 contextData->activityLogger()->logMethod("TestObject.activityLoggingAccessForAllWorldsMethod", info.Length(), loggerArgs.data()); 8442 } 8443 TestObjectV8Internal::activityLoggingAccessForAllWorldsMethodMethod(info); 8444 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8445 } 8446 8447 static void callWithExecutionContextVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8448 { 8449 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8450 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 8451 impl->callWithExecutionContextVoidMethod(executionContext); 8452 } 8453 8454 static void callWithExecutionContextVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8455 { 8456 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8457 TestObjectV8Internal::callWithExecutionContextVoidMethodMethod(info); 8458 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8459 } 8460 8461 static void callWithScriptStateVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8462 { 8463 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8464 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8465 impl->callWithScriptStateVoidMethod(scriptState); 8466 } 8467 8468 static void callWithScriptStateVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8469 { 8470 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8471 TestObjectV8Internal::callWithScriptStateVoidMethodMethod(info); 8472 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8473 } 8474 8475 static void callWithScriptStateLongMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8476 { 8477 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8478 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8479 int result = impl->callWithScriptStateLongMethod(scriptState); 8480 v8SetReturnValueInt(info, result); 8481 } 8482 8483 static void callWithScriptStateLongMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8484 { 8485 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8486 TestObjectV8Internal::callWithScriptStateLongMethodMethod(info); 8487 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8488 } 8489 8490 static void callWithScriptStateExecutionContextVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8491 { 8492 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8493 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8494 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 8495 impl->callWithScriptStateExecutionContextVoidMethod(scriptState, executionContext); 8496 } 8497 8498 static void callWithScriptStateExecutionContextVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8499 { 8500 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8501 TestObjectV8Internal::callWithScriptStateExecutionContextVoidMethodMethod(info); 8502 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8503 } 8504 8505 static void callWithScriptStateScriptArgumentsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8506 { 8507 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8508 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8509 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArguments(scriptState, info, 0)); 8510 impl->callWithScriptStateScriptArgumentsVoidMethod(scriptState, scriptArguments.release()); 8511 } 8512 8513 static void callWithScriptStateScriptArgumentsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8514 { 8515 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8516 TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodMethod(info); 8517 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8518 } 8519 8520 static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8521 { 8522 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8523 bool optionalBooleanArg; 8524 { 8525 if (UNLIKELY(info.Length() <= 0)) { 8526 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8527 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArguments(scriptState, info, 1)); 8528 impl->callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(scriptState, scriptArguments.release()); 8529 return; 8530 } 8531 optionalBooleanArg = info[0]->BooleanValue(); 8532 } 8533 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 8534 RefPtrWillBeRawPtr<ScriptArguments> scriptArguments(createScriptArguments(scriptState, info, 1)); 8535 impl->callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg(scriptState, scriptArguments.release(), optionalBooleanArg); 8536 } 8537 8538 static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8539 { 8540 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8541 TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod(info); 8542 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8543 } 8544 8545 static void callWithActiveWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8546 { 8547 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8548 impl->callWithActiveWindow(callingDOMWindow(info.GetIsolate())); 8549 } 8550 8551 static void callWithActiveWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8552 { 8553 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8554 TestObjectV8Internal::callWithActiveWindowMethod(info); 8555 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8556 } 8557 8558 static void callWithActiveWindowScriptWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8559 { 8560 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8561 impl->callWithActiveWindowScriptWindow(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate())); 8562 } 8563 8564 static void callWithActiveWindowScriptWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8565 { 8566 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8567 TestObjectV8Internal::callWithActiveWindowScriptWindowMethod(info); 8568 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8569 } 8570 8571 static void checkSecurityForNodeVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8572 { 8573 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8574 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->checkSecurityForNodeVoidMethod(exceptionState), exceptionState)) { 8575 v8SetReturnValueNull(info); 8576 exceptionState.throwIfNeeded(); 8577 return; 8578 } 8579 impl->checkSecurityForNodeVoidMethod(); 8580 } 8581 8582 static void checkSecurityForNodeVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8583 { 8584 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8585 TestObjectV8Internal::checkSecurityForNodeVoidMethodMethod(info); 8586 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8587 } 8588 8589 #if ENABLE(CONDITION) 8590 static void conditionalConditionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8591 { 8592 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8593 impl->conditionalConditionVoidMethod(); 8594 } 8595 #endif // ENABLE(CONDITION) 8596 8597 #if ENABLE(CONDITION) 8598 static void conditionalConditionVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8599 { 8600 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8601 TestObjectV8Internal::conditionalConditionVoidMethodMethod(info); 8602 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8603 } 8604 #endif // ENABLE(CONDITION) 8605 8606 #if ENABLE(CONDITION) 8607 static void conditionalConditionStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8608 { 8609 TestObject::conditionalConditionStaticVoidMethod(); 8610 } 8611 #endif // ENABLE(CONDITION) 8612 8613 #if ENABLE(CONDITION) 8614 static void conditionalConditionStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8615 { 8616 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8617 TestObjectV8Internal::conditionalConditionStaticVoidMethodMethod(info); 8618 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8619 } 8620 #endif // ENABLE(CONDITION) 8621 8622 static void customVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8623 { 8624 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8625 V8TestObject::customVoidMethodMethodCustom(info); 8626 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8627 } 8628 8629 #if ENABLE(CONDITION) 8630 static void conditionalConditionCustomVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8631 { 8632 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8633 V8TestObject::conditionalConditionCustomVoidMethodMethodCustom(info); 8634 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8635 } 8636 #endif // ENABLE(CONDITION) 8637 8638 static void customElementCallbacksVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8639 { 8640 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8641 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 8642 impl->customElementCallbacksVoidMethod(); 8643 } 8644 8645 static void customElementCallbacksVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8646 { 8647 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8648 TestObjectV8Internal::customElementCallbacksVoidMethodMethod(info); 8649 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8650 } 8651 8652 static void deprecatedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8653 { 8654 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8655 impl->deprecatedVoidMethod(); 8656 } 8657 8658 static void deprecatedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8659 { 8660 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8661 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::voidMethod); 8662 TestObjectV8Internal::deprecatedVoidMethodMethod(info); 8663 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8664 } 8665 8666 static void doNotCheckSignatureVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8667 { 8668 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8669 impl->doNotCheckSignatureVoidMethod(); 8670 } 8671 8672 static void doNotCheckSignatureVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8673 { 8674 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8675 TestObjectV8Internal::doNotCheckSignatureVoidMethodMethod(info); 8676 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8677 } 8678 8679 static void implementedAsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8680 { 8681 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8682 impl->implementedAsMethodName(); 8683 } 8684 8685 static void implementedAsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8686 { 8687 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8688 TestObjectV8Internal::implementedAsVoidMethodMethod(info); 8689 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8690 } 8691 8692 static void measureAsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8693 { 8694 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8695 impl->measureAsVoidMethod(); 8696 } 8697 8698 static void measureAsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8699 { 8700 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8701 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 8702 TestObjectV8Internal::measureAsVoidMethodMethod(info); 8703 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8704 } 8705 8706 static void DeprecateAsOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8707 { 8708 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8709 impl->DeprecateAsOverloadedMethod(); 8710 } 8711 8712 static void DeprecateAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8713 { 8714 ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8715 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8716 int arg; 8717 { 8718 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8719 } 8720 impl->DeprecateAsOverloadedMethod(arg); 8721 } 8722 8723 static void DeprecateAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8724 { 8725 ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8726 switch (std::min(1, info.Length())) { 8727 case 0: 8728 if (true) { 8729 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureA); 8730 DeprecateAsOverloadedMethod1Method(info); 8731 return; 8732 } 8733 break; 8734 case 1: 8735 if (true) { 8736 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureB); 8737 DeprecateAsOverloadedMethod2Method(info); 8738 return; 8739 } 8740 break; 8741 default: 8742 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8743 exceptionState.throwIfNeeded(); 8744 return; 8745 } 8746 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8747 exceptionState.throwIfNeeded(); 8748 } 8749 8750 static void DeprecateAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8751 { 8752 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8753 TestObjectV8Internal::DeprecateAsOverloadedMethodMethod(info); 8754 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8755 } 8756 8757 static void DeprecateAsSameValueOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8758 { 8759 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8760 impl->DeprecateAsSameValueOverloadedMethod(); 8761 } 8762 8763 static void DeprecateAsSameValueOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8764 { 8765 ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8766 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8767 int arg; 8768 { 8769 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8770 } 8771 impl->DeprecateAsSameValueOverloadedMethod(arg); 8772 } 8773 8774 static void DeprecateAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8775 { 8776 ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8777 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 8778 switch (std::min(1, info.Length())) { 8779 case 0: 8780 if (true) { 8781 DeprecateAsSameValueOverloadedMethod1Method(info); 8782 return; 8783 } 8784 break; 8785 case 1: 8786 if (true) { 8787 DeprecateAsSameValueOverloadedMethod2Method(info); 8788 return; 8789 } 8790 break; 8791 default: 8792 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8793 exceptionState.throwIfNeeded(); 8794 return; 8795 } 8796 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8797 exceptionState.throwIfNeeded(); 8798 } 8799 8800 static void DeprecateAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8801 { 8802 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8803 TestObjectV8Internal::DeprecateAsSameValueOverloadedMethodMethod(info); 8804 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8805 } 8806 8807 static void measureAsOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8808 { 8809 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8810 impl->measureAsOverloadedMethod(); 8811 } 8812 8813 static void measureAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8814 { 8815 ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8816 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8817 int arg; 8818 { 8819 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8820 } 8821 impl->measureAsOverloadedMethod(arg); 8822 } 8823 8824 static void measureAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8825 { 8826 ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8827 switch (std::min(1, info.Length())) { 8828 case 0: 8829 if (true) { 8830 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureA); 8831 measureAsOverloadedMethod1Method(info); 8832 return; 8833 } 8834 break; 8835 case 1: 8836 if (true) { 8837 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureB); 8838 measureAsOverloadedMethod2Method(info); 8839 return; 8840 } 8841 break; 8842 default: 8843 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8844 exceptionState.throwIfNeeded(); 8845 return; 8846 } 8847 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8848 exceptionState.throwIfNeeded(); 8849 } 8850 8851 static void measureAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8852 { 8853 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8854 TestObjectV8Internal::measureAsOverloadedMethodMethod(info); 8855 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8856 } 8857 8858 static void measureAsSameValueOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8859 { 8860 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8861 impl->measureAsSameValueOverloadedMethod(); 8862 } 8863 8864 static void measureAsSameValueOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8865 { 8866 ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8867 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8868 int arg; 8869 { 8870 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8871 } 8872 impl->measureAsSameValueOverloadedMethod(arg); 8873 } 8874 8875 static void measureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8876 { 8877 ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8878 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 8879 switch (std::min(1, info.Length())) { 8880 case 0: 8881 if (true) { 8882 measureAsSameValueOverloadedMethod1Method(info); 8883 return; 8884 } 8885 break; 8886 case 1: 8887 if (true) { 8888 measureAsSameValueOverloadedMethod2Method(info); 8889 return; 8890 } 8891 break; 8892 default: 8893 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8894 exceptionState.throwIfNeeded(); 8895 return; 8896 } 8897 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8898 exceptionState.throwIfNeeded(); 8899 } 8900 8901 static void measureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8902 { 8903 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8904 TestObjectV8Internal::measureAsSameValueOverloadedMethodMethod(info); 8905 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8906 } 8907 8908 static void deprecateAsMeasureAsSameValueOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8909 { 8910 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8911 impl->deprecateAsMeasureAsSameValueOverloadedMethod(); 8912 } 8913 8914 static void deprecateAsMeasureAsSameValueOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8915 { 8916 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8917 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8918 int arg; 8919 { 8920 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8921 } 8922 impl->deprecateAsMeasureAsSameValueOverloadedMethod(arg); 8923 } 8924 8925 static void deprecateAsMeasureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8926 { 8927 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8928 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 8929 switch (std::min(1, info.Length())) { 8930 case 0: 8931 if (true) { 8932 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureA); 8933 deprecateAsMeasureAsSameValueOverloadedMethod1Method(info); 8934 return; 8935 } 8936 break; 8937 case 1: 8938 if (true) { 8939 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureB); 8940 deprecateAsMeasureAsSameValueOverloadedMethod2Method(info); 8941 return; 8942 } 8943 break; 8944 default: 8945 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8946 exceptionState.throwIfNeeded(); 8947 return; 8948 } 8949 exceptionState.throwTypeError("No function was found that matched the signature provided."); 8950 exceptionState.throwIfNeeded(); 8951 } 8952 8953 static void deprecateAsMeasureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 8954 { 8955 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 8956 TestObjectV8Internal::deprecateAsMeasureAsSameValueOverloadedMethodMethod(info); 8957 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 8958 } 8959 8960 static void deprecateAsSameValueMeasureAsOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8961 { 8962 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8963 impl->deprecateAsSameValueMeasureAsOverloadedMethod(); 8964 } 8965 8966 static void deprecateAsSameValueMeasureAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 8967 { 8968 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8969 TestObject* impl = V8TestObject::toImpl(info.Holder()); 8970 int arg; 8971 { 8972 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 8973 } 8974 impl->deprecateAsSameValueMeasureAsOverloadedMethod(arg); 8975 } 8976 8977 static void deprecateAsSameValueMeasureAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 8978 { 8979 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 8980 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); 8981 switch (std::min(1, info.Length())) { 8982 case 0: 8983 if (true) { 8984 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureA); 8985 deprecateAsSameValueMeasureAsOverloadedMethod1Method(info); 8986 return; 8987 } 8988 break; 8989 case 1: 8990 if (true) { 8991 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureB); 8992 deprecateAsSameValueMeasureAsOverloadedMethod2Method(info); 8993 return; 8994 } 8995 break; 8996 default: 8997 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 8998 exceptionState.throwIfNeeded(); 8999 return; 9000 } 9001 exceptionState.throwTypeError("No function was found that matched the signature provided."); 9002 exceptionState.throwIfNeeded(); 9003 } 9004 9005 static void deprecateAsSameValueMeasureAsOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9006 { 9007 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9008 TestObjectV8Internal::deprecateAsSameValueMeasureAsOverloadedMethodMethod(info); 9009 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9010 } 9011 9012 static void deprecateAsSameValueMeasureAsSameValueOverloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9013 { 9014 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9015 impl->deprecateAsSameValueMeasureAsSameValueOverloadedMethod(); 9016 } 9017 9018 static void deprecateAsSameValueMeasureAsSameValueOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9019 { 9020 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 9021 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9022 int arg; 9023 { 9024 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(arg, toInt32(info[0], exceptionState), exceptionState); 9025 } 9026 impl->deprecateAsSameValueMeasureAsSameValueOverloadedMethod(arg); 9027 } 9028 9029 static void deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9030 { 9031 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); 9032 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureB); 9033 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureA); 9034 switch (std::min(1, info.Length())) { 9035 case 0: 9036 if (true) { 9037 deprecateAsSameValueMeasureAsSameValueOverloadedMethod1Method(info); 9038 return; 9039 } 9040 break; 9041 case 1: 9042 if (true) { 9043 deprecateAsSameValueMeasureAsSameValueOverloadedMethod2Method(info); 9044 return; 9045 } 9046 break; 9047 default: 9048 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, info.Length())); 9049 exceptionState.throwIfNeeded(); 9050 return; 9051 } 9052 exceptionState.throwTypeError("No function was found that matched the signature provided."); 9053 exceptionState.throwIfNeeded(); 9054 } 9055 9056 static void deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9057 { 9058 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9059 TestObjectV8Internal::deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethod(info); 9060 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9061 } 9062 9063 static void notEnumerableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9064 { 9065 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9066 impl->notEnumerableVoidMethod(); 9067 } 9068 9069 static void notEnumerableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9070 { 9071 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9072 TestObjectV8Internal::notEnumerableVoidMethodMethod(info); 9073 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9074 } 9075 9076 static void perContextEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9077 { 9078 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9079 impl->perContextEnabledVoidMethod(); 9080 } 9081 9082 static void perContextEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9083 { 9084 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9085 TestObjectV8Internal::perContextEnabledVoidMethodMethod(info); 9086 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9087 } 9088 9089 static void perWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9090 { 9091 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9092 impl->perWorldBindingsVoidMethod(); 9093 } 9094 9095 static void perWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9096 { 9097 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9098 TestObjectV8Internal::perWorldBindingsVoidMethodMethod(info); 9099 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9100 } 9101 9102 static void perWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9103 { 9104 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9105 impl->perWorldBindingsVoidMethod(); 9106 } 9107 9108 static void perWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9109 { 9110 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9111 TestObjectV8Internal::perWorldBindingsVoidMethodMethodForMainWorld(info); 9112 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9113 } 9114 9115 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9116 { 9117 if (UNLIKELY(info.Length() < 1)) { 9118 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("perWorldBindingsVoidMethodTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 9119 return; 9120 } 9121 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9122 TestInterfaceEmpty* testInterfaceEmptyArg; 9123 { 9124 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 9125 } 9126 impl->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 9127 } 9128 9129 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9130 { 9131 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9132 TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethod(info); 9133 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9134 } 9135 9136 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9137 { 9138 if (UNLIKELY(info.Length() < 1)) { 9139 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("perWorldBindingsVoidMethodTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 9140 return; 9141 } 9142 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9143 TestInterfaceEmpty* testInterfaceEmptyArg; 9144 { 9145 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 9146 } 9147 impl->perWorldBindingsVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 9148 } 9149 9150 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9151 { 9152 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9153 TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodForMainWorld(info); 9154 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9155 } 9156 9157 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9158 { 9159 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9160 impl->activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); 9161 } 9162 9163 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9164 { 9165 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9166 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 9167 V8PerContextData* contextData = scriptState->perContextData(); 9168 if (contextData && contextData->activityLogger()) { 9169 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggingForAllWorldsPerWorldBindingsVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9170 Vector<v8::Handle<v8::Value> > loggerArgs = toImplArguments<v8::Handle<v8::Value> >(info, 0, exceptionState); 9171 contextData->activityLogger()->logMethod("TestObject.activityLoggingForAllWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); 9172 } 9173 TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(info); 9174 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9175 } 9176 9177 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9178 { 9179 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9180 impl->activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); 9181 } 9182 9183 static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9184 { 9185 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9186 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 9187 V8PerContextData* contextData = scriptState->perContextData(); 9188 if (contextData && contextData->activityLogger()) { 9189 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggingForAllWorldsPerWorldBindingsVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9190 Vector<v8::Handle<v8::Value> > loggerArgs = toImplArguments<v8::Handle<v8::Value> >(info, 0, exceptionState); 9191 contextData->activityLogger()->logMethod("TestObject.activityLoggingForAllWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); 9192 } 9193 TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodForMainWorld(info); 9194 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9195 } 9196 9197 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9198 { 9199 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9200 impl->activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod(); 9201 } 9202 9203 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9204 { 9205 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9206 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext()); 9207 V8PerContextData* contextData = scriptState->perContextData(); 9208 if (contextData && contextData->activityLogger()) { 9209 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9210 Vector<v8::Handle<v8::Value> > loggerArgs = toImplArguments<v8::Handle<v8::Value> >(info, 0, exceptionState); 9211 contextData->activityLogger()->logMethod("TestObject.activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); 9212 } 9213 TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethod(info); 9214 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9215 } 9216 9217 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9218 { 9219 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9220 impl->activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod(); 9221 } 9222 9223 static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9224 { 9225 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9226 TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodForMainWorld(info); 9227 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9228 } 9229 9230 static void raisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9231 { 9232 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9233 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9234 impl->raisesExceptionVoidMethod(exceptionState); 9235 if (exceptionState.hadException()) { 9236 exceptionState.throwIfNeeded(); 9237 return; 9238 } 9239 } 9240 9241 static void raisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9242 { 9243 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9244 TestObjectV8Internal::raisesExceptionVoidMethodMethod(info); 9245 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9246 } 9247 9248 static void raisesExceptionStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9249 { 9250 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionStringMethod", "TestObject", info.Holder(), info.GetIsolate()); 9251 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9252 String result = impl->raisesExceptionStringMethod(exceptionState); 9253 if (exceptionState.hadException()) { 9254 exceptionState.throwIfNeeded(); 9255 return; 9256 } 9257 v8SetReturnValueString(info, result, info.GetIsolate()); 9258 } 9259 9260 static void raisesExceptionStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9261 { 9262 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9263 TestObjectV8Internal::raisesExceptionStringMethodMethod(info); 9264 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9265 } 9266 9267 static void raisesExceptionVoidMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9268 { 9269 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethodOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate()); 9270 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9271 int optionalLongArg; 9272 { 9273 if (UNLIKELY(info.Length() <= 0)) { 9274 impl->raisesExceptionVoidMethodOptionalLongArg(exceptionState); 9275 if (exceptionState.hadException()) { 9276 exceptionState.throwIfNeeded(); 9277 return; 9278 } 9279 return; 9280 } 9281 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(optionalLongArg, toInt32(info[0], exceptionState), exceptionState); 9282 } 9283 impl->raisesExceptionVoidMethodOptionalLongArg(optionalLongArg, exceptionState); 9284 if (exceptionState.hadException()) { 9285 exceptionState.throwIfNeeded(); 9286 return; 9287 } 9288 } 9289 9290 static void raisesExceptionVoidMethodOptionalLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9291 { 9292 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9293 TestObjectV8Internal::raisesExceptionVoidMethodOptionalLongArgMethod(info); 9294 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9295 } 9296 9297 static void raisesExceptionVoidMethodTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9298 { 9299 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethodTestCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsolate()); 9300 if (UNLIKELY(info.Length() < 1)) { 9301 setMinimumArityTypeError(exceptionState, 1, info.Length()); 9302 exceptionState.throwIfNeeded(); 9303 return; 9304 } 9305 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9306 TestCallbackInterface* testCallbackInterfaceArg; 9307 { 9308 if (info.Length() <= 0 || !info[0]->IsFunction()) { 9309 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function."); 9310 exceptionState.throwIfNeeded(); 9311 return; 9312 } 9313 testCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 9314 } 9315 impl->raisesExceptionVoidMethodTestCallbackInterfaceArg(testCallbackInterfaceArg, exceptionState); 9316 if (exceptionState.hadException()) { 9317 exceptionState.throwIfNeeded(); 9318 return; 9319 } 9320 } 9321 9322 static void raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9323 { 9324 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9325 TestObjectV8Internal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethod(info); 9326 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9327 } 9328 9329 static void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9330 { 9331 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsolate()); 9332 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9333 TestCallbackInterface* optionalTestCallbackInterfaceArg; 9334 { 9335 if (!isUndefinedOrNull(info[0])) { 9336 if (!info[0]->IsFunction()) { 9337 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function."); 9338 exceptionState.throwIfNeeded(); 9339 return; 9340 } 9341 optionalTestCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Handle<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate())); 9342 } else { 9343 optionalTestCallbackInterfaceArg = nullptr; 9344 } 9345 } 9346 impl->raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg(optionalTestCallbackInterfaceArg, exceptionState); 9347 if (exceptionState.hadException()) { 9348 exceptionState.throwIfNeeded(); 9349 return; 9350 } 9351 } 9352 9353 static void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9354 { 9355 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9356 TestObjectV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(info); 9357 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9358 } 9359 9360 static void raisesExceptionTestInterfaceEmptyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9361 { 9362 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionTestInterfaceEmptyVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9363 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9364 RefPtr<TestInterfaceEmpty> result = impl->raisesExceptionTestInterfaceEmptyVoidMethod(exceptionState); 9365 if (exceptionState.hadException()) { 9366 exceptionState.throwIfNeeded(); 9367 return; 9368 } 9369 v8SetReturnValue(info, result.release()); 9370 } 9371 9372 static void raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9373 { 9374 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9375 TestObjectV8Internal::raisesExceptionTestInterfaceEmptyVoidMethodMethod(info); 9376 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9377 } 9378 9379 static void callWithExecutionContextRaisesExceptionVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9380 { 9381 ExceptionState exceptionState(ExceptionState::ExecutionContext, "callWithExecutionContextRaisesExceptionVoidMethodLongArg", "TestObject", info.Holder(), info.GetIsolate()); 9382 if (UNLIKELY(info.Length() < 1)) { 9383 setMinimumArityTypeError(exceptionState, 1, info.Length()); 9384 exceptionState.throwIfNeeded(); 9385 return; 9386 } 9387 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9388 int longArg; 9389 { 9390 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 9391 } 9392 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); 9393 impl->callWithExecutionContextRaisesExceptionVoidMethodLongArg(executionContext, longArg, exceptionState); 9394 if (exceptionState.hadException()) { 9395 exceptionState.throwIfNeeded(); 9396 return; 9397 } 9398 } 9399 9400 static void callWithExecutionContextRaisesExceptionVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9401 { 9402 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9403 TestObjectV8Internal::callWithExecutionContextRaisesExceptionVoidMethodLongArgMethod(info); 9404 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9405 } 9406 9407 static void runtimeEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9408 { 9409 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9410 impl->runtimeEnabledVoidMethod(); 9411 } 9412 9413 static void runtimeEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9414 { 9415 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9416 TestObjectV8Internal::runtimeEnabledVoidMethodMethod(info); 9417 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9418 } 9419 9420 static void perWorldBindingsRuntimeEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9421 { 9422 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9423 impl->perWorldBindingsRuntimeEnabledVoidMethod(); 9424 } 9425 9426 static void perWorldBindingsRuntimeEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9427 { 9428 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9429 TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethod(info); 9430 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9431 } 9432 9433 static void perWorldBindingsRuntimeEnabledVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9434 { 9435 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9436 impl->perWorldBindingsRuntimeEnabledVoidMethod(); 9437 } 9438 9439 static void perWorldBindingsRuntimeEnabledVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 9440 { 9441 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9442 TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodForMainWorld(info); 9443 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9444 } 9445 9446 static void runtimeEnabledOverloadedVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9447 { 9448 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9449 V8StringResource<> stringArg; 9450 { 9451 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 9452 } 9453 impl->runtimeEnabledOverloadedVoidMethod(stringArg); 9454 } 9455 9456 static void runtimeEnabledOverloadedVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9457 { 9458 ExceptionState exceptionState(ExceptionState::ExecutionContext, "runtimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9459 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9460 int longArg; 9461 { 9462 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 9463 } 9464 impl->runtimeEnabledOverloadedVoidMethod(longArg); 9465 } 9466 9467 static void runtimeEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9468 { 9469 ExceptionState exceptionState(ExceptionState::ExecutionContext, "runtimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9470 switch (std::min(1, info.Length())) { 9471 case 1: 9472 if (info[0]->IsNumber()) { 9473 runtimeEnabledOverloadedVoidMethod2Method(info); 9474 return; 9475 } 9476 if (true) { 9477 runtimeEnabledOverloadedVoidMethod1Method(info); 9478 return; 9479 } 9480 if (true) { 9481 runtimeEnabledOverloadedVoidMethod2Method(info); 9482 return; 9483 } 9484 break; 9485 default: 9486 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 9487 exceptionState.throwIfNeeded(); 9488 return; 9489 } 9490 exceptionState.throwTypeError("No function was found that matched the signature provided."); 9491 exceptionState.throwIfNeeded(); 9492 } 9493 9494 static void runtimeEnabledOverloadedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9495 { 9496 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9497 TestObjectV8Internal::runtimeEnabledOverloadedVoidMethodMethod(info); 9498 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9499 } 9500 9501 static void partiallyRuntimeEnabledOverloadedVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9502 { 9503 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9504 V8StringResource<> stringArg; 9505 { 9506 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 9507 } 9508 impl->partiallyRuntimeEnabledOverloadedVoidMethod(stringArg); 9509 } 9510 9511 static void partiallyRuntimeEnabledOverloadedVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9512 { 9513 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9514 TestInterfaceImplementation* testInterface; 9515 { 9516 testInterface = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), info[0]); 9517 } 9518 impl->partiallyRuntimeEnabledOverloadedVoidMethod(testInterface); 9519 } 9520 9521 static void partiallyRuntimeEnabledOverloadedVoidMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info) 9522 { 9523 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partiallyRuntimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9524 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9525 int longArg; 9526 { 9527 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[0], exceptionState), exceptionState); 9528 } 9529 impl->partiallyRuntimeEnabledOverloadedVoidMethod(longArg); 9530 } 9531 9532 static void partiallyRuntimeEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9533 { 9534 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partiallyRuntimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); 9535 switch (std::min(1, info.Length())) { 9536 case 1: 9537 if (RuntimeEnabledFeatures::featureName2Enabled()) { 9538 if (V8TestInterface::hasInstance(info[0], info.GetIsolate())) { 9539 partiallyRuntimeEnabledOverloadedVoidMethod2Method(info); 9540 return; 9541 } 9542 } 9543 if (info[0]->IsNumber()) { 9544 partiallyRuntimeEnabledOverloadedVoidMethod3Method(info); 9545 return; 9546 } 9547 if (RuntimeEnabledFeatures::featureName1Enabled()) { 9548 if (true) { 9549 partiallyRuntimeEnabledOverloadedVoidMethod1Method(info); 9550 return; 9551 } 9552 } 9553 if (true) { 9554 partiallyRuntimeEnabledOverloadedVoidMethod3Method(info); 9555 return; 9556 } 9557 break; 9558 default: 9559 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); 9560 exceptionState.throwIfNeeded(); 9561 return; 9562 } 9563 exceptionState.throwTypeError("No function was found that matched the signature provided."); 9564 exceptionState.throwIfNeeded(); 9565 } 9566 9567 static void partiallyRuntimeEnabledOverloadedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9568 { 9569 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9570 TestObjectV8Internal::partiallyRuntimeEnabledOverloadedVoidMethodMethod(info); 9571 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9572 } 9573 9574 static void treatReturnedNullStringAsNullStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9575 { 9576 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9577 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullStringMethod(), info.GetIsolate()); 9578 } 9579 9580 static void treatReturnedNullStringAsNullStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9581 { 9582 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9583 TestObjectV8Internal::treatReturnedNullStringAsNullStringMethodMethod(info); 9584 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9585 } 9586 9587 static void treatReturnedNullStringAsUndefinedStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9588 { 9589 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9590 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedStringMethod(), info.GetIsolate()); 9591 } 9592 9593 static void treatReturnedNullStringAsUndefinedStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9594 { 9595 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9596 TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringMethodMethod(info); 9597 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9598 } 9599 9600 static void treatReturnedNullStringAsNullByteStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9601 { 9602 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9603 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullByteStringMethod(), info.GetIsolate()); 9604 } 9605 9606 static void treatReturnedNullStringAsNullByteStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9607 { 9608 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9609 TestObjectV8Internal::treatReturnedNullStringAsNullByteStringMethodMethod(info); 9610 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9611 } 9612 9613 static void treatReturnedNullStringAsUndefinedByteStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9614 { 9615 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9616 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedByteStringMethod(), info.GetIsolate()); 9617 } 9618 9619 static void treatReturnedNullStringAsUndefinedByteStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9620 { 9621 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9622 TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringMethodMethod(info); 9623 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9624 } 9625 9626 static void treatReturnedNullStringAsNullScalarValueStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9627 { 9628 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9629 v8SetReturnValueStringOrNull(info, impl->treatReturnedNullStringAsNullScalarValueStringMethod(), info.GetIsolate()); 9630 } 9631 9632 static void treatReturnedNullStringAsNullScalarValueStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9633 { 9634 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9635 TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringMethodMethod(info); 9636 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9637 } 9638 9639 static void treatReturnedNullStringAsUndefinedScalarValueStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9640 { 9641 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9642 v8SetReturnValueStringOrUndefined(info, impl->treatReturnedNullStringAsUndefinedScalarValueStringMethod(), info.GetIsolate()); 9643 } 9644 9645 static void treatReturnedNullStringAsUndefinedScalarValueStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9646 { 9647 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9648 TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringMethodMethod(info); 9649 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9650 } 9651 9652 static void typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9653 { 9654 if (UNLIKELY(info.Length() < 1)) { 9655 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 9656 return; 9657 } 9658 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9659 TestInterfaceEmpty* testInterfaceEmptyArg; 9660 { 9661 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) { 9662 V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg", "TestObject", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate()); 9663 return; 9664 } 9665 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]); 9666 } 9667 impl->typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 9668 } 9669 9670 static void typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9671 { 9672 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9673 TestObjectV8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethod(info); 9674 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9675 } 9676 9677 static void typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9678 { 9679 ExceptionState exceptionState(ExceptionState::ExecutionContext, "typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg", "TestObject", info.Holder(), info.GetIsolate()); 9680 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9681 Vector<RefPtr<TestInterfaceEmpty> > testInterfaceEmptyArg; 9682 { 9683 for (int i = 0; i < info.Length(); ++i) { 9684 if (!V8TestInterfaceEmpty::hasInstance(info[i], info.GetIsolate())) { 9685 exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceEmpty'."); 9686 exceptionState.throwIfNeeded(); 9687 return; 9688 } 9689 testInterfaceEmptyArg.append(V8TestInterfaceEmpty::toImpl(v8::Handle<v8::Object>::Cast(info[i]))); 9690 } 9691 } 9692 impl->typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg(testInterfaceEmptyArg); 9693 } 9694 9695 static void typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9696 { 9697 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9698 TestObjectV8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArgMethod(info); 9699 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9700 } 9701 9702 static void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9703 { 9704 ExceptionState exceptionState(ExceptionState::ExecutionContext, "typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", "TestObject", info.Holder(), info.GetIsolate()); 9705 if (UNLIKELY(info.Length() < 2)) { 9706 setMinimumArityTypeError(exceptionState, 2, info.Length()); 9707 exceptionState.throwIfNeeded(); 9708 return; 9709 } 9710 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9711 float floatArg; 9712 double doubleArg; 9713 { 9714 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toFloat(info[0], exceptionState), exceptionState); 9715 if (!std::isfinite(floatArg)) { 9716 exceptionState.throwTypeError("float parameter 1 is non-finite."); 9717 exceptionState.throwIfNeeded(); 9718 return; 9719 } 9720 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[1], exceptionState), exceptionState); 9721 if (!std::isfinite(doubleArg)) { 9722 exceptionState.throwTypeError("double parameter 2 is non-finite."); 9723 exceptionState.throwIfNeeded(); 9724 return; 9725 } 9726 } 9727 impl->typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg(floatArg, doubleArg); 9728 } 9729 9730 static void typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9731 { 9732 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9733 TestObjectV8Internal::typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethod(info); 9734 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9735 } 9736 9737 static void unforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9738 { 9739 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9740 impl->unforgeableVoidMethod(); 9741 } 9742 9743 static void unforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9744 { 9745 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9746 TestObjectV8Internal::unforgeableVoidMethodMethod(info); 9747 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9748 } 9749 9750 static void voidMethodTestInterfaceGarbageCollectedSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9751 { 9752 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceGarbageCollectedSequenceArg", "TestObject", info.Holder(), info.GetIsolate()); 9753 if (UNLIKELY(info.Length() < 1)) { 9754 setMinimumArityTypeError(exceptionState, 1, info.Length()); 9755 exceptionState.throwIfNeeded(); 9756 return; 9757 } 9758 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9759 HeapVector<Member<TestInterfaceGarbageCollected> > testInterfaceGarbageCollectedSequenceArg; 9760 { 9761 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(testInterfaceGarbageCollectedSequenceArg, (toMemberNativeArray<TestInterfaceGarbageCollected, V8TestInterfaceGarbageCollected>(info[0], 1, info.GetIsolate(), exceptionState)), exceptionState); 9762 } 9763 impl->voidMethodTestInterfaceGarbageCollectedSequenceArg(testInterfaceGarbageCollectedSequenceArg); 9764 } 9765 9766 static void voidMethodTestInterfaceGarbageCollectedSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9767 { 9768 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9769 TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedSequenceArgMethod(info); 9770 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9771 } 9772 9773 static void voidMethodTestInterfaceGarbageCollectedArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9774 { 9775 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceGarbageCollectedArrayArg", "TestObject", info.Holder(), info.GetIsolate()); 9776 if (UNLIKELY(info.Length() < 1)) { 9777 setMinimumArityTypeError(exceptionState, 1, info.Length()); 9778 exceptionState.throwIfNeeded(); 9779 return; 9780 } 9781 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9782 HeapVector<Member<TestInterfaceGarbageCollected> > testInterfaceGarbageCollectedArrayArg; 9783 { 9784 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(testInterfaceGarbageCollectedArrayArg, (toMemberNativeArray<TestInterfaceGarbageCollected, V8TestInterfaceGarbageCollected>(info[0], 1, info.GetIsolate(), exceptionState)), exceptionState); 9785 } 9786 impl->voidMethodTestInterfaceGarbageCollectedArrayArg(testInterfaceGarbageCollectedArrayArg); 9787 } 9788 9789 static void voidMethodTestInterfaceGarbageCollectedArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9790 { 9791 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9792 TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedArrayArgMethod(info); 9793 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9794 } 9795 9796 static void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9797 { 9798 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg", "TestObject", info.Holder(), info.GetIsolate()); 9799 if (UNLIKELY(info.Length() < 1)) { 9800 setMinimumArityTypeError(exceptionState, 1, info.Length()); 9801 exceptionState.throwIfNeeded(); 9802 return; 9803 } 9804 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9805 WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected> > testInterfaceWillBeGarbageCollectedSequenceArg; 9806 { 9807 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(testInterfaceWillBeGarbageCollectedSequenceArg, (toRefPtrWillBeMemberNativeArray<TestInterfaceWillBeGarbageCollected, V8TestInterfaceWillBeGarbageCollected>(info[0], 1, info.GetIsolate(), exceptionState)), exceptionState); 9808 } 9809 impl->voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg(testInterfaceWillBeGarbageCollectedSequenceArg); 9810 } 9811 9812 static void voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9813 { 9814 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9815 TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethod(info); 9816 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9817 } 9818 9819 static void voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9820 { 9821 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceWillBeGarbageCollectedArrayArg", "TestObject", info.Holder(), info.GetIsolate()); 9822 if (UNLIKELY(info.Length() < 1)) { 9823 setMinimumArityTypeError(exceptionState, 1, info.Length()); 9824 exceptionState.throwIfNeeded(); 9825 return; 9826 } 9827 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9828 WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected> > testInterfaceWillBeGarbageCollectedArrayArg; 9829 { 9830 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(testInterfaceWillBeGarbageCollectedArrayArg, (toRefPtrWillBeMemberNativeArray<TestInterfaceWillBeGarbageCollected, V8TestInterfaceWillBeGarbageCollected>(info[0], 1, info.GetIsolate(), exceptionState)), exceptionState); 9831 } 9832 impl->voidMethodTestInterfaceWillBeGarbageCollectedArrayArg(testInterfaceWillBeGarbageCollectedArrayArg); 9833 } 9834 9835 static void voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9836 { 9837 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9838 TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethod(info); 9839 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9840 } 9841 9842 static void voidMethodImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9843 { 9844 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9845 V8TestObject::PrivateScript::voidMethodImplementedInPrivateScriptMethod(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl); 9846 } 9847 9848 static void voidMethodImplementedInPrivateScriptMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9849 { 9850 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9851 TestObjectV8Internal::voidMethodImplementedInPrivateScriptMethod(info); 9852 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9853 } 9854 9855 static void shortMethodImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9856 { 9857 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9858 int result = 0; 9859 if (!V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result)) 9860 return; 9861 v8SetReturnValueInt(info, result); 9862 } 9863 9864 static void shortMethodImplementedInPrivateScriptMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9865 { 9866 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9867 TestObjectV8Internal::shortMethodImplementedInPrivateScriptMethod(info); 9868 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9869 } 9870 9871 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9872 { 9873 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethodWithShortArgumentImplementedInPrivateScript", "TestObject", info.Holder(), info.GetIsolate()); 9874 if (UNLIKELY(info.Length() < 1)) { 9875 setMinimumArityTypeError(exceptionState, 1, info.Length()); 9876 exceptionState.throwIfNeeded(); 9877 return; 9878 } 9879 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9880 int value; 9881 { 9882 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value, toInt16(info[0], exceptionState), exceptionState); 9883 } 9884 int result = 0; 9885 if (!V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPrivateScriptMethod(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, value, &result)) 9886 return; 9887 v8SetReturnValueInt(info, result); 9888 } 9889 9890 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9891 { 9892 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9893 TestObjectV8Internal::shortMethodWithShortArgumentImplementedInPrivateScriptMethod(info); 9894 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9895 } 9896 9897 static void stringMethodWithStringArgumentImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9898 { 9899 if (UNLIKELY(info.Length() < 1)) { 9900 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("stringMethodWithStringArgumentImplementedInPrivateScript", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 9901 return; 9902 } 9903 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9904 V8StringResource<> value; 9905 { 9906 TOSTRING_VOID_INTERNAL(value, info[0]); 9907 } 9908 String result; 9909 if (!V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPrivateScriptMethod(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, value, &result)) 9910 return; 9911 v8SetReturnValueString(info, result, info.GetIsolate()); 9912 } 9913 9914 static void stringMethodWithStringArgumentImplementedInPrivateScriptMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9915 { 9916 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9917 TestObjectV8Internal::stringMethodWithStringArgumentImplementedInPrivateScriptMethod(info); 9918 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9919 } 9920 9921 static void nodeMethodWithNodeArgumentImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9922 { 9923 if (UNLIKELY(info.Length() < 1)) { 9924 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("nodeMethodWithNodeArgumentImplementedInPrivateScript", "TestObject", 1, info.Length(), info.GetIsolate()), info.GetIsolate()); 9925 return; 9926 } 9927 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9928 Node* value; 9929 { 9930 value = V8Node::toImplWithTypeCheck(info.GetIsolate(), info[0]); 9931 } 9932 RefPtrWillBeRawPtr<Node> result = nullptr; 9933 if (!V8TestObject::PrivateScript::nodeMethodWithNodeArgumentImplementedInPrivateScriptMethod(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, value, &result)) 9934 return; 9935 v8SetReturnValue(info, result.release()); 9936 } 9937 9938 static void nodeMethodWithNodeArgumentImplementedInPrivateScriptMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9939 { 9940 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9941 TestObjectV8Internal::nodeMethodWithNodeArgumentImplementedInPrivateScriptMethod(info); 9942 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9943 } 9944 9945 static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9946 { 9947 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodWithVariousArgumentsImplementedInPrivateScript", "TestObject", info.Holder(), info.GetIsolate()); 9948 if (UNLIKELY(info.Length() < 5)) { 9949 setMinimumArityTypeError(exceptionState, 5, info.Length()); 9950 exceptionState.throwIfNeeded(); 9951 return; 9952 } 9953 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9954 Document* document; 9955 Node* node; 9956 int value1; 9957 double value2; 9958 V8StringResource<> string; 9959 { 9960 document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]); 9961 node = V8Node::toImplWithTypeCheck(info.GetIsolate(), info[1]); 9962 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value1, toInt16(info[2], exceptionState), exceptionState); 9963 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value2, toDouble(info[3], exceptionState), exceptionState); 9964 TOSTRING_VOID_INTERNAL(string, info[4]); 9965 } 9966 RefPtrWillBeRawPtr<Node> result = nullptr; 9967 if (!V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, document, node, value1, value2, string, &result)) 9968 return; 9969 v8SetReturnValue(info, result.release()); 9970 } 9971 9972 static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9973 { 9974 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 9975 TestObjectV8Internal::nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(info); 9976 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 9977 } 9978 9979 static void methodImplementedInCPPForPrivateScriptOnlyMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 9980 { 9981 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodImplementedInCPPForPrivateScriptOnly", "TestObject", info.Holder(), info.GetIsolate()); 9982 if (UNLIKELY(info.Length() < 2)) { 9983 setMinimumArityTypeError(exceptionState, 2, info.Length()); 9984 exceptionState.throwIfNeeded(); 9985 return; 9986 } 9987 TestObject* impl = V8TestObject::toImpl(info.Holder()); 9988 int value1; 9989 int value2; 9990 { 9991 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value1, toInt16(info[0], exceptionState), exceptionState); 9992 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(value2, toInt16(info[1], exceptionState), exceptionState); 9993 } 9994 v8SetReturnValueInt(info, impl->methodImplementedInCPPForPrivateScriptOnly(value1, value2)); 9995 } 9996 9997 static void methodImplementedInCPPForPrivateScriptOnlyMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 9998 { 9999 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 10000 TestObjectV8Internal::methodImplementedInCPPForPrivateScriptOnlyMethod(info); 10001 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 10002 } 10003 10004 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 10005 { 10006 TestObject* impl = V8TestObject::toImpl(info.Holder()); 10007 v8SetReturnValueString(info, impl->stringifierAttribute(), info.GetIsolate()); 10008 } 10009 10010 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 10011 { 10012 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 10013 TestObjectV8Internal::toStringMethod(info); 10014 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 10015 } 10016 10017 } // namespace TestObjectV8Internal 10018 10019 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] = { 10020 {"stringifierAttribute", TestObjectV8Internal::stringifierAttributeAttributeGetterCallback, TestObjectV8Internal::stringifierAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10021 {"readonlyStringAttribute", TestObjectV8Internal::readonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10022 {"readonlyTestInterfaceEmptyAttribute", TestObjectV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10023 {"readonlyLongAttribute", TestObjectV8Internal::readonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10024 {"dateAttribute", TestObjectV8Internal::dateAttributeAttributeGetterCallback, TestObjectV8Internal::dateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10025 {"stringAttribute", TestObjectV8Internal::stringAttributeAttributeGetterCallback, TestObjectV8Internal::stringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10026 {"byteStringAttribute", TestObjectV8Internal::byteStringAttributeAttributeGetterCallback, TestObjectV8Internal::byteStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10027 {"scalarValueStringAttribute", TestObjectV8Internal::scalarValueStringAttributeAttributeGetterCallback, TestObjectV8Internal::scalarValueStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10028 {"domTimeStampAttribute", TestObjectV8Internal::domTimeStampAttributeAttributeGetterCallback, TestObjectV8Internal::domTimeStampAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10029 {"booleanAttribute", TestObjectV8Internal::booleanAttributeAttributeGetterCallback, TestObjectV8Internal::booleanAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10030 {"byteAttribute", TestObjectV8Internal::byteAttributeAttributeGetterCallback, TestObjectV8Internal::byteAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10031 {"doubleAttribute", TestObjectV8Internal::doubleAttributeAttributeGetterCallback, TestObjectV8Internal::doubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10032 {"floatAttribute", TestObjectV8Internal::floatAttributeAttributeGetterCallback, TestObjectV8Internal::floatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10033 {"longAttribute", TestObjectV8Internal::longAttributeAttributeGetterCallback, TestObjectV8Internal::longAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10034 {"longLongAttribute", TestObjectV8Internal::longLongAttributeAttributeGetterCallback, TestObjectV8Internal::longLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10035 {"octetAttribute", TestObjectV8Internal::octetAttributeAttributeGetterCallback, TestObjectV8Internal::octetAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10036 {"shortAttribute", TestObjectV8Internal::shortAttributeAttributeGetterCallback, TestObjectV8Internal::shortAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10037 {"unrestrictedDoubleAttribute", TestObjectV8Internal::unrestrictedDoubleAttributeAttributeGetterCallback, TestObjectV8Internal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10038 {"unrestrictedFloatAttribute", TestObjectV8Internal::unrestrictedFloatAttributeAttributeGetterCallback, TestObjectV8Internal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10039 {"unsignedLongAttribute", TestObjectV8Internal::unsignedLongAttributeAttributeGetterCallback, TestObjectV8Internal::unsignedLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10040 {"unsignedLongLongAttribute", TestObjectV8Internal::unsignedLongLongAttributeAttributeGetterCallback, TestObjectV8Internal::unsignedLongLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10041 {"unsignedShortAttribute", TestObjectV8Internal::unsignedShortAttributeAttributeGetterCallback, TestObjectV8Internal::unsignedShortAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10042 {"testInterfaceEmptyAttribute", TestObjectV8Internal::testInterfaceEmptyAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceEmptyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10043 {"testObjectAttribute", TestObjectV8Internal::testObjectAttributeAttributeGetterCallback, TestObjectV8Internal::testObjectAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10044 {"voidCallbackFunctionAttribute", TestObjectV8Internal::voidCallbackFunctionAttributeAttributeGetterCallback, TestObjectV8Internal::voidCallbackFunctionAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10045 {"anyCallbackFunctionOptionalAnyArgAttribute", TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeGetterCallback, TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10046 {"cssAttribute", TestObjectV8Internal::cssAttributeAttributeGetterCallback, TestObjectV8Internal::cssAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10047 {"imeAttribute", TestObjectV8Internal::imeAttributeAttributeGetterCallback, TestObjectV8Internal::imeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10048 {"svgAttribute", TestObjectV8Internal::svgAttributeAttributeGetterCallback, TestObjectV8Internal::svgAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10049 {"xmlAttribute", TestObjectV8Internal::xmlAttributeAttributeGetterCallback, TestObjectV8Internal::xmlAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10050 {"nodeFilterAttribute", TestObjectV8Internal::nodeFilterAttributeAttributeGetterCallback, TestObjectV8Internal::nodeFilterAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10051 {"serializedScriptValueAttribute", TestObjectV8Internal::serializedScriptValueAttributeAttributeGetterCallback, TestObjectV8Internal::serializedScriptValueAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10052 {"anyAttribute", TestObjectV8Internal::anyAttributeAttributeGetterCallback, TestObjectV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10053 {"promiseAttribute", TestObjectV8Internal::promiseAttributeAttributeGetterCallback, TestObjectV8Internal::promiseAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10054 {"windowAttribute", TestObjectV8Internal::windowAttributeAttributeGetterCallback, TestObjectV8Internal::windowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10055 {"documentAttribute", TestObjectV8Internal::documentAttributeAttributeGetterCallback, TestObjectV8Internal::documentAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10056 {"documentFragmentAttribute", TestObjectV8Internal::documentFragmentAttributeAttributeGetterCallback, TestObjectV8Internal::documentFragmentAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10057 {"documentTypeAttribute", TestObjectV8Internal::documentTypeAttributeAttributeGetterCallback, TestObjectV8Internal::documentTypeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10058 {"elementAttribute", TestObjectV8Internal::elementAttributeAttributeGetterCallback, TestObjectV8Internal::elementAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10059 {"nodeAttribute", TestObjectV8Internal::nodeAttributeAttributeGetterCallback, TestObjectV8Internal::nodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10060 {"shadowRootAttribute", TestObjectV8Internal::shadowRootAttributeAttributeGetterCallback, TestObjectV8Internal::shadowRootAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10061 {"arrayBufferAttribute", TestObjectV8Internal::arrayBufferAttributeAttributeGetterCallback, TestObjectV8Internal::arrayBufferAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10062 {"float32ArrayAttribute", TestObjectV8Internal::float32ArrayAttributeAttributeGetterCallback, TestObjectV8Internal::float32ArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10063 {"uint8ArrayAttribute", TestObjectV8Internal::uint8ArrayAttributeAttributeGetterCallback, TestObjectV8Internal::uint8ArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10064 {"self", TestObjectV8Internal::selfAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10065 {"readonlyEventTargetAttribute", TestObjectV8Internal::readonlyEventTargetAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10066 {"readonlyEventTargetOrNullAttribute", TestObjectV8Internal::readonlyEventTargetOrNullAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10067 {"readonlyWindowAttribute", TestObjectV8Internal::readonlyWindowAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10068 {"htmlCollectionAttribute", TestObjectV8Internal::htmlCollectionAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10069 {"htmlElementAttribute", TestObjectV8Internal::htmlElementAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10070 {"stringArrayAttribute", TestObjectV8Internal::stringArrayAttributeAttributeGetterCallback, TestObjectV8Internal::stringArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10071 {"testInterfaceEmptyArrayAttribute", TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceEmptyArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10072 {"floatArrayAttribute", TestObjectV8Internal::floatArrayAttributeAttributeGetterCallback, TestObjectV8Internal::floatArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10073 {"stringOrNullAttribute", TestObjectV8Internal::stringOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::stringOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10074 {"longOrNullAttribute", TestObjectV8Internal::longOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::longOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10075 {"testInterfaceOrNullAttribute", TestObjectV8Internal::testInterfaceOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10076 {"testEnumAttribute", TestObjectV8Internal::testEnumAttributeAttributeGetterCallback, TestObjectV8Internal::testEnumAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10077 {"eventHandlerAttribute", TestObjectV8Internal::eventHandlerAttributeAttributeGetterCallback, TestObjectV8Internal::eventHandlerAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10078 {"activityLoggingAccessForAllWorldsLongAttribute", TestObjectV8Internal::activityLoggingAccessForAllWorldsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingAccessForAllWorldsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10079 {"activityLoggingGetterForAllWorldsLongAttribute", TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingGetterForAllWorldsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10080 {"activityLoggingSetterForAllWorldsLongAttribute", TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingSetterForAllWorldsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10081 {"cachedAttributeAnyAttribute", TestObjectV8Internal::cachedAttributeAnyAttributeAttributeGetterCallback, TestObjectV8Internal::cachedAttributeAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10082 {"cachedArrayAttribute", TestObjectV8Internal::cachedArrayAttributeAttributeGetterCallback, TestObjectV8Internal::cachedArrayAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10083 {"cachedStringOrNoneAttribute", TestObjectV8Internal::cachedStringOrNoneAttributeAttributeGetterCallback, TestObjectV8Internal::cachedStringOrNoneAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10084 {"callWithExecutionContextAnyAttribute", TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeGetterCallback, TestObjectV8Internal::callWithExecutionContextAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10085 {"callWithScriptStateAnyAttribute", TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeGetterCallback, TestObjectV8Internal::callWithScriptStateAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10086 {"callWithExecutionContextAndScriptStateAnyAttribute", TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeGetterCallback, TestObjectV8Internal::callWithExecutionContextAndScriptStateAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10087 {"checkSecurityForNodeReadonlyDocumentAttribute", TestObjectV8Internal::checkSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10088 #if ENABLE(CONDITION) 10089 {"conditionalLongAttribute", TestObjectV8Internal::conditionalLongAttributeAttributeGetterCallback, TestObjectV8Internal::conditionalLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10090 #endif // ENABLE(CONDITION) 10091 {"testInterfaceEmptyConstructorAttribute", TestObjectV8Internal::TestObjectConstructorGetter, TestObjectV8Internal::TestObjectForceSetAttributeOnThisCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterfaceEmpty::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10092 {"testInterfaceEmptyConstructorAttribute", TestObjectV8Internal::testInterfaceEmptyConstructorAttributeConstructorGetterCallback, TestObjectV8Internal::TestObjectForceSetAttributeOnThisCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterfaceEmpty::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10093 {"measureAsFeatureNameTestInterfaceEmptyConstructorAttribute", TestObjectV8Internal::measureAsFeatureNameTestInterfaceEmptyConstructorAttributeConstructorGetterCallback, TestObjectV8Internal::TestObjectForceSetAttributeOnThisCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestInterfaceEmpty::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10094 {"customObjectAttribute", TestObjectV8Internal::customObjectAttributeAttributeGetterCallback, TestObjectV8Internal::customObjectAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10095 {"customGetterLongAttribute", TestObjectV8Internal::customGetterLongAttributeAttributeGetterCallback, TestObjectV8Internal::customGetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10096 {"customGetterReadonlyObjectAttribute", TestObjectV8Internal::customGetterReadonlyObjectAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10097 {"customSetterLongAttribute", TestObjectV8Internal::customSetterLongAttributeAttributeGetterCallback, TestObjectV8Internal::customSetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10098 #if ENABLE(CONDITION) 10099 {"customLongAttribute", TestObjectV8Internal::customLongAttributeAttributeGetterCallback, TestObjectV8Internal::customLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10100 #endif // ENABLE(CONDITION) 10101 {"customElementsCallbacksReadonlyLongAttribute", TestObjectV8Internal::customElementsCallbacksReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10102 {"deprecatedLongAttribute", TestObjectV8Internal::deprecatedLongAttributeAttributeGetterCallback, TestObjectV8Internal::deprecatedLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10103 {"enforceRangeLongAttribute", TestObjectV8Internal::enforceRangeLongAttributeAttributeGetterCallback, TestObjectV8Internal::enforceRangeLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10104 {"implementedAsLongAttribute", TestObjectV8Internal::implementedAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::implementedAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10105 {"customImplementedAsLongAttribute", TestObjectV8Internal::customImplementedAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::customImplementedAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10106 {"customGetterImplementedAsLongAttribute", TestObjectV8Internal::customGetterImplementedAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::customGetterImplementedAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10107 {"customSetterImplementedAsLongAttribute", TestObjectV8Internal::customSetterImplementedAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::customSetterImplementedAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10108 {"measureAsLongAttribute", TestObjectV8Internal::measureAsLongAttributeAttributeGetterCallback, TestObjectV8Internal::measureAsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10109 {"notEnumerableLongAttribute", TestObjectV8Internal::notEnumerableLongAttributeAttributeGetterCallback, TestObjectV8Internal::notEnumerableLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10110 {"perWorldBindingsReadonlyTestInterfaceEmptyAttribute", TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallback, 0, TestObjectV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10111 {"activityLoggingAccessPerWorldBindingsLongAttribute", TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallback, TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10112 {"activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback, TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10113 {"activityLoggingGetterPerWorldBindingsLongAttribute", TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallback, TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10114 {"activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallback, TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallback, TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeGetterCallbackForMainWorld, TestObjectV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10115 {"location", TestObjectV8Internal::locationAttributeGetterCallback, TestObjectV8Internal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10116 {"locationWithException", TestObjectV8Internal::locationWithExceptionAttributeGetterCallback, TestObjectV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10117 {"locationWithCallWith", TestObjectV8Internal::locationWithCallWithAttributeGetterCallback, TestObjectV8Internal::locationWithCallWithAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10118 {"locationByteString", TestObjectV8Internal::locationByteStringAttributeGetterCallback, TestObjectV8Internal::locationByteStringAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10119 {"locationWithPerWorldBindings", TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetterCallback, TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetterCallback, TestObjectV8Internal::locationWithPerWorldBindingsAttributeGetterCallbackForMainWorld, TestObjectV8Internal::locationWithPerWorldBindingsAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10120 {"locationTypeCheckingInterface", TestObjectV8Internal::locationTypeCheckingInterfaceAttributeGetterCallback, TestObjectV8Internal::locationTypeCheckingInterfaceAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10121 {"locationGarbageCollected", TestObjectV8Internal::locationGarbageCollectedAttributeGetterCallback, TestObjectV8Internal::locationGarbageCollectedAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10122 {"locationWillBeGarbageCollected", TestObjectV8Internal::locationWillBeGarbageCollectedAttributeGetterCallback, TestObjectV8Internal::locationWillBeGarbageCollectedAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10123 {"raisesExceptionLongAttribute", TestObjectV8Internal::raisesExceptionLongAttributeAttributeGetterCallback, TestObjectV8Internal::raisesExceptionLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10124 {"raisesExceptionGetterLongAttribute", TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeGetterCallback, TestObjectV8Internal::raisesExceptionGetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10125 {"setterRaisesExceptionLongAttribute", TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeGetterCallback, TestObjectV8Internal::setterRaisesExceptionLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10126 {"raisesExceptionTestInterfaceEmptyAttribute", TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeGetterCallback, TestObjectV8Internal::raisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10127 {"cachedAttributeRaisesExceptionGetterAnyAttribute", TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetterCallback, TestObjectV8Internal::cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10128 {"reflectTestInterfaceAttribute", TestObjectV8Internal::reflectTestInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::reflectTestInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10129 {"reflectReflectedNameAttributeTestAttribute", TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeGetterCallback, TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10130 {"reflectBooleanAttribute", TestObjectV8Internal::reflectBooleanAttributeAttributeGetterCallback, TestObjectV8Internal::reflectBooleanAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10131 {"reflectLongAttribute", TestObjectV8Internal::reflectLongAttributeAttributeGetterCallback, TestObjectV8Internal::reflectLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10132 {"reflectUnsignedShortAttribute", TestObjectV8Internal::reflectUnsignedShortAttributeAttributeGetterCallback, TestObjectV8Internal::reflectUnsignedShortAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10133 {"reflectUnsignedLongAttribute", TestObjectV8Internal::reflectUnsignedLongAttributeAttributeGetterCallback, TestObjectV8Internal::reflectUnsignedLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10134 {"id", TestObjectV8Internal::idAttributeGetterCallback, TestObjectV8Internal::idAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10135 {"name", TestObjectV8Internal::nameAttributeGetterCallback, TestObjectV8Internal::nameAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10136 {"class", TestObjectV8Internal::classAttributeGetterCallback, TestObjectV8Internal::classAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10137 {"reflectedId", TestObjectV8Internal::reflectedIdAttributeGetterCallback, TestObjectV8Internal::reflectedIdAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10138 {"reflectedName", TestObjectV8Internal::reflectedNameAttributeGetterCallback, TestObjectV8Internal::reflectedNameAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10139 {"reflectedClass", TestObjectV8Internal::reflectedClassAttributeGetterCallback, TestObjectV8Internal::reflectedClassAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10140 {"limitedToOnlyOneAttribute", TestObjectV8Internal::limitedToOnlyOneAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10141 {"limitedToOnlyAttribute", TestObjectV8Internal::limitedToOnlyAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10142 {"limitedToOnlyOtherAttribute", TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeGetterCallback, TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10143 {"limitedWithMissingDefaultAttribute", TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10144 {"limitedWithInvalidMissingDefaultAttribute", TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeGetterCallback, TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10145 {"corsSettingAttribute", TestObjectV8Internal::corsSettingAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10146 {"limitedWithEmptyMissingInvalidAttribute", TestObjectV8Internal::limitedWithEmptyMissingInvalidAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10147 {"replaceableReadonlyLongAttribute", TestObjectV8Internal::replaceableReadonlyLongAttributeAttributeGetterCallback, TestObjectV8Internal::TestObjectForceSetAttributeOnThisCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10148 {"locationReplaceable", TestObjectV8Internal::locationReplaceableAttributeGetterCallback, TestObjectV8Internal::locationReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10149 {"setterCallWithActiveWindowAndFirstWindowStringAttribute", TestObjectV8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeGetterCallback, TestObjectV8Internal::setterCallWithActiveWindowAndFirstWindowStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10150 {"setterCallWithExecutionContextStringAttribute", TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeGetterCallback, TestObjectV8Internal::setterCallWithExecutionContextStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10151 {"treatNullAsEmptyStringStringAttribute", TestObjectV8Internal::treatNullAsEmptyStringStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatNullAsEmptyStringStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10152 {"treatNullAsNullStringStringAttribute", TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatNullAsNullStringStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10153 {"treatReturnedNullStringAsNullStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsNullStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10154 {"treatReturnedNullStringAsUndefinedStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10155 {"cachedTreatReturnedNullStringAsUndefinedStringAttribute", TestObjectV8Internal::cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeGetterCallback, TestObjectV8Internal::cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10156 {"treatReturnedNullStringAsNullByteStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsNullByteStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsNullByteStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10157 {"treatReturnedNullStringAsUndefinedByteStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10158 {"treatReturnedNullStringAsNullScalarValueStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10159 {"treatReturnedNullStringAsUndefinedScalarValueStringAttribute", TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeGetterCallback, TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10160 {"typeCheckingInterfaceFloatAttribute", TestObjectV8Internal::typeCheckingInterfaceFloatAttributeAttributeGetterCallback, TestObjectV8Internal::typeCheckingInterfaceFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10161 {"typeCheckingInterfaceTestInterfaceAttribute", TestObjectV8Internal::typeCheckingInterfaceTestInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::typeCheckingInterfaceTestInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10162 {"typeCheckingInterfaceTestInterfaceOrNullAttribute", TestObjectV8Internal::typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10163 {"urlStringAttribute", TestObjectV8Internal::urlStringAttributeAttributeGetterCallback, TestObjectV8Internal::urlStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10164 {"urlStringAttribute", TestObjectV8Internal::urlStringAttributeAttributeGetterCallback, TestObjectV8Internal::urlStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10165 {"unforgeableLongAttribute", TestObjectV8Internal::unforgeableLongAttributeAttributeGetterCallback, TestObjectV8Internal::unforgeableLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS_OVERWRITING), static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10166 {"testInterfaceAttribute", TestObjectV8Internal::testInterfaceAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10167 {"testInterfaceGarbageCollectedAttribute", TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10168 {"testInterfaceGarbageCollectedOrNullAttribute", TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceGarbageCollectedOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10169 {"testInterfaceWillBeGarbageCollectedAttribute", TestObjectV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceWillBeGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10170 {"testInterfaceWillBeGarbageCollectedOrNullAttribute", TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetterCallback, TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10171 {"readonlyShortAttribute", TestObjectV8Internal::readonlyShortAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10172 {"shortAttribute", TestObjectV8Internal::shortAttributeAttributeGetterCallback, TestObjectV8Internal::shortAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10173 {"stringAttribute", TestObjectV8Internal::stringAttributeAttributeGetterCallback, TestObjectV8Internal::stringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10174 {"nodeAttribute", TestObjectV8Internal::nodeAttributeAttributeGetterCallback, TestObjectV8Internal::nodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10175 {"attributeImplementedInCPPForPrivateScriptOnly", TestObjectV8Internal::attributeImplementedInCPPForPrivateScriptOnlyAttributeGetterCallback, TestObjectV8Internal::attributeImplementedInCPPForPrivateScriptOnlyAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::OnlyExposedToPrivateScript, V8DOMConfiguration::OnInstance}, 10176 {"enumForPrivateScript", TestObjectV8Internal::enumForPrivateScriptAttributeGetterCallback, TestObjectV8Internal::enumForPrivateScriptAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, 10177 }; 10178 10179 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = { 10180 {"exposeJSAccessorsLongAttribute", TestObjectV8Internal::exposeJSAccessorsLongAttributeAttributeGetterCallback, TestObjectV8Internal::exposeJSAccessorsLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts}, 10181 }; 10182 10183 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { 10184 {"voidMethod", TestObjectV8Internal::voidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10185 {"dateMethod", TestObjectV8Internal::dateMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10186 {"stringMethod", TestObjectV8Internal::stringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10187 {"byteStringMethod", TestObjectV8Internal::byteStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10188 {"scalarValueStringMethod", TestObjectV8Internal::scalarValueStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10189 {"readonlyDOMTimeStampMethod", TestObjectV8Internal::readonlyDOMTimeStampMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10190 {"booleanMethod", TestObjectV8Internal::booleanMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10191 {"byteMethod", TestObjectV8Internal::byteMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10192 {"doubleMethod", TestObjectV8Internal::doubleMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10193 {"floatMethod", TestObjectV8Internal::floatMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10194 {"longMethod", TestObjectV8Internal::longMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10195 {"longLongMethod", TestObjectV8Internal::longLongMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10196 {"octetMethod", TestObjectV8Internal::octetMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10197 {"shortMethod", TestObjectV8Internal::shortMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10198 {"unsignedLongMethod", TestObjectV8Internal::unsignedLongMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10199 {"unsignedLongLongMethod", TestObjectV8Internal::unsignedLongLongMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10200 {"unsignedShortMethod", TestObjectV8Internal::unsignedShortMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10201 {"voidMethodDateArg", TestObjectV8Internal::voidMethodDateArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10202 {"voidMethodStringArg", TestObjectV8Internal::voidMethodStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10203 {"voidMethodByteStringArg", TestObjectV8Internal::voidMethodByteStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10204 {"voidMethodScalarValueStringArg", TestObjectV8Internal::voidMethodScalarValueStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10205 {"voidMethodDOMTimeStampArg", TestObjectV8Internal::voidMethodDOMTimeStampArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10206 {"voidMethodBooleanArg", TestObjectV8Internal::voidMethodBooleanArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10207 {"voidMethodByteArg", TestObjectV8Internal::voidMethodByteArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10208 {"voidMethodDoubleArg", TestObjectV8Internal::voidMethodDoubleArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10209 {"voidMethodFloatArg", TestObjectV8Internal::voidMethodFloatArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10210 {"voidMethodLongArg", TestObjectV8Internal::voidMethodLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10211 {"voidMethodLongLongArg", TestObjectV8Internal::voidMethodLongLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10212 {"voidMethodOctetArg", TestObjectV8Internal::voidMethodOctetArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10213 {"voidMethodShortArg", TestObjectV8Internal::voidMethodShortArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10214 {"voidMethodUnsignedLongArg", TestObjectV8Internal::voidMethodUnsignedLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10215 {"voidMethodUnsignedLongLongArg", TestObjectV8Internal::voidMethodUnsignedLongLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10216 {"voidMethodUnsignedShortArg", TestObjectV8Internal::voidMethodUnsignedShortArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10217 {"testInterfaceEmptyMethod", TestObjectV8Internal::testInterfaceEmptyMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10218 {"voidMethodTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10219 {"voidMethodLongArgTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodLongArgTestInterfaceEmptyArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, 10220 {"voidCallbackFunctionMethod", TestObjectV8Internal::voidCallbackFunctionMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10221 {"anyCallbackFunctionOptionalAnyArgMethod", TestObjectV8Internal::anyCallbackFunctionOptionalAnyArgMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10222 {"voidMethodVoidCallbackFunctionArg", TestObjectV8Internal::voidMethodVoidCallbackFunctionArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10223 {"voidMethodAnyCallbackFunctionOptionalAnyArg", TestObjectV8Internal::voidMethodAnyCallbackFunctionOptionalAnyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10224 {"anyMethod", TestObjectV8Internal::anyMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10225 {"voidMethodEventTargetArg", TestObjectV8Internal::voidMethodEventTargetArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10226 {"voidMethodAnyArg", TestObjectV8Internal::voidMethodAnyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10227 {"voidMethodAttrArg", TestObjectV8Internal::voidMethodAttrArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10228 {"voidMethodDocumentArg", TestObjectV8Internal::voidMethodDocumentArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10229 {"voidMethodDocumentTypeArg", TestObjectV8Internal::voidMethodDocumentTypeArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10230 {"voidMethodElementArg", TestObjectV8Internal::voidMethodElementArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10231 {"voidMethodNodeArg", TestObjectV8Internal::voidMethodNodeArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10232 {"arrayBufferMethod", TestObjectV8Internal::arrayBufferMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10233 {"arrayBufferViewMethod", TestObjectV8Internal::arrayBufferViewMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10234 {"float32ArrayMethod", TestObjectV8Internal::float32ArrayMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10235 {"int32ArrayMethod", TestObjectV8Internal::int32ArrayMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10236 {"uint8ArrayMethod", TestObjectV8Internal::uint8ArrayMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10237 {"voidMethodArrayBufferArg", TestObjectV8Internal::voidMethodArrayBufferArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10238 {"voidMethodArrayBufferOrNullArg", TestObjectV8Internal::voidMethodArrayBufferOrNullArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10239 {"voidMethodArrayBufferViewArg", TestObjectV8Internal::voidMethodArrayBufferViewArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10240 {"voidMethodFloat32ArrayArg", TestObjectV8Internal::voidMethodFloat32ArrayArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10241 {"voidMethodInt32ArrayArg", TestObjectV8Internal::voidMethodInt32ArrayArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10242 {"voidMethodUint8ArrayArg", TestObjectV8Internal::voidMethodUint8ArrayArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10243 {"longArrayMethod", TestObjectV8Internal::longArrayMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10244 {"stringArrayMethod", TestObjectV8Internal::stringArrayMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10245 {"testInterfaceEmptyArrayMethod", TestObjectV8Internal::testInterfaceEmptyArrayMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10246 {"voidMethodArrayLongArg", TestObjectV8Internal::voidMethodArrayLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10247 {"voidMethodArrayStringArg", TestObjectV8Internal::voidMethodArrayStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10248 {"voidMethodArrayTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodArrayTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10249 {"longSequenceMethod", TestObjectV8Internal::longSequenceMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10250 {"stringSequenceMethod", TestObjectV8Internal::stringSequenceMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10251 {"testInterfaceEmptySequenceMethod", TestObjectV8Internal::testInterfaceEmptySequenceMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10252 {"voidMethodSequenceLongArg", TestObjectV8Internal::voidMethodSequenceLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10253 {"voidMethodSequenceStringArg", TestObjectV8Internal::voidMethodSequenceStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10254 {"voidMethodSequenceTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodSequenceTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10255 {"voidMethodSequenceSequenceDOMStringArg", TestObjectV8Internal::voidMethodSequenceSequenceDOMStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10256 {"nullableLongMethod", TestObjectV8Internal::nullableLongMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10257 {"nullableStringMethod", TestObjectV8Internal::nullableStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10258 {"nullableTestInterfaceMethod", TestObjectV8Internal::nullableTestInterfaceMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10259 {"nullableLongSequenceMethod", TestObjectV8Internal::nullableLongSequenceMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10260 {"testInterfaceGarbageCollectedOrDOMStringMethod", TestObjectV8Internal::testInterfaceGarbageCollectedOrDOMStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10261 {"testInterfaceWillBeGarbageCollectedOrTestDictionaryMethod", TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrTestDictionaryMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10262 {"longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethod", TestObjectV8Internal::longSequenceOrDOMStringArrayOrUnrestrictedDoubleMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10263 {"voidMethodTestInterfaceEmptyOrNullArg", TestObjectV8Internal::voidMethodTestInterfaceEmptyOrNullArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10264 {"voidMethodTestCallbackInterfaceArg", TestObjectV8Internal::voidMethodTestCallbackInterfaceArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10265 {"voidMethodOptionalTestCallbackInterfaceArg", TestObjectV8Internal::voidMethodOptionalTestCallbackInterfaceArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10266 {"voidMethodTestCallbackInterfaceOrNullArg", TestObjectV8Internal::voidMethodTestCallbackInterfaceOrNullArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10267 {"testEnumMethod", TestObjectV8Internal::testEnumMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10268 {"voidMethodTestEnumArg", TestObjectV8Internal::voidMethodTestEnumArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10269 {"dictionaryMethod", TestObjectV8Internal::dictionaryMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10270 {"nodeFilterMethod", TestObjectV8Internal::nodeFilterMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10271 {"promiseMethod", TestObjectV8Internal::promiseMethodMethodCallback, 0, 3, V8DOMConfiguration::ExposedToAllScripts}, 10272 {"promiseMethodWithoutExceptionState", TestObjectV8Internal::promiseMethodWithoutExceptionStateMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10273 {"serializedScriptValueMethod", TestObjectV8Internal::serializedScriptValueMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10274 {"xPathNSResolverMethod", TestObjectV8Internal::xPathNSResolverMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10275 {"voidMethodDictionaryArg", TestObjectV8Internal::voidMethodDictionaryArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10276 {"voidMethodNodeFilterArg", TestObjectV8Internal::voidMethodNodeFilterArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10277 {"voidMethodPromiseArg", TestObjectV8Internal::voidMethodPromiseArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10278 {"voidMethodSerializedScriptValueArg", TestObjectV8Internal::voidMethodSerializedScriptValueArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10279 {"voidMethodXPathNSResolverArg", TestObjectV8Internal::voidMethodXPathNSResolverArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10280 {"voidMethodDictionarySequenceArg", TestObjectV8Internal::voidMethodDictionarySequenceArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10281 {"overloadedPromiseMethod", TestObjectV8Internal::overloadedPromiseMethodMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10282 {"voidMethodStringArgLongArg", TestObjectV8Internal::voidMethodStringArgLongArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, 10283 {"voidMethodOptionalStringArg", TestObjectV8Internal::voidMethodOptionalStringArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10284 {"voidMethodOptionalTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodOptionalTestInterfaceEmptyArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10285 {"voidMethodOptionalLongArg", TestObjectV8Internal::voidMethodOptionalLongArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10286 {"stringMethodOptionalLongArg", TestObjectV8Internal::stringMethodOptionalLongArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10287 {"testInterfaceEmptyMethodOptionalLongArg", TestObjectV8Internal::testInterfaceEmptyMethodOptionalLongArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10288 {"longMethodOptionalLongArg", TestObjectV8Internal::longMethodOptionalLongArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10289 {"voidMethodLongArgOptionalLongArg", TestObjectV8Internal::voidMethodLongArgOptionalLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10290 {"voidMethodLongArgOptionalLongArgOptionalLongArg", TestObjectV8Internal::voidMethodLongArgOptionalLongArgOptionalLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10291 {"voidMethodLongArgOptionalTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodLongArgOptionalTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10292 {"voidMethodTestInterfaceEmptyArgOptionalLongArg", TestObjectV8Internal::voidMethodTestInterfaceEmptyArgOptionalLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10293 {"voidMethodOptionalDictionaryArg", TestObjectV8Internal::voidMethodOptionalDictionaryArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10294 {"voidMethodDefaultByteStringArg", TestObjectV8Internal::voidMethodDefaultByteStringArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10295 {"voidMethodDefaultStringArg", TestObjectV8Internal::voidMethodDefaultStringArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10296 {"voidMethodDefaultIntegerArgs", TestObjectV8Internal::voidMethodDefaultIntegerArgsMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10297 {"voidMethodDefaultDoubleArg", TestObjectV8Internal::voidMethodDefaultDoubleArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10298 {"voidMethodDefaultTrueBooleanArg", TestObjectV8Internal::voidMethodDefaultTrueBooleanArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10299 {"voidMethodDefaultFalseBooleanArg", TestObjectV8Internal::voidMethodDefaultFalseBooleanArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10300 {"voidMethodDefaultNullableByteStringArg", TestObjectV8Internal::voidMethodDefaultNullableByteStringArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10301 {"voidMethodDefaultNullableStringArg", TestObjectV8Internal::voidMethodDefaultNullableStringArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10302 {"voidMethodDefaultNullableTestInterfaceArg", TestObjectV8Internal::voidMethodDefaultNullableTestInterfaceArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10303 {"voidMethodVariadicStringArg", TestObjectV8Internal::voidMethodVariadicStringArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10304 {"voidMethodStringArgVariadicStringArg", TestObjectV8Internal::voidMethodStringArgVariadicStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10305 {"voidMethodVariadicTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10306 {"voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10307 {"voidMethodVariadicTestInterfaceGarbageCollectedArg", TestObjectV8Internal::voidMethodVariadicTestInterfaceGarbageCollectedArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10308 {"voidMethodVariadicTestInterfaceWillBeGarbageCollectedArg", TestObjectV8Internal::voidMethodVariadicTestInterfaceWillBeGarbageCollectedArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10309 {"overloadedMethodA", TestObjectV8Internal::overloadedMethodAMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10310 {"overloadedMethodB", TestObjectV8Internal::overloadedMethodBMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10311 {"overloadedMethodC", TestObjectV8Internal::overloadedMethodCMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10312 {"overloadedMethodD", TestObjectV8Internal::overloadedMethodDMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10313 {"overloadedMethodE", TestObjectV8Internal::overloadedMethodEMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10314 {"overloadedMethodF", TestObjectV8Internal::overloadedMethodFMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10315 {"overloadedMethodG", TestObjectV8Internal::overloadedMethodGMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10316 {"overloadedMethodH", TestObjectV8Internal::overloadedMethodHMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10317 {"overloadedMethodI", TestObjectV8Internal::overloadedMethodIMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10318 {"overloadedMethodJ", TestObjectV8Internal::overloadedMethodJMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10319 {"overloadedPerWorldBindingsMethod", TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodCallback, TestObjectV8Internal::overloadedPerWorldBindingsMethodMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAllScripts}, 10320 {"voidMethodClampUnsignedShortArg", TestObjectV8Internal::voidMethodClampUnsignedShortArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10321 {"voidMethodClampUnsignedLongArg", TestObjectV8Internal::voidMethodClampUnsignedLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10322 {"voidMethodDefaultUndefinedTestInterfaceEmptyArg", TestObjectV8Internal::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10323 {"voidMethodDefaultUndefinedLongArg", TestObjectV8Internal::voidMethodDefaultUndefinedLongArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10324 {"voidMethodDefaultUndefinedStringArg", TestObjectV8Internal::voidMethodDefaultUndefinedStringArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10325 {"voidMethodEnforceRangeLongArg", TestObjectV8Internal::voidMethodEnforceRangeLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10326 {"voidMethodTreatNullAsEmptyStringStringArg", TestObjectV8Internal::voidMethodTreatNullAsEmptyStringStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10327 {"voidMethodTreatNullAsNullStringStringArg", TestObjectV8Internal::voidMethodTreatNullAsNullStringStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10328 {"voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", TestObjectV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10329 {"activityLoggingAccessForAllWorldsMethod", TestObjectV8Internal::activityLoggingAccessForAllWorldsMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10330 {"callWithExecutionContextVoidMethod", TestObjectV8Internal::callWithExecutionContextVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10331 {"callWithScriptStateVoidMethod", TestObjectV8Internal::callWithScriptStateVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10332 {"callWithScriptStateLongMethod", TestObjectV8Internal::callWithScriptStateLongMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10333 {"callWithScriptStateExecutionContextVoidMethod", TestObjectV8Internal::callWithScriptStateExecutionContextVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10334 {"callWithScriptStateScriptArgumentsVoidMethod", TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10335 {"callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArg", TestObjectV8Internal::callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10336 {"callWithActiveWindow", TestObjectV8Internal::callWithActiveWindowMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10337 {"callWithActiveWindowScriptWindow", TestObjectV8Internal::callWithActiveWindowScriptWindowMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10338 {"checkSecurityForNodeVoidMethod", TestObjectV8Internal::checkSecurityForNodeVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10339 #if ENABLE(CONDITION) 10340 {"conditionalConditionVoidMethod", TestObjectV8Internal::conditionalConditionVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10341 #endif // ENABLE(CONDITION) 10342 {"customVoidMethod", TestObjectV8Internal::customVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10343 #if ENABLE(CONDITION) 10344 {"conditionalConditionCustomVoidMethod", TestObjectV8Internal::conditionalConditionCustomVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10345 #endif // ENABLE(CONDITION) 10346 {"customElementCallbacksVoidMethod", TestObjectV8Internal::customElementCallbacksVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10347 {"deprecatedVoidMethod", TestObjectV8Internal::deprecatedVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10348 {"implementedAsVoidMethod", TestObjectV8Internal::implementedAsVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10349 {"measureAsVoidMethod", TestObjectV8Internal::measureAsVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10350 {"DeprecateAsOverloadedMethod", TestObjectV8Internal::DeprecateAsOverloadedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10351 {"DeprecateAsSameValueOverloadedMethod", TestObjectV8Internal::DeprecateAsSameValueOverloadedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10352 {"measureAsOverloadedMethod", TestObjectV8Internal::measureAsOverloadedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10353 {"measureAsSameValueOverloadedMethod", TestObjectV8Internal::measureAsSameValueOverloadedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10354 {"deprecateAsMeasureAsSameValueOverloadedMethod", TestObjectV8Internal::deprecateAsMeasureAsSameValueOverloadedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10355 {"deprecateAsSameValueMeasureAsOverloadedMethod", TestObjectV8Internal::deprecateAsSameValueMeasureAsOverloadedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10356 {"deprecateAsSameValueMeasureAsSameValueOverloadedMethod", TestObjectV8Internal::deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10357 {"perWorldBindingsVoidMethod", TestObjectV8Internal::perWorldBindingsVoidMethodMethodCallback, TestObjectV8Internal::perWorldBindingsVoidMethodMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAllScripts}, 10358 {"perWorldBindingsVoidMethodTestInterfaceEmptyArg", TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback, TestObjectV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld, 1, V8DOMConfiguration::ExposedToAllScripts}, 10359 {"activityLoggingForAllWorldsPerWorldBindingsVoidMethod", TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback, TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAllScripts}, 10360 {"activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallback, TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAllScripts}, 10361 {"raisesExceptionVoidMethod", TestObjectV8Internal::raisesExceptionVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10362 {"raisesExceptionStringMethod", TestObjectV8Internal::raisesExceptionStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10363 {"raisesExceptionVoidMethodOptionalLongArg", TestObjectV8Internal::raisesExceptionVoidMethodOptionalLongArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10364 {"raisesExceptionVoidMethodTestCallbackInterfaceArg", TestObjectV8Internal::raisesExceptionVoidMethodTestCallbackInterfaceArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10365 {"raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg", TestObjectV8Internal::raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10366 {"raisesExceptionTestInterfaceEmptyVoidMethod", TestObjectV8Internal::raisesExceptionTestInterfaceEmptyVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10367 {"callWithExecutionContextRaisesExceptionVoidMethodLongArg", TestObjectV8Internal::callWithExecutionContextRaisesExceptionVoidMethodLongArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10368 {"partiallyRuntimeEnabledOverloadedVoidMethod", TestObjectV8Internal::partiallyRuntimeEnabledOverloadedVoidMethodMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10369 {"treatReturnedNullStringAsNullStringMethod", TestObjectV8Internal::treatReturnedNullStringAsNullStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10370 {"treatReturnedNullStringAsUndefinedStringMethod", TestObjectV8Internal::treatReturnedNullStringAsUndefinedStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10371 {"treatReturnedNullStringAsNullByteStringMethod", TestObjectV8Internal::treatReturnedNullStringAsNullByteStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10372 {"treatReturnedNullStringAsUndefinedByteStringMethod", TestObjectV8Internal::treatReturnedNullStringAsUndefinedByteStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10373 {"treatReturnedNullStringAsNullScalarValueStringMethod", TestObjectV8Internal::treatReturnedNullStringAsNullScalarValueStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10374 {"treatReturnedNullStringAsUndefinedScalarValueStringMethod", TestObjectV8Internal::treatReturnedNullStringAsUndefinedScalarValueStringMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10375 {"typeCheckingInterfaceVoidMethodTestInterfaceEmptyArg", TestObjectV8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10376 {"typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArg", TestObjectV8Internal::typeCheckingInterfaceVoidMethodTestInterfaceEmptyVariadicArgMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10377 {"typeCheckingUnrestrictedVoidMethodFloatArgDoubleArg", TestObjectV8Internal::typeCheckingUnrestrictedVoidMethodFloatArgDoubleArgMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, 10378 {"voidMethodTestInterfaceGarbageCollectedSequenceArg", TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedSequenceArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10379 {"voidMethodTestInterfaceGarbageCollectedArrayArg", TestObjectV8Internal::voidMethodTestInterfaceGarbageCollectedArrayArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10380 {"voidMethodTestInterfaceWillBeGarbageCollectedSequenceArg", TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedSequenceArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10381 {"voidMethodTestInterfaceWillBeGarbageCollectedArrayArg", TestObjectV8Internal::voidMethodTestInterfaceWillBeGarbageCollectedArrayArgMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10382 {"voidMethodImplementedInPrivateScript", TestObjectV8Internal::voidMethodImplementedInPrivateScriptMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10383 {"shortMethodImplementedInPrivateScript", TestObjectV8Internal::shortMethodImplementedInPrivateScriptMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10384 {"shortMethodWithShortArgumentImplementedInPrivateScript", TestObjectV8Internal::shortMethodWithShortArgumentImplementedInPrivateScriptMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10385 {"stringMethodWithStringArgumentImplementedInPrivateScript", TestObjectV8Internal::stringMethodWithStringArgumentImplementedInPrivateScriptMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10386 {"nodeMethodWithNodeArgumentImplementedInPrivateScript", TestObjectV8Internal::nodeMethodWithNodeArgumentImplementedInPrivateScriptMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 10387 {"nodeMethodWithVariousArgumentsImplementedInPrivateScript", TestObjectV8Internal::nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethodCallback, 0, 5, V8DOMConfiguration::ExposedToAllScripts}, 10388 {"methodImplementedInCPPForPrivateScriptOnly", TestObjectV8Internal::methodImplementedInCPPForPrivateScriptOnlyMethodCallback, 0, 2, V8DOMConfiguration::OnlyExposedToPrivateScript}, 10389 {"toString", TestObjectV8Internal::toStringMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 10390 }; 10391 10392 static void installV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) 10393 { 10394 functionTemplate->ReadOnlyPrototype(); 10395 10396 v8::Local<v8::Signature> defaultSignature; 10397 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestObject", v8::Local<v8::FunctionTemplate>(), V8TestObject::internalFieldCount, 10398 V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes), 10399 V8TestObjectAccessors, WTF_ARRAY_LENGTH(V8TestObjectAccessors), 10400 V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods), 10401 isolate); 10402 v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate(); 10403 v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate(); 10404 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10405 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ 10406 {"runtimeEnabledLongAttribute", TestObjectV8Internal::runtimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::runtimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}; 10407 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); 10408 } 10409 #if ENABLE(CONDITION) 10410 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10411 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ 10412 {"conditionalRuntimeEnabledLongAttribute", TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}; 10413 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate); 10414 } 10415 #endif // ENABLE(CONDITION) 10416 static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = { 10417 {"CONST_VALUE_0", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10418 {"CONST_VALUE_1", 1, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10419 {"CONST_VALUE_2", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10420 {"CONST_VALUE_4", 4, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10421 {"CONST_VALUE_8", 8, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10422 {"CONST_VALUE_9", -1, 0, 0, V8DOMConfiguration::ConstantTypeShort}, 10423 {"CONST_VALUE_10", 0, 0, "my constant string", V8DOMConfiguration::ConstantTypeString}, 10424 {"CONST_VALUE_11", 0xffffffff, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10425 {"CONST_VALUE_12", 0x01, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10426 {"CONST_VALUE_13", 0X20, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10427 {"CONST_VALUE_14", 0x1abc, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10428 {"CONST_VALUE_15", 010, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10429 {"CONST_VALUE_16", -010, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10430 {"CONST_VALUE_16", -0x1A, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10431 {"CONST_VALUE_17", -0X1a, 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, 10432 {"CONST_VALUE_18", 0, 0.123, 0, V8DOMConfiguration::ConstantTypeDouble}, 10433 {"CONST_VALUE_19", 0, 4e9, 0, V8DOMConfiguration::ConstantTypeDouble}, 10434 {"CONST_VALUE_20", 0, 3.4e5, 0, V8DOMConfiguration::ConstantTypeDouble}, 10435 {"CONST_VALUE_21", 0, -1.3, 0, V8DOMConfiguration::ConstantTypeDouble}, 10436 {"CONST_VALUE_22", 0, -4e-9, 0, V8DOMConfiguration::ConstantTypeDouble}, 10437 {"CONST_VALUE_23", 0, .123, 0, V8DOMConfiguration::ConstantTypeDouble}, 10438 {"CONST_VALUE_24", 0, 5E+4, 0, V8DOMConfiguration::ConstantTypeDouble}, 10439 {"CONST_VALUE_25", 0, 1, 0, V8DOMConfiguration::ConstantTypeFloat}, 10440 {"CONST_JAVASCRIPT", 1, 0, 0, V8DOMConfiguration::ConstantTypeShort}, 10441 }; 10442 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate); 10443 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10444 static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {"FEATURE_ENABLED_CONST", 1, 0, 0, V8DOMConfiguration::ConstantTypeShort}; 10445 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, &constantConfiguration, 1, isolate); 10446 } 10447 V8DOMConfiguration::installConstant(functionTemplate, prototypeTemplate, "DEPRECATED_CONSTANT", TestObjectV8Internal::DEPRECATED_CONSTANTConstantGetterCallback, isolate); 10448 V8DOMConfiguration::installConstant(functionTemplate, prototypeTemplate, "MEASURED_CONSTANT", TestObjectV8Internal::MEASURED_CONSTANTConstantGetterCallback, isolate); 10449 COMPILE_ASSERT(0 == TestObject::CONST_VALUE_0, TheValueOfTestObject_CONST_VALUE_0DoesntMatchWithImplementation); 10450 COMPILE_ASSERT(1 == TestObject::CONST_VALUE_1, TheValueOfTestObject_CONST_VALUE_1DoesntMatchWithImplementation); 10451 COMPILE_ASSERT(2 == TestObject::CONST_VALUE_2, TheValueOfTestObject_CONST_VALUE_2DoesntMatchWithImplementation); 10452 COMPILE_ASSERT(4 == TestObject::CONST_VALUE_4, TheValueOfTestObject_CONST_VALUE_4DoesntMatchWithImplementation); 10453 COMPILE_ASSERT(8 == TestObject::CONST_VALUE_8, TheValueOfTestObject_CONST_VALUE_8DoesntMatchWithImplementation); 10454 COMPILE_ASSERT(-1 == TestObject::CONST_VALUE_9, TheValueOfTestObject_CONST_VALUE_9DoesntMatchWithImplementation); 10455 COMPILE_ASSERT(0xffffffff == TestObject::CONST_VALUE_11, TheValueOfTestObject_CONST_VALUE_11DoesntMatchWithImplementation); 10456 COMPILE_ASSERT(0x01 == TestObject::CONST_VALUE_12, TheValueOfTestObject_CONST_VALUE_12DoesntMatchWithImplementation); 10457 COMPILE_ASSERT(0X20 == TestObject::CONST_VALUE_13, TheValueOfTestObject_CONST_VALUE_13DoesntMatchWithImplementation); 10458 COMPILE_ASSERT(0x1abc == TestObject::CONST_VALUE_14, TheValueOfTestObject_CONST_VALUE_14DoesntMatchWithImplementation); 10459 COMPILE_ASSERT(010 == TestObject::CONST_VALUE_15, TheValueOfTestObject_CONST_VALUE_15DoesntMatchWithImplementation); 10460 COMPILE_ASSERT(-010 == TestObject::CONST_VALUE_16, TheValueOfTestObject_CONST_VALUE_16DoesntMatchWithImplementation); 10461 COMPILE_ASSERT(-0x1A == TestObject::CONST_VALUE_16, TheValueOfTestObject_CONST_VALUE_16DoesntMatchWithImplementation); 10462 COMPILE_ASSERT(-0X1a == TestObject::CONST_VALUE_17, TheValueOfTestObject_CONST_VALUE_17DoesntMatchWithImplementation); 10463 COMPILE_ASSERT(1 == TestObject::DEPRECATED_CONSTANT, TheValueOfTestObject_DEPRECATED_CONSTANTDoesntMatchWithImplementation); 10464 COMPILE_ASSERT(1 == TestObject::MEASURED_CONSTANT, TheValueOfTestObject_MEASURED_CONSTANTDoesntMatchWithImplementation); 10465 COMPILE_ASSERT(1 == TestObject::FEATURE_ENABLED_CONST, TheValueOfTestObject_FEATURE_ENABLED_CONSTDoesntMatchWithImplementation); 10466 COMPILE_ASSERT(1 == TestObject::CONST_IMPL, TheValueOfTestObject_CONST_IMPLDoesntMatchWithImplementation); 10467 static const V8DOMConfiguration::MethodConfiguration staticVoidMethodMethodConfiguration = { 10468 "staticVoidMethod", TestObjectV8Internal::staticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, 10469 }; 10470 V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>(), v8::None, staticVoidMethodMethodConfiguration, isolate); 10471 static const V8DOMConfiguration::MethodConfiguration overloadedStaticMethodMethodConfiguration = { 10472 "overloadedStaticMethod", TestObjectV8Internal::overloadedStaticMethodMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts, 10473 }; 10474 V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>(), v8::None, overloadedStaticMethodMethodConfiguration, isolate); 10475 #if ENABLE(CONDITION) 10476 static const V8DOMConfiguration::MethodConfiguration conditionalConditionStaticVoidMethodMethodConfiguration = { 10477 "conditionalConditionStaticVoidMethod", TestObjectV8Internal::conditionalConditionStaticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, 10478 }; 10479 V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>(), v8::None, conditionalConditionStaticVoidMethodMethodConfiguration, isolate); 10480 #endif // ENABLE(CONDITION) 10481 static const V8DOMConfiguration::MethodConfiguration doNotCheckSignatureVoidMethodMethodConfiguration = { 10482 "doNotCheckSignatureVoidMethod", TestObjectV8Internal::doNotCheckSignatureVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, 10483 }; 10484 V8DOMConfiguration::installMethod(prototypeTemplate, v8::Local<v8::Signature>(), v8::None, doNotCheckSignatureVoidMethodMethodConfiguration, isolate); 10485 static const V8DOMConfiguration::MethodConfiguration notEnumerableVoidMethodMethodConfiguration = { 10486 "notEnumerableVoidMethod", TestObjectV8Internal::notEnumerableVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, 10487 }; 10488 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum), notEnumerableVoidMethodMethodConfiguration, isolate); 10489 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10490 static const V8DOMConfiguration::MethodConfiguration runtimeEnabledVoidMethodMethodConfiguration = { 10491 "runtimeEnabledVoidMethod", TestObjectV8Internal::runtimeEnabledVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, 10492 }; 10493 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v8::None, runtimeEnabledVoidMethodMethodConfiguration, isolate); 10494 } 10495 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10496 static const V8DOMConfiguration::MethodConfiguration perWorldBindingsRuntimeEnabledVoidMethodMethodConfiguration = { 10497 "perWorldBindingsRuntimeEnabledVoidMethod", TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodCallback, TestObjectV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAllScripts, 10498 }; 10499 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v8::None, perWorldBindingsRuntimeEnabledVoidMethodMethodConfiguration, isolate); 10500 } 10501 if (RuntimeEnabledFeatures::featureNameEnabled()) { 10502 static const V8DOMConfiguration::MethodConfiguration runtimeEnabledOverloadedVoidMethodMethodConfiguration = { 10503 "runtimeEnabledOverloadedVoidMethod", TestObjectV8Internal::runtimeEnabledOverloadedVoidMethodMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts, 10504 }; 10505 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v8::None, runtimeEnabledOverloadedVoidMethodMethodConfiguration, isolate); 10506 } 10507 static const V8DOMConfiguration::MethodConfiguration unforgeableVoidMethodMethodConfiguration = { 10508 "unforgeableVoidMethod", TestObjectV8Internal::unforgeableVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts, 10509 }; 10510 V8DOMConfiguration::installMethod(instanceTemplate, defaultSignature, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), unforgeableVoidMethodMethodConfiguration, isolate); 10511 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)); 10512 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)); 10513 10514 // Custom toString template 10515 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate()); 10516 } 10517 10518 v8::Handle<v8::FunctionTemplate> V8TestObject::domTemplate(v8::Isolate* isolate) 10519 { 10520 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestObjectTemplate); 10521 } 10522 10523 bool V8TestObject::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) 10524 { 10525 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); 10526 } 10527 10528 v8::Handle<v8::Object> V8TestObject::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) 10529 { 10530 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); 10531 } 10532 10533 TestObject* V8TestObject::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) 10534 { 10535 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle<v8::Object>::Cast(value))->toImpl<TestObject>() : 0; 10536 } 10537 10538 void V8TestObject::installConditionallyEnabledProperties(v8::Handle<v8::Object> instanceObject, v8::Isolate* isolate) 10539 { 10540 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instanceObject->GetPrototype()); 10541 ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext()); 10542 10543 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) { 10544 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ 10545 {"perContextEnabledLongAttribute", TestObjectV8Internal::perContextEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}; 10546 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, attributeConfiguration, isolate); 10547 } 10548 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) { 10549 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\ 10550 {"perContextEnabledRuntimeEnabledLongAttribute", TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::perContextEnabledRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}; 10551 V8DOMConfiguration::installAttribute(instanceObject, prototypeObject, attributeConfiguration, isolate); 10552 } 10553 } 10554 10555 void V8TestObject::installConditionallyEnabledMethods(v8::Handle<v8::Object> prototypeObject, v8::Isolate* isolate) 10556 { 10557 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate)); 10558 ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext()); 10559 ASSERT(context); 10560 10561 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context))) { 10562 prototypeObject->Set(v8AtomicString(isolate, "perContextEnabledVoidMethod"), v8::FunctionTemplate::New(isolate, TestObjectV8Internal::perContextEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); 10563 } 10564 } 10565 10566 10567 void V8TestObject::refObject(ScriptWrappableBase* internalPointer) 10568 { 10569 internalPointer->toImpl<TestObject>()->ref(); 10570 } 10571 10572 void V8TestObject::derefObject(ScriptWrappableBase* internalPointer) 10573 { 10574 internalPointer->toImpl<TestObject>()->deref(); 10575 } 10576 10577 WrapperPersistentNode* V8TestObject::createPersistentHandle(ScriptWrappableBase* internalPointer) 10578 { 10579 ASSERT_NOT_REACHED(); 10580 return 0; 10581 } 10582 10583 template<> 10584 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 10585 { 10586 return toV8(impl, creationContext, isolate); 10587 } 10588 10589 bool V8TestObject::PrivateScript::voidMethodImplementedInPrivateScriptMethod(LocalFrame* frame, TestObject* holderImpl) 10590 { 10591 if (!frame) 10592 return false; 10593 v8::HandleScope handleScope(toIsolate(frame)); 10594 ScriptForbiddenScope::AllowUserAgentScript script; 10595 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10596 if (contextInPrivateScript.IsEmpty()) 10597 return false; 10598 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10599 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10600 if (!scriptState->executionContext()) 10601 return false; 10602 10603 ScriptState::Scope scope(scriptState); 10604 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10605 10606 v8::Handle<v8::Value> *argv = 0; 10607 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10608 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "TestObject", "voidMethodImplementedInPrivateScript", holder, 0, argv); 10609 if (v8Value.IsEmpty()) 10610 return false; 10611 RELEASE_ASSERT(!exceptionState.hadException()); 10612 return true; 10613 } 10614 10615 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(LocalFrame* frame, TestObject* holderImpl, int* result) 10616 { 10617 if (!frame) 10618 return false; 10619 v8::HandleScope handleScope(toIsolate(frame)); 10620 ScriptForbiddenScope::AllowUserAgentScript script; 10621 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10622 if (contextInPrivateScript.IsEmpty()) 10623 return false; 10624 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10625 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10626 if (!scriptState->executionContext()) 10627 return false; 10628 10629 ScriptState::Scope scope(scriptState); 10630 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10631 10632 v8::Handle<v8::Value> *argv = 0; 10633 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethodImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10634 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv); 10635 if (v8Value.IsEmpty()) 10636 return false; 10637 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState, false); 10638 *result = cppValue; 10639 RELEASE_ASSERT(!exceptionState.hadException()); 10640 return true; 10641 } 10642 10643 bool V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPrivateScriptMethod(LocalFrame* frame, TestObject* holderImpl, int value, int* result) 10644 { 10645 if (!frame) 10646 return false; 10647 v8::HandleScope handleScope(toIsolate(frame)); 10648 ScriptForbiddenScope::AllowUserAgentScript script; 10649 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10650 if (contextInPrivateScript.IsEmpty()) 10651 return false; 10652 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10653 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10654 if (!scriptState->executionContext()) 10655 return false; 10656 10657 ScriptState::Scope scope(scriptState); 10658 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10659 10660 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value); 10661 v8::Handle<v8::Value> argv[] = { valueHandle }; 10662 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethodWithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10663 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holder, 1, argv); 10664 if (v8Value.IsEmpty()) 10665 return false; 10666 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState, false); 10667 *result = cppValue; 10668 RELEASE_ASSERT(!exceptionState.hadException()); 10669 return true; 10670 } 10671 10672 bool V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPrivateScriptMethod(LocalFrame* frame, TestObject* holderImpl, String value, String* result) 10673 { 10674 if (!frame) 10675 return false; 10676 v8::HandleScope handleScope(toIsolate(frame)); 10677 ScriptForbiddenScope::AllowUserAgentScript script; 10678 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10679 if (contextInPrivateScript.IsEmpty()) 10680 return false; 10681 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10682 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10683 if (!scriptState->executionContext()) 10684 return false; 10685 10686 ScriptState::Scope scope(scriptState); 10687 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10688 10689 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); 10690 v8::Handle<v8::Value> argv[] = { valueHandle }; 10691 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMethodWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10692 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", holder, 1, argv); 10693 if (v8Value.IsEmpty()) 10694 return false; 10695 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); 10696 *result = cppValue; 10697 RELEASE_ASSERT(!exceptionState.hadException()); 10698 return true; 10699 } 10700 10701 bool V8TestObject::PrivateScript::nodeMethodWithNodeArgumentImplementedInPrivateScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> value, RefPtrWillBeRawPtr<Node>* result) 10702 { 10703 if (!frame) 10704 return false; 10705 v8::HandleScope handleScope(toIsolate(frame)); 10706 ScriptForbiddenScope::AllowUserAgentScript script; 10707 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10708 if (contextInPrivateScript.IsEmpty()) 10709 return false; 10710 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10711 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10712 if (!scriptState->executionContext()) 10713 return false; 10714 10715 ScriptState::Scope scope(scriptState); 10716 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10717 10718 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Global(), scriptState->isolate()); 10719 v8::Handle<v8::Value> argv[] = { valueHandle }; 10720 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodWithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10721 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder, 1, argv); 10722 if (v8Value.IsEmpty()) 10723 return false; 10724 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value); 10725 *result = cppValue; 10726 RELEASE_ASSERT(!exceptionState.hadException()); 10727 return true; 10728 } 10729 10730 bool V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Document> document, PassRefPtrWillBeRawPtr<Node> node, int value1, double value2, String string, RefPtrWillBeRawPtr<Node>* result) 10731 { 10732 if (!frame) 10733 return false; 10734 v8::HandleScope handleScope(toIsolate(frame)); 10735 ScriptForbiddenScope::AllowUserAgentScript script; 10736 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10737 if (contextInPrivateScript.IsEmpty()) 10738 return false; 10739 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10740 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10741 if (!scriptState->executionContext()) 10742 return false; 10743 10744 ScriptState::Scope scope(scriptState); 10745 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10746 10747 v8::Handle<v8::Value> documentHandle = toV8(document, scriptState->context()->Global(), scriptState->isolate()); 10748 v8::Handle<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global(), scriptState->isolate()); 10749 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(), value1); 10750 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(), value2); 10751 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string); 10752 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, value2Handle, stringHandle }; 10753 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodWithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10754 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", holder, 5, argv); 10755 if (v8Value.IsEmpty()) 10756 return false; 10757 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value); 10758 *result = cppValue; 10759 RELEASE_ASSERT(!exceptionState.hadException()); 10760 return true; 10761 } 10762 10763 bool V8TestObject::PrivateScript::methodForPrivateScriptOnlyMethod(LocalFrame* frame, TestObject* holderImpl, int value1, int value2, int* result) 10764 { 10765 if (!frame) 10766 return false; 10767 v8::HandleScope handleScope(toIsolate(frame)); 10768 ScriptForbiddenScope::AllowUserAgentScript script; 10769 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10770 if (contextInPrivateScript.IsEmpty()) 10771 return false; 10772 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10773 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10774 if (!scriptState->executionContext()) 10775 return false; 10776 10777 ScriptState::Scope scope(scriptState); 10778 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10779 10780 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(), value1); 10781 v8::Handle<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate(), value2); 10782 v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle }; 10783 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPrivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10784 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "TestObject", "methodForPrivateScriptOnly", holder, 2, argv); 10785 if (v8Value.IsEmpty()) 10786 return false; 10787 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState, false); 10788 *result = cppValue; 10789 RELEASE_ASSERT(!exceptionState.hadException()); 10790 return true; 10791 } 10792 10793 bool V8TestObject::PrivateScript::readonlyShortAttributeAttributeGetter(LocalFrame* frame, TestObject* holderImpl, int* result) 10794 { 10795 if (!frame) 10796 return false; 10797 v8::HandleScope handleScope(toIsolate(frame)); 10798 ScriptForbiddenScope::AllowUserAgentScript script; 10799 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10800 if (contextInPrivateScript.IsEmpty()) 10801 return false; 10802 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10803 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10804 if (!scriptState->executionContext()) 10805 return false; 10806 10807 ScriptState::Scope scope(scriptState); 10808 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10809 10810 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10811 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "readonlyShortAttribute", holder); 10812 if (v8Value.IsEmpty()) 10813 return false; 10814 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState, false); 10815 RELEASE_ASSERT(!exceptionState.hadException()); 10816 *result = cppValue; 10817 return true; 10818 } 10819 10820 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* frame, TestObject* holderImpl, int* result) 10821 { 10822 if (!frame) 10823 return false; 10824 v8::HandleScope handleScope(toIsolate(frame)); 10825 ScriptForbiddenScope::AllowUserAgentScript script; 10826 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10827 if (contextInPrivateScript.IsEmpty()) 10828 return false; 10829 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10830 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10831 if (!scriptState->executionContext()) 10832 return false; 10833 10834 ScriptState::Scope scope(scriptState); 10835 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10836 10837 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10838 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder); 10839 if (v8Value.IsEmpty()) 10840 return false; 10841 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState), exceptionState, false); 10842 RELEASE_ASSERT(!exceptionState.hadException()); 10843 *result = cppValue; 10844 return true; 10845 } 10846 10847 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* frame, TestObject* holderImpl, int cppValue) 10848 { 10849 if (!frame) 10850 return false; 10851 v8::HandleScope handleScope(toIsolate(frame)); 10852 ScriptForbiddenScope::AllowUserAgentScript script; 10853 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10854 if (contextInPrivateScript.IsEmpty()) 10855 return false; 10856 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10857 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10858 if (!scriptState->executionContext()) 10859 return false; 10860 10861 ScriptState::Scope scope(scriptState); 10862 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10863 10864 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10865 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder, v8::Integer::New(scriptState->isolate(), cppValue)); 10866 } 10867 10868 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* frame, TestObject* holderImpl, String* result) 10869 { 10870 if (!frame) 10871 return false; 10872 v8::HandleScope handleScope(toIsolate(frame)); 10873 ScriptForbiddenScope::AllowUserAgentScript script; 10874 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10875 if (contextInPrivateScript.IsEmpty()) 10876 return false; 10877 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10878 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10879 if (!scriptState->executionContext()) 10880 return false; 10881 10882 ScriptState::Scope scope(scriptState); 10883 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10884 10885 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10886 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder); 10887 if (v8Value.IsEmpty()) 10888 return false; 10889 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); 10890 RELEASE_ASSERT(!exceptionState.hadException()); 10891 *result = cppValue; 10892 return true; 10893 } 10894 10895 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* frame, TestObject* holderImpl, String cppValue) 10896 { 10897 if (!frame) 10898 return false; 10899 v8::HandleScope handleScope(toIsolate(frame)); 10900 ScriptForbiddenScope::AllowUserAgentScript script; 10901 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10902 if (contextInPrivateScript.IsEmpty()) 10903 return false; 10904 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10905 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10906 if (!scriptState->executionContext()) 10907 return false; 10908 10909 ScriptState::Scope scope(scriptState); 10910 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10911 10912 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10913 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder, v8String(scriptState->isolate(), cppValue)); 10914 } 10915 10916 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) 10917 { 10918 if (!frame) 10919 return false; 10920 v8::HandleScope handleScope(toIsolate(frame)); 10921 ScriptForbiddenScope::AllowUserAgentScript script; 10922 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10923 if (contextInPrivateScript.IsEmpty()) 10924 return false; 10925 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10926 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10927 if (!scriptState->executionContext()) 10928 return false; 10929 10930 ScriptState::Scope scope(scriptState); 10931 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10932 10933 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10934 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder); 10935 if (v8Value.IsEmpty()) 10936 return false; 10937 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value); 10938 RELEASE_ASSERT(!exceptionState.hadException()); 10939 *result = cppValue; 10940 return true; 10941 } 10942 10943 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) 10944 { 10945 if (!frame) 10946 return false; 10947 v8::HandleScope handleScope(toIsolate(frame)); 10948 ScriptForbiddenScope::AllowUserAgentScript script; 10949 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10950 if (contextInPrivateScript.IsEmpty()) 10951 return false; 10952 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10953 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10954 if (!scriptState->executionContext()) 10955 return false; 10956 10957 ScriptState::Scope scope(scriptState); 10958 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10959 10960 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10961 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState->isolate())); 10962 } 10963 10964 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(LocalFrame* frame, TestObject* holderImpl, String* result) 10965 { 10966 if (!frame) 10967 return false; 10968 v8::HandleScope handleScope(toIsolate(frame)); 10969 ScriptForbiddenScope::AllowUserAgentScript script; 10970 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10971 if (contextInPrivateScript.IsEmpty()) 10972 return false; 10973 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 10974 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 10975 if (!scriptState->executionContext()) 10976 return false; 10977 10978 ScriptState::Scope scope(scriptState); 10979 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 10980 10981 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPrivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10982 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnly", holder); 10983 if (v8Value.IsEmpty()) 10984 return false; 10985 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); 10986 RELEASE_ASSERT(!exceptionState.hadException()); 10987 *result = cppValue; 10988 return true; 10989 } 10990 10991 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(LocalFrame* frame, TestObject* holderImpl, String cppValue) 10992 { 10993 if (!frame) 10994 return false; 10995 v8::HandleScope handleScope(toIsolate(frame)); 10996 ScriptForbiddenScope::AllowUserAgentScript script; 10997 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 10998 if (contextInPrivateScript.IsEmpty()) 10999 return false; 11000 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 11001 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 11002 if (!scriptState->executionContext()) 11003 return false; 11004 11005 ScriptState::Scope scope(scriptState); 11006 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 11007 11008 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPrivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 11009 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppValue)); 11010 } 11011 11012 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame* frame, TestObject* holderImpl, String* result) 11013 { 11014 if (!frame) 11015 return false; 11016 v8::HandleScope handleScope(toIsolate(frame)); 11017 ScriptForbiddenScope::AllowUserAgentScript script; 11018 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 11019 if (contextInPrivateScript.IsEmpty()) 11020 return false; 11021 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 11022 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 11023 if (!scriptState->executionContext()) 11024 return false; 11025 11026 ScriptState::Scope scope(scriptState); 11027 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 11028 11029 ExceptionState exceptionState(ExceptionState::GetterContext, "enumForPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 11030 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scriptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holder); 11031 if (v8Value.IsEmpty()) 11032 return false; 11033 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); 11034 RELEASE_ASSERT(!exceptionState.hadException()); 11035 *result = cppValue; 11036 return true; 11037 } 11038 11039 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(LocalFrame* frame, TestObject* holderImpl, String cppValue) 11040 { 11041 if (!frame) 11042 return false; 11043 v8::HandleScope handleScope(toIsolate(frame)); 11044 ScriptForbiddenScope::AllowUserAgentScript script; 11045 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapperWorld::privateScriptIsolatedWorld()); 11046 if (contextInPrivateScript.IsEmpty()) 11047 return false; 11048 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); 11049 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); 11050 if (!scriptState->executionContext()) 11051 return false; 11052 11053 ScriptState::Scope scope(scriptState); 11054 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(), scriptState->isolate()); 11055 11056 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivateScript", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 11057 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->isolate(), cppValue)); 11058 } 11059 11060 } // namespace blink 11061