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

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

Issue 2692343005: [Bindings] Unify a template block 'prepare_prototype_and_interface_object' (Closed)
Patch Set: Created 3 years, 10 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 getter_callback_for_main_world, 497 getter_callback_for_main_world,
498 setter_callback_for_main_world, 498 setter_callback_for_main_world,
499 cached_accessor_callback, 499 cached_accessor_callback,
500 wrapper_type_info, 500 wrapper_type_info,
501 property_attribute, 501 property_attribute,
502 property_location(attribute), 502 property_location(attribute),
503 holder_check, 503 holder_check,
504 ] %} 504 ] %}
505 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} 505 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}}
506 {%- endmacro %} 506 {%- endmacro %}
507
508 {##############################################################################}
509 {% macro install_conditionally_enabled_attributes_on_prototype() %}
510 ExecutionContext* executionContext = toExecutionContext(context);
511 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTempla te);
512 {% for attribute in attributes if (attribute.exposed_test or attribute.secure_co ntext_test) and attribute.on_prototype %}
513 {% filter exposed(attribute.exposed_test) %}
514 {% filter secure_context(attribute.secure_context_test) %}
515 {% filter runtime_enabled(attribute.runtime_enabled_feature_name) %}
516 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib ute_configuration(attribute)}};
517 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), pro totypeObject, interfaceObject, signature, accessorConfiguration);
518 {% endfilter %}{# runtime_enabled #}
519 {% endfilter %}{# secure_context #}
520 {% endfilter %}{# exposed #}
521 {% endfor %}
522 {% endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698