| OLD | NEW |
| 1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
| 2 | 2 |
| 3 | 3 |
| 4 {##############################################################################} | 4 {##############################################################################} |
| 5 {% block indexed_property_getter %} | 5 {% block indexed_property_getter %} |
| 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} | 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} |
| 7 {% set getter = indexed_property_getter %} | 7 {% set getter = indexed_property_getter %} |
| 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 9 { | 9 { |
| 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); | 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 {% endif %} | 33 {% endif %} |
| 34 {% endblock %} | 34 {% endblock %} |
| 35 | 35 |
| 36 | 36 |
| 37 {##############################################################################} | 37 {##############################################################################} |
| 38 {% block indexed_property_getter_callback %} | 38 {% block indexed_property_getter_callback %} |
| 39 {% if indexed_property_getter %} | 39 {% if indexed_property_getter %} |
| 40 {% set getter = indexed_property_getter %} | 40 {% set getter = indexed_property_getter %} |
| 41 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 41 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
| 42 { | 42 { |
| 43 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); | |
| 44 {% if getter.is_custom %} | 43 {% if getter.is_custom %} |
| 45 {{v8_class}}::indexedPropertyGetterCustom(index, info); | 44 {{v8_class}}::indexedPropertyGetterCustom(index, info); |
| 46 {% else %} | 45 {% else %} |
| 47 {{cpp_class}}V8Internal::indexedPropertyGetter(index, info); | 46 {{cpp_class}}V8Internal::indexedPropertyGetter(index, info); |
| 48 {% endif %} | 47 {% endif %} |
| 49 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 50 } | 48 } |
| 51 | 49 |
| 52 {% endif %} | 50 {% endif %} |
| 53 {% endblock %} | 51 {% endblock %} |
| 54 | 52 |
| 55 | 53 |
| 56 {##############################################################################} | 54 {##############################################################################} |
| 57 {% block indexed_property_setter %} | 55 {% block indexed_property_setter %} |
| 58 {% from 'utilities.cpp' import v8_value_to_local_cpp_value %} | 56 {% from 'utilities.cpp' import v8_value_to_local_cpp_value %} |
| 59 {% if indexed_property_setter and not indexed_property_setter.is_custom %} | 57 {% if indexed_property_setter and not indexed_property_setter.is_custom %} |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 {% endif %} | 94 {% endif %} |
| 97 {% endblock %} | 95 {% endblock %} |
| 98 | 96 |
| 99 | 97 |
| 100 {##############################################################################} | 98 {##############################################################################} |
| 101 {% block indexed_property_setter_callback %} | 99 {% block indexed_property_setter_callback %} |
| 102 {% if indexed_property_setter %} | 100 {% if indexed_property_setter %} |
| 103 {% set setter = indexed_property_setter %} | 101 {% set setter = indexed_property_setter %} |
| 104 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 102 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 105 { | 103 { |
| 106 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); | |
| 107 {% if setter.is_custom %} | 104 {% if setter.is_custom %} |
| 108 {{v8_class}}::indexedPropertySetterCustom(index, v8Value, info); | 105 {{v8_class}}::indexedPropertySetterCustom(index, v8Value, info); |
| 109 {% else %} | 106 {% else %} |
| 110 {{cpp_class}}V8Internal::indexedPropertySetter(index, v8Value, info); | 107 {{cpp_class}}V8Internal::indexedPropertySetter(index, v8Value, info); |
| 111 {% endif %} | 108 {% endif %} |
| 112 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 113 } | 109 } |
| 114 | 110 |
| 115 {% endif %} | 111 {% endif %} |
| 116 {% endblock %} | 112 {% endblock %} |
| 117 | 113 |
| 118 | 114 |
| 119 {##############################################################################} | 115 {##############################################################################} |
| 120 {% block indexed_property_deleter %} | 116 {% block indexed_property_deleter %} |
| 121 {% if indexed_property_deleter and not indexed_property_deleter.is_custom %} | 117 {% if indexed_property_deleter and not indexed_property_deleter.is_custom %} |
| 122 {% set deleter = indexed_property_deleter %} | 118 {% set deleter = indexed_property_deleter %} |
| (...skipping 24 matching lines...) Expand all Loading... |
| 147 {% endif %} | 143 {% endif %} |
| 148 {% endblock %} | 144 {% endblock %} |
| 149 | 145 |
| 150 | 146 |
| 151 {##############################################################################} | 147 {##############################################################################} |
| 152 {% block indexed_property_deleter_callback %} | 148 {% block indexed_property_deleter_callback %} |
| 153 {% if indexed_property_deleter %} | 149 {% if indexed_property_deleter %} |
| 154 {% set deleter = indexed_property_deleter %} | 150 {% set deleter = indexed_property_deleter %} |
| 155 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 151 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 156 { | 152 { |
| 157 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); | |
| 158 {% if deleter.is_custom %} | 153 {% if deleter.is_custom %} |
| 159 {{v8_class}}::indexedPropertyDeleterCustom(index, info); | 154 {{v8_class}}::indexedPropertyDeleterCustom(index, info); |
| 160 {% else %} | 155 {% else %} |
| 161 {{cpp_class}}V8Internal::indexedPropertyDeleter(index, info); | 156 {{cpp_class}}V8Internal::indexedPropertyDeleter(index, info); |
| 162 {% endif %} | 157 {% endif %} |
| 163 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 164 } | 158 } |
| 165 | 159 |
| 166 {% endif %} | 160 {% endif %} |
| 167 {% endblock %} | 161 {% endblock %} |
| 168 | 162 |
| 169 | 163 |
| 170 {##############################################################################} | 164 {##############################################################################} |
| 171 {% block named_property_getter %} | 165 {% block named_property_getter %} |
| 172 {% if named_property_getter and not named_property_getter.is_custom %} | 166 {% if named_property_getter and not named_property_getter.is_custom %} |
| 173 {% set getter = named_property_getter %} | 167 {% set getter = named_property_getter %} |
| (...skipping 27 matching lines...) Expand all Loading... |
| 201 {% endif %} | 195 {% endif %} |
| 202 {% endblock %} | 196 {% endblock %} |
| 203 | 197 |
| 204 | 198 |
| 205 {##############################################################################} | 199 {##############################################################################} |
| 206 {% block named_property_getter_callback %} | 200 {% block named_property_getter_callback %} |
| 207 {% if named_property_getter %} | 201 {% if named_property_getter %} |
| 208 {% set getter = named_property_getter %} | 202 {% set getter = named_property_getter %} |
| 209 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
ertyCallbackInfo<v8::Value>& info) | 203 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop
ertyCallbackInfo<v8::Value>& info) |
| 210 { | 204 { |
| 211 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | |
| 212 {% if getter.is_custom %} | 205 {% if getter.is_custom %} |
| 213 {{v8_class}}::namedPropertyGetterCustom(name, info); | 206 {{v8_class}}::namedPropertyGetterCustom(name, info); |
| 214 {% else %} | 207 {% else %} |
| 215 {{cpp_class}}V8Internal::namedPropertyGetter(name, info); | 208 {{cpp_class}}V8Internal::namedPropertyGetter(name, info); |
| 216 {% endif %} | 209 {% endif %} |
| 217 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 218 } | 210 } |
| 219 | 211 |
| 220 {% endif %} | 212 {% endif %} |
| 221 {% endblock %} | 213 {% endblock %} |
| 222 | 214 |
| 223 | 215 |
| 224 {##############################################################################} | 216 {##############################################################################} |
| 225 {% block named_property_setter %} | 217 {% block named_property_setter %} |
| 226 {% from 'utilities.cpp' import v8_value_to_local_cpp_value %} | 218 {% from 'utilities.cpp' import v8_value_to_local_cpp_value %} |
| 227 {% if named_property_setter and not named_property_setter.is_custom %} | 219 {% if named_property_setter and not named_property_setter.is_custom %} |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 {% endif %} | 264 {% endif %} |
| 273 {% endblock %} | 265 {% endblock %} |
| 274 | 266 |
| 275 | 267 |
| 276 {##############################################################################} | 268 {##############################################################################} |
| 277 {% block named_property_setter_callback %} | 269 {% block named_property_setter_callback %} |
| 278 {% if named_property_setter %} | 270 {% if named_property_setter %} |
| 279 {% set setter = named_property_setter %} | 271 {% set setter = named_property_setter %} |
| 280 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 272 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::
Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 281 { | 273 { |
| 282 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | |
| 283 {% if setter.is_custom %} | 274 {% if setter.is_custom %} |
| 284 {{v8_class}}::namedPropertySetterCustom(name, v8Value, info); | 275 {{v8_class}}::namedPropertySetterCustom(name, v8Value, info); |
| 285 {% else %} | 276 {% else %} |
| 286 {{cpp_class}}V8Internal::namedPropertySetter(name, v8Value, info); | 277 {{cpp_class}}V8Internal::namedPropertySetter(name, v8Value, info); |
| 287 {% endif %} | 278 {% endif %} |
| 288 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 289 } | 279 } |
| 290 | 280 |
| 291 {% endif %} | 281 {% endif %} |
| 292 {% endblock %} | 282 {% endblock %} |
| 293 | 283 |
| 294 | 284 |
| 295 {##############################################################################} | 285 {##############################################################################} |
| 296 {% block named_property_query %} | 286 {% block named_property_query %} |
| 297 {% if named_property_getter and named_property_getter.is_enumerable and | 287 {% if named_property_getter and named_property_getter.is_enumerable and |
| 298 not named_property_getter.is_custom_property_query %} | 288 not named_property_getter.is_custom_property_query %} |
| (...skipping 22 matching lines...) Expand all Loading... |
| 321 {% endif %} | 311 {% endif %} |
| 322 {% endblock %} | 312 {% endblock %} |
| 323 | 313 |
| 324 | 314 |
| 325 {##############################################################################} | 315 {##############################################################################} |
| 326 {% block named_property_query_callback %} | 316 {% block named_property_query_callback %} |
| 327 {% if named_property_getter and named_property_getter.is_enumerable %} | 317 {% if named_property_getter and named_property_getter.is_enumerable %} |
| 328 {% set getter = named_property_getter %} | 318 {% set getter = named_property_getter %} |
| 329 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) | 319 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope
rtyCallbackInfo<v8::Integer>& info) |
| 330 { | 320 { |
| 331 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | |
| 332 {% if getter.is_custom_property_query %} | 321 {% if getter.is_custom_property_query %} |
| 333 {{v8_class}}::namedPropertyQueryCustom(name, info); | 322 {{v8_class}}::namedPropertyQueryCustom(name, info); |
| 334 {% else %} | 323 {% else %} |
| 335 {{cpp_class}}V8Internal::namedPropertyQuery(name, info); | 324 {{cpp_class}}V8Internal::namedPropertyQuery(name, info); |
| 336 {% endif %} | 325 {% endif %} |
| 337 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 338 } | 326 } |
| 339 | 327 |
| 340 {% endif %} | 328 {% endif %} |
| 341 {% endblock %} | 329 {% endblock %} |
| 342 | 330 |
| 343 | 331 |
| 344 {##############################################################################} | 332 {##############################################################################} |
| 345 {% block named_property_deleter %} | 333 {% block named_property_deleter %} |
| 346 {% if named_property_deleter and not named_property_deleter.is_custom %} | 334 {% if named_property_deleter and not named_property_deleter.is_custom %} |
| 347 {% set deleter = named_property_deleter %} | 335 {% set deleter = named_property_deleter %} |
| (...skipping 28 matching lines...) Expand all Loading... |
| 376 {% endif %} | 364 {% endif %} |
| 377 {% endblock %} | 365 {% endblock %} |
| 378 | 366 |
| 379 | 367 |
| 380 {##############################################################################} | 368 {##############################################################################} |
| 381 {% block named_property_deleter_callback %} | 369 {% block named_property_deleter_callback %} |
| 382 {% if named_property_deleter %} | 370 {% if named_property_deleter %} |
| 383 {% set deleter = named_property_deleter %} | 371 {% set deleter = named_property_deleter %} |
| 384 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) | 372 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro
pertyCallbackInfo<v8::Boolean>& info) |
| 385 { | 373 { |
| 386 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | |
| 387 {% if deleter.is_custom %} | 374 {% if deleter.is_custom %} |
| 388 {{v8_class}}::namedPropertyDeleterCustom(name, info); | 375 {{v8_class}}::namedPropertyDeleterCustom(name, info); |
| 389 {% else %} | 376 {% else %} |
| 390 {{cpp_class}}V8Internal::namedPropertyDeleter(name, info); | 377 {{cpp_class}}V8Internal::namedPropertyDeleter(name, info); |
| 391 {% endif %} | 378 {% endif %} |
| 392 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 393 } | 379 } |
| 394 | 380 |
| 395 {% endif %} | 381 {% endif %} |
| 396 {% endblock %} | 382 {% endblock %} |
| 397 | 383 |
| 398 | 384 |
| 399 {##############################################################################} | 385 {##############################################################################} |
| 400 {% block named_property_enumerator %} | 386 {% block named_property_enumerator %} |
| 401 {% if named_property_getter and named_property_getter.is_enumerable and | 387 {% if named_property_getter and named_property_getter.is_enumerable and |
| 402 not named_property_getter.is_custom_property_enumerator %} | 388 not named_property_getter.is_custom_property_enumerator %} |
| (...skipping 16 matching lines...) Expand all Loading... |
| 419 {% endif %} | 405 {% endif %} |
| 420 {% endblock %} | 406 {% endblock %} |
| 421 | 407 |
| 422 | 408 |
| 423 {##############################################################################} | 409 {##############################################################################} |
| 424 {% block named_property_enumerator_callback %} | 410 {% block named_property_enumerator_callback %} |
| 425 {% if named_property_getter and named_property_getter.is_enumerable %} | 411 {% if named_property_getter and named_property_getter.is_enumerable %} |
| 426 {% set getter = named_property_getter %} | 412 {% set getter = named_property_getter %} |
| 427 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 413 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
| 428 { | 414 { |
| 429 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); | |
| 430 {% if getter.is_custom_property_enumerator %} | 415 {% if getter.is_custom_property_enumerator %} |
| 431 {{v8_class}}::namedPropertyEnumeratorCustom(info); | 416 {{v8_class}}::namedPropertyEnumeratorCustom(info); |
| 432 {% else %} | 417 {% else %} |
| 433 {{cpp_class}}V8Internal::namedPropertyEnumerator(info); | 418 {{cpp_class}}V8Internal::namedPropertyEnumerator(info); |
| 434 {% endif %} | 419 {% endif %} |
| 435 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 436 } | 420 } |
| 437 | 421 |
| 438 {% endif %} | 422 {% endif %} |
| 439 {% endblock %} | 423 {% endblock %} |
| 440 | 424 |
| 441 | 425 |
| 442 {##############################################################################} | 426 {##############################################################################} |
| 443 {% block origin_safe_method_setter %} | 427 {% block origin_safe_method_setter %} |
| 444 {% if has_origin_safe_method_setter %} | 428 {% if has_origin_safe_method_setter %} |
| 445 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo
cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 429 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo
cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 446 { | 430 { |
| 447 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(in
fo.This(), info.GetIsolate()); | 431 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(in
fo.This(), info.GetIsolate()); |
| 448 if (holder.IsEmpty()) | 432 if (holder.IsEmpty()) |
| 449 return; | 433 return; |
| 450 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); | 434 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); |
| 451 v8::String::Utf8Value attributeName(name); | 435 v8::String::Utf8Value attributeName(name); |
| 452 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName,
"{{interface_name}}", info.Holder(), info.GetIsolate()); | 436 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName,
"{{interface_name}}", info.Holder(), info.GetIsolate()); |
| 453 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindo
w(info.GetIsolate()), impl, exceptionState)) { | 437 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindo
w(info.GetIsolate()), impl, exceptionState)) { |
| 454 exceptionState.throwIfNeeded(); | 438 exceptionState.throwIfNeeded(); |
| 455 return; | 439 return; |
| 456 } | 440 } |
| 457 | 441 |
| 458 {# The findInstanceInPrototypeChain() call above only returns a non-empty ha
ndle if info.This() is an Object. #} | 442 {# The findInstanceInPrototypeChain() call above only returns a non-empty ha
ndle if info.This() is an Object. #} |
| 459 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L
ocal<v8::Object>::Cast(info.This()), name.As<v8::String>(), v8Value); | 443 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L
ocal<v8::Object>::Cast(info.This()), name.As<v8::String>(), v8Value); |
| 460 } | 444 } |
| 461 | 445 |
| 462 static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name
, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 446 static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name
, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 463 { | 447 { |
| 464 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
| 465 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value,
info); | 448 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value,
info); |
| 466 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 467 } | 449 } |
| 468 | 450 |
| 469 {% endif %} | 451 {% endif %} |
| 470 {% endblock %} | 452 {% endblock %} |
| 471 | 453 |
| 472 | 454 |
| 473 {##############################################################################} | 455 {##############################################################################} |
| 474 {% block named_constructor %} | 456 {% block named_constructor %} |
| 475 {% from 'methods.cpp' import generate_constructor with context %} | 457 {% from 'methods.cpp' import generate_constructor with context %} |
| 476 {% if named_constructor %} | 458 {% if named_constructor %} |
| (...skipping 12 matching lines...) Expand all Loading... |
| 489 | 471 |
| 490 {{generate_constructor(named_constructor)}} | 472 {{generate_constructor(named_constructor)}} |
| 491 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate
* isolate) | 473 v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate
* isolate) |
| 492 { | 474 { |
| 493 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 475 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
| 494 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 476 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 495 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); | 477 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); |
| 496 if (!result.IsEmpty()) | 478 if (!result.IsEmpty()) |
| 497 return result; | 479 return result; |
| 498 | 480 |
| 499 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); | |
| 500 result = v8::FunctionTemplate::New(isolate, {{v8_class}}ConstructorCallback)
; | 481 result = v8::FunctionTemplate::New(isolate, {{v8_class}}ConstructorCallback)
; |
| 501 v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate(); | 482 v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate(); |
| 502 instanceTemplate->SetInternalFieldCount({{v8_class}}::internalFieldCount); | 483 instanceTemplate->SetInternalFieldCount({{v8_class}}::internalFieldCount); |
| 503 result->SetClassName(v8AtomicString(isolate, "{{cpp_class}}")); | 484 result->SetClassName(v8AtomicString(isolate, "{{cpp_class}}")); |
| 504 result->Inherit({{v8_class}}::domTemplate(isolate)); | 485 result->Inherit({{v8_class}}::domTemplate(isolate)); |
| 505 data->setDOMTemplate(&domTemplateKey, result); | 486 data->setDOMTemplate(&domTemplateKey, result); |
| 506 return result; | 487 return result; |
| 507 } | 488 } |
| 508 | 489 |
| 509 {% endif %} | 490 {% endif %} |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 | 562 |
| 582 {% endif %} | 563 {% endif %} |
| 583 {% endblock %} | 564 {% endblock %} |
| 584 | 565 |
| 585 | 566 |
| 586 {##############################################################################} | 567 {##############################################################################} |
| 587 {% block constructor_callback %} | 568 {% block constructor_callback %} |
| 588 {% if constructors or has_custom_constructor or has_event_constructor %} | 569 {% if constructors or has_custom_constructor or has_event_constructor %} |
| 589 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 570 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 590 { | 571 { |
| 591 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); | |
| 592 {% if measure_as %} | 572 {% if measure_as %} |
| 593 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{measure_as('Constructor')}}); | 573 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{measure_as('Constructor')}}); |
| 594 {% endif %} | 574 {% endif %} |
| 595 if (!info.IsConstructCall()) { | 575 if (!info.IsConstructCall()) { |
| 596 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("{{interface_name}}")); | 576 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("{{interface_name}}")); |
| 597 return; | 577 return; |
| 598 } | 578 } |
| 599 | 579 |
| 600 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { | 580 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { |
| 601 v8SetReturnValue(info, info.Holder()); | 581 v8SetReturnValue(info, info.Holder()); |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 | 959 |
| 980 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} | 960 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
| 981 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 961 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| 982 { | 962 { |
| 983 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 963 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
| 984 } | 964 } |
| 985 | 965 |
| 986 {% endfor %} | 966 {% endfor %} |
| 987 {% endif %} | 967 {% endif %} |
| 988 {% endblock %} | 968 {% endblock %} |
| OLD | NEW |