Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl

Issue 2647643002: Fix V8 bindings for named constructors to set prototype object correctly (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t o_local_cpp_value %} 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t o_local_cpp_value %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% macro attribute_getter(attribute, world_suffix) %} 4 {% macro attribute_getter(attribute, world_suffix) %}
5 static void {{attribute.name}}AttributeGetter{{world_suffix}}( 5 static void {{attribute.name}}AttributeGetter{{world_suffix}}(
6 {%- if attribute.is_data_type_property %} 6 {%- if attribute.is_data_type_property %}
7 const v8::PropertyCallbackInfo<v8::Value>& info 7 const v8::PropertyCallbackInfo<v8::Value>& info
8 {%- else %} 8 {%- else %}
9 const v8::FunctionCallbackInfo<v8::Value>& info 9 const v8::FunctionCallbackInfo<v8::Value>& info
10 {%- endif %}) { 10 {%- endif %}) {
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeSetter{{world_s uffix}}(v8Value, info); 454 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeSetter{{world_s uffix}}(v8Value, info);
455 {% endif %} 455 {% endif %}
456 } 456 }
457 {% endmacro %} 457 {% endmacro %}
458 458
459 459
460 {##############################################################################} 460 {##############################################################################}
461 {% macro attribute_configuration(attribute) %} 461 {% macro attribute_configuration(attribute) %}
462 {% from 'utilities.cpp.tmpl' import property_location %} 462 {% from 'utilities.cpp.tmpl' import property_location %}
463 {% if attribute.constructor_type %} 463 {% if attribute.constructor_type %}
464 {% set getter_callback = 464 {% if attribute.needs_constructor_getter_callback %}
465 '%s::%sConstructorGetterCallback' % (v8_class_or_partial, attribute.name) 465 {% set getter_callback = '%s::%sConstructorGetterCallback' % (v8_class_or_pa rtial, attribute.name) %}
466 if attribute.needs_constructor_getter_callback else 466 {% else %}
467 'v8ConstructorAttributeGetter' %} 467 {% set getter_callback = 'V8%s::NamedConstructorAttributeGetter' % (attribut e.constructor_type)
468 if attribute.is_named_constructor else 'v8ConstructorAttributeGetter' %}
469 {% endif %}
468 {% set setter_callback = 'nullptr' %} 470 {% set setter_callback = 'nullptr' %}
469 {% else %}{# regular attributes #} 471 {% else %}{# regular attributes #}
470 {% set getter_callback = '%s::%sAttributeGetterCallback' % 472 {% set getter_callback = '%s::%sAttributeGetterCallback' %
471 (v8_class_or_partial, attribute.name) %} 473 (v8_class_or_partial, attribute.name) %}
472 {% set setter_callback = '%s::%sAttributeSetterCallback' % 474 {% set setter_callback = '%s::%sAttributeSetterCallback' %
473 (v8_class_or_partial, attribute.name) 475 (v8_class_or_partial, attribute.name)
474 if attribute.has_setter else 'nullptr' %} 476 if attribute.has_setter else 'nullptr' %}
475 {% endif %} 477 {% endif %}
476 {% set getter_callback_for_main_world = 478 {% set getter_callback_for_main_world =
477 '%sForMainWorld' % getter_callback 479 '%sForMainWorld' % getter_callback
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 {% filter exposed(attribute.exposed_test) %} 513 {% filter exposed(attribute.exposed_test) %}
512 {% filter secure_context(attribute.secure_context_test) %} 514 {% filter secure_context(attribute.secure_context_test) %}
513 {% filter runtime_enabled(attribute.runtime_enabled_feature_name) %} 515 {% filter runtime_enabled(attribute.runtime_enabled_feature_name) %}
514 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib ute_configuration(attribute)}}; 516 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib ute_configuration(attribute)}};
515 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), pro totypeObject, interfaceObject, signature, accessorConfiguration); 517 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), pro totypeObject, interfaceObject, signature, accessorConfiguration);
516 {% endfilter %}{# runtime_enabled #} 518 {% endfilter %}{# runtime_enabled #}
517 {% endfilter %}{# secure_context #} 519 {% endfilter %}{# secure_context #}
518 {% endfilter %}{# exposed #} 520 {% endfilter %}{# exposed #}
519 {% endfor %} 521 {% endfor %}
520 {% endmacro %} 522 {% endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698