| OLD | NEW |
| 1 {% extends 'interface_base.cpp.tmpl' %} | 1 {% extends 'interface_base.cpp.tmpl' %} |
| 2 | 2 |
| 3 {% set has_prepare_prototype_and_interface_object = | 3 {% set has_prepare_prototype_and_interface_object = |
| 4 unscopables or has_conditional_attributes_on_prototype or | 4 unscopables or has_conditional_attributes_on_prototype or |
| 5 methods | conditionally_exposed(is_partial) %} | 5 methods | conditionally_exposed(is_partial) %} |
| 6 {% set prepare_prototype_and_interface_object_func = | 6 {% set prepare_prototype_and_interface_object_func = |
| 7 '%s::preparePrototypeAndInterfaceObject' % v8_class | 7 '%s::preparePrototypeAndInterfaceObject' % v8_class |
| 8 if has_prepare_prototype_and_interface_object | 8 if has_prepare_prototype_and_interface_object |
| 9 else 'nullptr' %} | 9 else 'nullptr' %} |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 {% endif %} | 43 {% endif %} |
| 44 {% endblock %} | 44 {% endblock %} |
| 45 | 45 |
| 46 | 46 |
| 47 {##############################################################################} | 47 {##############################################################################} |
| 48 {% block indexed_property_getter_callback %} | 48 {% block indexed_property_getter_callback %} |
| 49 {% if indexed_property_getter or named_property_getter %} | 49 {% if indexed_property_getter or named_property_getter %} |
| 50 {% set getter = indexed_property_getter or named_property_getter %} | 50 {% set getter = indexed_property_getter or named_property_getter %} |
| 51 {{exported}}void indexedPropertyGetterCallback(uint32_t index, const v8::Propert
yCallbackInfo<v8::Value>& info) { | 51 void {{v8_class_or_partial}}::indexedPropertyGetterCallback(uint32_t index, cons
t v8::PropertyCallbackInfo<v8::Value>& info) { |
| 52 {% if indexed_property_getter %} | 52 {% if indexed_property_getter %} |
| 53 | 53 |
| 54 {% if getter.is_custom %} | 54 {% if getter.is_custom %} |
| 55 {{v8_class}}::indexedPropertyGetterCustom(index, info); | 55 {{v8_class}}::indexedPropertyGetterCustom(index, info); |
| 56 {% else %} | 56 {% else %} |
| 57 {{cpp_class}}V8Internal::indexedPropertyGetter(index, info); | 57 {{cpp_class}}V8Internal::indexedPropertyGetter(index, info); |
| 58 {% endif %} | 58 {% endif %} |
| 59 | 59 |
| 60 {% else %}{# otherwise, named property #} | 60 {% else %}{# otherwise, named property #} |
| 61 | 61 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 {% endif %} | 117 {% endif %} |
| 118 {% endblock %} | 118 {% endblock %} |
| 119 | 119 |
| 120 | 120 |
| 121 {##############################################################################} | 121 {##############################################################################} |
| 122 {% block indexed_property_setter_callback %} | 122 {% block indexed_property_setter_callback %} |
| 123 {% if indexed_property_setter or named_property_setter %} | 123 {% if indexed_property_setter or named_property_setter %} |
| 124 {% set setter = indexed_property_setter or named_property_setter %} | 124 {% set setter = indexed_property_setter or named_property_setter %} |
| 125 {{exported}}void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Val
ue> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { | 125 void {{v8_class_or_partial}}::indexedPropertySetterCallback(uint32_t index, v8::
Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 126 {% if setter.is_ce_reactions %} | 126 {% if setter.is_ce_reactions %} |
| 127 CEReactionsScope ceReactionsScope; | 127 CEReactionsScope ceReactionsScope; |
| 128 {% endif %} | 128 {% endif %} |
| 129 | 129 |
| 130 {% if indexed_property_setter %} | 130 {% if indexed_property_setter %} |
| 131 | 131 |
| 132 {% if setter.is_custom %} | 132 {% if setter.is_custom %} |
| 133 {{v8_class}}::indexedPropertySetterCustom(index, v8Value, info); | 133 {{v8_class}}::indexedPropertySetterCustom(index, v8Value, info); |
| 134 {% else %} | 134 {% else %} |
| 135 {{cpp_class}}V8Internal::indexedPropertySetter(index, v8Value, info); | 135 {{cpp_class}}V8Internal::indexedPropertySetter(index, v8Value, info); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 } | 183 } |
| 184 | 184 |
| 185 {% endif %} | 185 {% endif %} |
| 186 {% endblock %} | 186 {% endblock %} |
| 187 | 187 |
| 188 | 188 |
| 189 {##############################################################################} | 189 {##############################################################################} |
| 190 {% block indexed_property_deleter_callback %} | 190 {% block indexed_property_deleter_callback %} |
| 191 {% if indexed_property_deleter or named_property_deleter %} | 191 {% if indexed_property_deleter or named_property_deleter %} |
| 192 {% set deleter = indexed_property_deleter or named_property_deleter %} | 192 {% set deleter = indexed_property_deleter or named_property_deleter %} |
| 193 {{exported}}void indexedPropertyDeleterCallback(uint32_t index, const v8::Proper
tyCallbackInfo<v8::Boolean>& info) { | 193 void {{v8_class_or_partial}}::indexedPropertyDeleterCallback(uint32_t index, con
st v8::PropertyCallbackInfo<v8::Boolean>& info) { |
| 194 {% if deleter.is_ce_reactions %} | 194 {% if deleter.is_ce_reactions %} |
| 195 CEReactionsScope ceReactionsScope; | 195 CEReactionsScope ceReactionsScope; |
| 196 {% endif %} | 196 {% endif %} |
| 197 | 197 |
| 198 {% if indexed_property_deleter %} | 198 {% if indexed_property_deleter %} |
| 199 | 199 |
| 200 {% if deleter.is_custom %} | 200 {% if deleter.is_custom %} |
| 201 {{v8_class}}::indexedPropertyDeleterCustom(index, info); | 201 {{v8_class}}::indexedPropertyDeleterCustom(index, info); |
| 202 {% else %} | 202 {% else %} |
| 203 {{cpp_class}}V8Internal::indexedPropertyDeleter(index, info); | 203 {{cpp_class}}V8Internal::indexedPropertyDeleter(index, info); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 | 247 |
| 248 {% endif %} | 248 {% endif %} |
| 249 {% endblock %} | 249 {% endblock %} |
| 250 | 250 |
| 251 | 251 |
| 252 {##############################################################################} | 252 {##############################################################################} |
| 253 {% block named_property_getter_callback %} | 253 {% block named_property_getter_callback %} |
| 254 {% if named_property_getter %} | 254 {% if named_property_getter %} |
| 255 {% set getter = named_property_getter %} | 255 {% set getter = named_property_getter %} |
| 256 {{exported}}void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8:
:PropertyCallbackInfo<v8::Value>& info) { | 256 void {{v8_class_or_partial}}::namedPropertyGetterCallback(v8::Local<v8::Name> na
me, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 257 if (!name->IsString()) | 257 if (!name->IsString()) |
| 258 return; | 258 return; |
| 259 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 259 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 260 | 260 |
| 261 {% if getter.is_custom %} | 261 {% if getter.is_custom %} |
| 262 {{v8_class}}::namedPropertyGetterCustom(propertyName, info); | 262 {{v8_class}}::namedPropertyGetterCustom(propertyName, info); |
| 263 {% else %} | 263 {% else %} |
| 264 {{cpp_class}}V8Internal::namedPropertyGetter(propertyName, info); | 264 {{cpp_class}}V8Internal::namedPropertyGetter(propertyName, info); |
| 265 {% endif %} | 265 {% endif %} |
| 266 } | 266 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 313 } |
| 314 | 314 |
| 315 {% endif %} | 315 {% endif %} |
| 316 {% endblock %} | 316 {% endblock %} |
| 317 | 317 |
| 318 | 318 |
| 319 {##############################################################################} | 319 {##############################################################################} |
| 320 {% block named_property_setter_callback %} | 320 {% block named_property_setter_callback %} |
| 321 {% if named_property_setter %} | 321 {% if named_property_setter %} |
| 322 {% set setter = named_property_setter %} | 322 {% set setter = named_property_setter %} |
| 323 {{exported}}void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local
<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { | 323 void {{v8_class_or_partial}}::namedPropertySetterCallback(v8::Local<v8::Name> na
me, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& inf
o) { |
| 324 if (!name->IsString()) | 324 if (!name->IsString()) |
| 325 return; | 325 return; |
| 326 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 326 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 327 | 327 |
| 328 {% if setter.is_ce_reactions %} | 328 {% if setter.is_ce_reactions %} |
| 329 CEReactionsScope ceReactionsScope; | 329 CEReactionsScope ceReactionsScope; |
| 330 {% endif %} | 330 {% endif %} |
| 331 | 331 |
| 332 {% if setter.is_custom %} | 332 {% if setter.is_custom %} |
| 333 {{v8_class}}::namedPropertySetterCustom(propertyName, v8Value, info); | 333 {{v8_class}}::namedPropertySetterCustom(propertyName, v8Value, info); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 | 375 |
| 376 {% endif %} | 376 {% endif %} |
| 377 {% endblock %} | 377 {% endblock %} |
| 378 | 378 |
| 379 | 379 |
| 380 {##############################################################################} | 380 {##############################################################################} |
| 381 {% block named_property_deleter_callback %} | 381 {% block named_property_deleter_callback %} |
| 382 {% if named_property_deleter %} | 382 {% if named_property_deleter %} |
| 383 {% set deleter = named_property_deleter %} | 383 {% set deleter = named_property_deleter %} |
| 384 {{exported}}void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8
::PropertyCallbackInfo<v8::Boolean>& info) { | 384 void {{v8_class_or_partial}}::namedPropertyDeleterCallback(v8::Local<v8::Name> n
ame, const v8::PropertyCallbackInfo<v8::Boolean>& info) { |
| 385 if (!name->IsString()) | 385 if (!name->IsString()) |
| 386 return; | 386 return; |
| 387 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 387 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 388 | 388 |
| 389 {% if deleter.is_ce_reactions %} | 389 {% if deleter.is_ce_reactions %} |
| 390 CEReactionsScope ceReactionsScope; | 390 CEReactionsScope ceReactionsScope; |
| 391 {% endif %} | 391 {% endif %} |
| 392 | 392 |
| 393 {% if deleter.is_custom %} | 393 {% if deleter.is_custom %} |
| 394 {{v8_class}}::namedPropertyDeleterCustom(propertyName, info); | 394 {{v8_class}}::namedPropertyDeleterCustom(propertyName, info); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } | 428 } |
| 429 | 429 |
| 430 {% endif %} | 430 {% endif %} |
| 431 {% endblock %} | 431 {% endblock %} |
| 432 | 432 |
| 433 | 433 |
| 434 {##############################################################################} | 434 {##############################################################################} |
| 435 {% block named_property_query_callback %} | 435 {% block named_property_query_callback %} |
| 436 {% if named_property_getter and named_property_getter.is_enumerable %} | 436 {% if named_property_getter and named_property_getter.is_enumerable %} |
| 437 {% set getter = named_property_getter %} | 437 {% set getter = named_property_getter %} |
| 438 {{exported}}void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::
PropertyCallbackInfo<v8::Integer>& info) { | 438 void {{v8_class_or_partial}}::namedPropertyQueryCallback(v8::Local<v8::Name> nam
e, const v8::PropertyCallbackInfo<v8::Integer>& info) { |
| 439 if (!name->IsString()) | 439 if (!name->IsString()) |
| 440 return; | 440 return; |
| 441 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 441 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 442 | 442 |
| 443 {% if getter.is_custom_property_query %} | 443 {% if getter.is_custom_property_query %} |
| 444 {{v8_class}}::namedPropertyQueryCustom(propertyName, info); | 444 {{v8_class}}::namedPropertyQueryCustom(propertyName, info); |
| 445 {% else %} | 445 {% else %} |
| 446 {{cpp_class}}V8Internal::namedPropertyQuery(propertyName, info); | 446 {{cpp_class}}V8Internal::namedPropertyQuery(propertyName, info); |
| 447 {% endif %} | 447 {% endif %} |
| 448 } | 448 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 468 } | 468 } |
| 469 | 469 |
| 470 {% endif %} | 470 {% endif %} |
| 471 {% endblock %} | 471 {% endblock %} |
| 472 | 472 |
| 473 | 473 |
| 474 {##############################################################################} | 474 {##############################################################################} |
| 475 {% block named_property_enumerator_callback %} | 475 {% block named_property_enumerator_callback %} |
| 476 {% if named_property_getter and named_property_getter.is_enumerable %} | 476 {% if named_property_getter and named_property_getter.is_enumerable %} |
| 477 {% set getter = named_property_getter %} | 477 {% set getter = named_property_getter %} |
| 478 {{exported}}void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<
v8::Array>& info) { | 478 void {{v8_class_or_partial}}::namedPropertyEnumeratorCallback(const v8::Property
CallbackInfo<v8::Array>& info) { |
| 479 {% if getter.is_custom_property_enumerator %} | 479 {% if getter.is_custom_property_enumerator %} |
| 480 {{v8_class}}::namedPropertyEnumeratorCustom(info); | 480 {{v8_class}}::namedPropertyEnumeratorCustom(info); |
| 481 {% else %} | 481 {% else %} |
| 482 {{cpp_class}}V8Internal::namedPropertyEnumerator(info); | 482 {{cpp_class}}V8Internal::namedPropertyEnumerator(info); |
| 483 {% endif %} | 483 {% endif %} |
| 484 } | 484 } |
| 485 | 485 |
| 486 {% endif %} | 486 {% endif %} |
| 487 {% endblock %} | 487 {% endblock %} |
| 488 | 488 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 502 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); | 502 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); |
| 503 v8::String::Utf8Value attributeName(name); | 503 v8::String::Utf8Value attributeName(name); |
| 504 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "{{interface_name}}", *attributeName); | 504 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext
, "{{interface_name}}", *attributeName); |
| 505 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()),
impl, exceptionState)) { | 505 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()),
impl, exceptionState)) { |
| 506 return; | 506 return; |
| 507 } | 507 } |
| 508 | 508 |
| 509 {# The findInstanceInPrototypeChain() call above only returns a non-empty hand
le if info.Holder() is an Object. #} | 509 {# The findInstanceInPrototypeChain() call above only returns a non-empty hand
le if info.Holder() is an Object. #} |
| 510 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::Loc
al<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value); | 510 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::Loc
al<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value); |
| 511 } | 511 } |
| 512 | |
| 513 {{exported}}void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name>
name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{ | |
| 514 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, in
fo); | |
| 515 } | |
| 516 | |
| 517 {% endif %} | 512 {% endif %} |
| 518 {% endblock %} | 513 {% endblock %} |
| 519 | 514 |
| 515 {% block origin_safe_method_setter_callback %} |
| 516 {% if has_origin_safe_method_setter %} |
| 517 void {{v8_class_or_partial}}::{{cpp_class}}OriginSafeMethodSetterCallback(v8::Lo
cal<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo
<void>& info) { |
| 518 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, in
fo); |
| 519 } |
| 520 {% endif %} |
| 521 {% endblock %} |
| 522 |
| 520 | 523 |
| 521 {##############################################################################} | 524 {##############################################################################} |
| 522 {% block named_constructor %} | 525 {% block named_constructor %} |
| 523 {% from 'methods.cpp.tmpl' import generate_constructor with context %} | 526 {% from 'methods.cpp.tmpl' import generate_constructor with context %} |
| 524 {% if named_constructor %} | 527 {% if named_constructor %} |
| 525 {% set active_scriptwrappable_inheritance = | 528 {% set active_scriptwrappable_inheritance = |
| 526 'InheritFromActiveScriptWrappable' | 529 'InheritFromActiveScriptWrappable' |
| 527 if active_scriptwrappable else | 530 if active_scriptwrappable else |
| 528 'NotInheritFromActiveScriptWrappable' %} | 531 'NotInheritFromActiveScriptWrappable' %} |
| 529 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial | 532 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 {% endblock %} | 661 {% endblock %} |
| 659 | 662 |
| 660 | 663 |
| 661 {##############################################################################} | 664 {##############################################################################} |
| 662 {% macro install_origin_safe_method(method, world_suffix, instance_template, pro
totype_template) %} | 665 {% macro install_origin_safe_method(method, world_suffix, instance_template, pro
totype_template) %} |
| 663 {% from 'utilities.cpp.tmpl' import property_location %} | 666 {% from 'utilities.cpp.tmpl' import property_location %} |
| 664 {# TODO(dcheng): Currently, bindings must create a function object for each | 667 {# TODO(dcheng): Currently, bindings must create a function object for each |
| 665 realm as a hack to support the incumbent realm. Clean this up when Blink | 668 realm as a hack to support the incumbent realm. Clean this up when Blink |
| 666 properly supports the incumbent realm. #} | 669 properly supports the incumbent realm. #} |
| 667 {% set getter_callback = | 670 {% set getter_callback = |
| 668 '%sV8Internal::%sOriginSafeMethodGetterCallback%s' % | 671 '%s::%sOriginSafeMethodGetterCallback%s' % |
| 669 (cpp_class, method.name, world_suffix) %} | 672 (v8_class_or_partial, method.name, world_suffix) %} |
| 670 {% set setter_callback = | 673 {% set setter_callback = |
| 671 '{0}V8Internal::{0}OriginSafeMethodSetterCallback'.format(cpp_class) | 674 '%s::%sOriginSafeMethodSetterCallback' % (v8_class_or_partial, cpp_class) |
| 672 if not method.is_unforgeable else '0' %} | 675 if not method.is_unforgeable else 'nullptr' %} |
| 673 {% if method.is_per_world_bindings %} | 676 {% if method.is_per_world_bindings %} |
| 674 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} | 677 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} |
| 675 {% set setter_callback_for_main_world = '%sForMainWorld' % setter_callback | 678 {% set setter_callback_for_main_world = '%sForMainWorld' % setter_callback |
| 676 if not method.is_unforgeable else '0' %} | 679 if not method.is_unforgeable else 'nullptr' %} |
| 677 {% else %} | 680 {% else %} |
| 678 {% set getter_callback_for_main_world = '0' %} | 681 {% set getter_callback_for_main_world = 'nullptr' %} |
| 679 {% set setter_callback_for_main_world = '0' %} | 682 {% set setter_callback_for_main_world = 'nullptr' %} |
| 680 {% endif %} | 683 {% endif %} |
| 681 {% set property_attribute = | 684 {% set property_attribute = |
| 682 'static_cast<v8::PropertyAttribute>(%s)' % | 685 'static_cast<v8::PropertyAttribute>(%s)' % |
| 683 ' | '.join(method.property_attributes or ['v8::None']) %} | 686 ' | '.join(method.property_attributes or ['v8::None']) %} |
| 684 {% set holder_check = 'V8DOMConfiguration::CheckHolder' %} | 687 {% set holder_check = 'V8DOMConfiguration::CheckHolder' %} |
| 685 const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttrib
uteConfiguration = { | 688 const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttrib
uteConfiguration = { |
| 686 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba
ck_for_main_world}}, {{setter_callback_for_main_world}}, nullptr, &{{v8_class}}:
:wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holde
r_check}} | 689 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba
ck_for_main_world}}, {{setter_callback_for_main_world}}, nullptr, &{{v8_class}}:
:wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holde
r_check}} |
| 687 }; | 690 }; |
| 688 V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{pr
ototype_template}}, {{method.name}}OriginSafeAttributeConfiguration); | 691 V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{pr
ototype_template}}, {{method.name}}OriginSafeAttributeConfiguration); |
| 689 {%- endmacro %} | 692 {%- endmacro %} |
| 690 | 693 |
| 691 | 694 |
| 692 {##############################################################################} | 695 {##############################################################################} |
| 693 {% macro install_indexed_property_handler(target) %} | 696 {% macro install_indexed_property_handler(target) %} |
| 694 {% set indexed_property_getter_callback = | 697 {% set indexed_property_getter_callback = |
| 695 '%sV8Internal::indexedPropertyGetterCallback' % cpp_class %} | 698 '%s::indexedPropertyGetterCallback' % v8_class_or_partial %} |
| 696 {% set indexed_property_setter_callback = | 699 {% set indexed_property_setter_callback = |
| 697 '%sV8Internal::indexedPropertySetterCallback' % cpp_class | 700 '%s::indexedPropertySetterCallback' % v8_class_or_partial |
| 698 if indexed_property_setter or named_property_setter else '0' %} | 701 if indexed_property_setter or named_property_setter else 'nullptr' %} |
| 699 {% set indexed_property_query_callback = '0' %}{# Unused #} | 702 {% set indexed_property_query_callback = 'nullptr' %}{# Unused #} |
| 700 {% set indexed_property_deleter_callback = | 703 {% set indexed_property_deleter_callback = |
| 701 '%sV8Internal::indexedPropertyDeleterCallback' % cpp_class | 704 '%s::indexedPropertyDeleterCallback' % v8_class_or_partial |
| 702 if indexed_property_deleter or named_property_deleter else '0' %} | 705 if indexed_property_deleter or named_property_deleter else 'nullptr' %} |
| 703 {% set indexed_property_enumerator_callback = | 706 {% set indexed_property_enumerator_callback = |
| 704 'indexedPropertyEnumerator<%s>' % cpp_class | 707 'indexedPropertyEnumerator<%s>' % cpp_class |
| 705 if indexed_property_getter.is_enumerable else '0' %} | 708 if indexed_property_getter.is_enumerable else 'nullptr' %} |
| 706 {% set property_handler_flags = | 709 {% set property_handler_flags = |
| 707 'v8::PropertyHandlerFlags::kNone' %} | 710 'v8::PropertyHandlerFlags::kNone' %} |
| 708 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig({{indexed_p
roperty_getter_callback}}, {{indexed_property_setter_callback}}, {{indexed_prope
rty_query_callback}}, {{indexed_property_deleter_callback}}, {{indexed_property_
enumerator_callback}}, v8::Local<v8::Value>(), {{property_handler_flags}}); | 711 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig({{indexed_p
roperty_getter_callback}}, {{indexed_property_setter_callback}}, {{indexed_prope
rty_query_callback}}, {{indexed_property_deleter_callback}}, {{indexed_property_
enumerator_callback}}, v8::Local<v8::Value>(), {{property_handler_flags}}); |
| 709 {{target}}->SetHandler(indexedPropertyHandlerConfig); | 712 {{target}}->SetHandler(indexedPropertyHandlerConfig); |
| 710 {%- endmacro %} | 713 {%- endmacro %} |
| 711 | 714 |
| 712 | 715 |
| 713 {##############################################################################} | 716 {##############################################################################} |
| 714 {% macro install_named_property_handler(target) %} | 717 {% macro install_named_property_handler(target) %} |
| 715 {% set named_property_getter_callback = | 718 {% set named_property_getter_callback = |
| 716 '%sV8Internal::namedPropertyGetterCallback' % cpp_class %} | 719 '%s::namedPropertyGetterCallback' % v8_class_or_partial %} |
| 717 {% set named_property_setter_callback = | 720 {% set named_property_setter_callback = |
| 718 '%sV8Internal::namedPropertySetterCallback' % cpp_class | 721 '%s::namedPropertySetterCallback' % v8_class_or_partial |
| 719 if named_property_setter else '0' %} | 722 if named_property_setter else 'nullptr' %} |
| 720 {% set named_property_query_callback = | 723 {% set named_property_query_callback = |
| 721 '%sV8Internal::namedPropertyQueryCallback' % cpp_class | 724 '%s::namedPropertyQueryCallback' % v8_class_or_partial |
| 722 if named_property_getter.is_enumerable else '0' %} | 725 if named_property_getter.is_enumerable else 'nullptr' %} |
| 723 {% set named_property_deleter_callback = | 726 {% set named_property_deleter_callback = |
| 724 '%sV8Internal::namedPropertyDeleterCallback' % cpp_class | 727 '%s::namedPropertyDeleterCallback' % v8_class_or_partial |
| 725 if named_property_deleter else '0' %} | 728 if named_property_deleter else 'nullptr' %} |
| 726 {% set named_property_enumerator_callback = | 729 {% set named_property_enumerator_callback = |
| 727 '%sV8Internal::namedPropertyEnumeratorCallback' % cpp_class | 730 '%s::namedPropertyEnumeratorCallback' % v8_class_or_partial |
| 728 if named_property_getter.is_enumerable else '0' %} | 731 if named_property_getter.is_enumerable else 'nullptr' %} |
| 729 {% set property_handler_flags_list = | 732 {% set property_handler_flags_list = |
| 730 ['int(v8::PropertyHandlerFlags::kOnlyInterceptStrings)'] %} | 733 ['int(v8::PropertyHandlerFlags::kOnlyInterceptStrings)'] %} |
| 731 {% if not is_override_builtins %} | 734 {% if not is_override_builtins %} |
| 732 {% set property_handler_flags_list = | 735 {% set property_handler_flags_list = |
| 733 property_handler_flags_list + ['int(v8::PropertyHandlerFlags::kNonMasking
)'] %} | 736 property_handler_flags_list + ['int(v8::PropertyHandlerFlags::kNonMasking
)'] %} |
| 734 {% endif %} | 737 {% endif %} |
| 735 {% set property_handler_flags = | 738 {% set property_handler_flags = |
| 736 'static_cast<v8::PropertyHandlerFlags>(%s)' % | 739 'static_cast<v8::PropertyHandlerFlags>(%s)' % |
| 737 ' | '.join(property_handler_flags_list) %} | 740 ' | '.join(property_handler_flags_list) %} |
| 738 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig({{named_propert
y_getter_callback}}, {{named_property_setter_callback}}, {{named_property_query_
callback}}, {{named_property_deleter_callback}}, {{named_property_enumerator_cal
lback}}, v8::Local<v8::Value>(), {{property_handler_flags}}); | 741 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig({{named_propert
y_getter_callback}}, {{named_property_setter_callback}}, {{named_property_query_
callback}}, {{named_property_deleter_callback}}, {{named_property_enumerator_cal
lback}}, v8::Local<v8::Value>(), {{property_handler_flags}}); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 } | 959 } |
| 957 | 960 |
| 958 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} | 961 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
| 959 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { | 962 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { |
| 960 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 963 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
| 961 } | 964 } |
| 962 | 965 |
| 963 {% endfor %} | 966 {% endfor %} |
| 964 {% endif %} | 967 {% endif %} |
| 965 {% endblock %} | 968 {% endblock %} |
| OLD | NEW |