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

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: Created 3 years, 11 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 {% endmacro %} 419 {% endmacro %}
420 420
421 421
422 {##############################################################################} 422 {##############################################################################}
423 {% macro attribute_configuration(attribute) %} 423 {% macro attribute_configuration(attribute) %}
424 {% from 'utilities.cpp.tmpl' import property_location %} 424 {% from 'utilities.cpp.tmpl' import property_location %}
425 {% if attribute.constructor_type %} 425 {% if attribute.constructor_type %}
426 {% set getter_callback = 426 {% set getter_callback =
427 '%sV8Internal::%sConstructorGetterCallback' % (cpp_class_or_partial, attr ibute.name) 427 '%sV8Internal::%sConstructorGetterCallback' % (cpp_class_or_partial, attr ibute.name)
428 if attribute.needs_constructor_getter_callback else 428 if attribute.needs_constructor_getter_callback else
429 'v8ConstructorAttributeGetter' %} 429 ('V8%s::NamedConstructorAttributeGetter' % (attribute.constructor_type)
430 if attribute.is_named_constructor else
Yuki 2017/01/19 09:57:28 nit: Indent one more space? ('V8%s::...' % (..
sashab 2017/01/20 04:37:05 Good idea -- done.
431 'v8ConstructorAttributeGetter') %}
430 {% set setter_callback = '0' %} 432 {% set setter_callback = '0' %}
431 {% else %}{# regular attributes #} 433 {% else %}{# regular attributes #}
432 {% set getter_callback = '%sV8Internal::%sAttributeGetterCallback' % 434 {% set getter_callback = '%sV8Internal::%sAttributeGetterCallback' %
433 (cpp_class_or_partial, attribute.name) %} 435 (cpp_class_or_partial, attribute.name) %}
434 {% set setter_callback = '%sV8Internal::%sAttributeSetterCallback' % 436 {% set setter_callback = '%sV8Internal::%sAttributeSetterCallback' %
435 (cpp_class_or_partial, attribute.name) 437 (cpp_class_or_partial, attribute.name)
436 if attribute.has_setter else '0' %} 438 if attribute.has_setter else '0' %}
437 {% endif %} 439 {% endif %}
438 {% set getter_callback_for_main_world = 440 {% set getter_callback_for_main_world =
439 '%sForMainWorld' % getter_callback 441 '%sForMainWorld' % getter_callback
(...skipping 27 matching lines...) Expand all
467 setter_callback_for_main_world, 469 setter_callback_for_main_world,
468 cached_accessor_callback, 470 cached_accessor_callback,
469 wrapper_type_info, 471 wrapper_type_info,
470 access_control, 472 access_control,
471 property_attribute, 473 property_attribute,
472 property_location(attribute), 474 property_location(attribute),
473 holder_check, 475 holder_check,
474 ] %} 476 ] %}
475 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} 477 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}}
476 {%- endmacro %} 478 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698