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

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

Issue 2875583002: AccessorConfiguration and AttributeConfiguration no longer need the same fields. (Closed)
Patch Set: whitespace changes Created 3 years, 7 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 {% extends 'interface_base.cpp.tmpl' %} 1 {% extends 'interface_base.cpp.tmpl' %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% block indexed_property_getter %} 4 {% block indexed_property_getter %}
5 {% if indexed_property_getter and not indexed_property_getter.is_custom %} 5 {% if indexed_property_getter and not indexed_property_getter.is_custom %}
6 {% set getter = indexed_property_getter %} 6 {% set getter = indexed_property_getter %}
7 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) { 7 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) {
8 {% if getter.is_raises_exception %} 8 {% if getter.is_raises_exception %}
9 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedGette rContext, "{{interface_name}}"); 9 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedGette rContext, "{{interface_name}}");
10 {% endif %} 10 {% endif %}
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 if not method.is_unforgeable else 'nullptr' %} 671 if not method.is_unforgeable else 'nullptr' %}
672 {% set property_attribute = 672 {% set property_attribute =
673 'static_cast<v8::PropertyAttribute>(%s)' % 673 'static_cast<v8::PropertyAttribute>(%s)' %
674 ' | '.join(method.property_attributes or ['v8::None']) %} 674 ' | '.join(method.property_attributes or ['v8::None']) %}
675 {% set holder_check = 'V8DOMConfiguration::kCheckHolder' %} 675 {% set holder_check = 'V8DOMConfiguration::kCheckHolder' %}
676 static const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSaf eAttributeConfiguration[] = { 676 static const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSaf eAttributeConfiguration[] = {
677 {% if method.is_per_world_bindings %} 677 {% if method.is_per_world_bindings %}
678 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} 678 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %}
679 {% set setter_callback_for_main_world = '%sForMainWorld' % setter_callback 679 {% set setter_callback_for_main_world = '%sForMainWorld' % setter_callback
680 if not method.is_unforgeable else 'nullptr' %} 680 if not method.is_unforgeable else 'nullptr' %}
681 {"{{method.name}}", {{getter_callback_for_main_world}}, {{setter_callback_fo r_main_world}}, nullptr, &{{v8_class}}::wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, V8DOMConfiguration::MainWorld} , 681 {"{{method.name}}", {{getter_callback_for_main_world}}, {{setter_callback_fo r_main_world}}, &{{v8_class}}::wrapperTypeInfo, {{property_attribute}}, {{proper ty_location(method)}}, {{holder_check}}, V8DOMConfiguration::MainWorld},
682 {"{{method.name}}", {{getter_callback}}, {{setter_callback}}, nullptr, &{{v8 _class}}::wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}} , {{holder_check}}, V8DOMConfiguration::NonMainWorlds}} 682 {"{{method.name}}", {{getter_callback}}, {{setter_callback}}, &{{v8_class}}: :wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holde r_check}}, V8DOMConfiguration::NonMainWorlds}}
683 {% else %} 683 {% else %}
684 {"{{method.name}}", {{getter_callback}}, {{setter_callback}}, nullptr, &{{v8 _class}}::wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}} , {{holder_check}}, V8DOMConfiguration::kAllWorlds} 684 {"{{method.name}}", {{getter_callback}}, {{setter_callback}}, &{{v8_class}}: :wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holde r_check}}, V8DOMConfiguration::kAllWorlds}
685 {% endif %} 685 {% endif %}
686 }; 686 };
687 for (const auto& attributeConfig : {{method.name}}OriginSafeAttributeConfigurati on) 687 for (const auto& attributeConfig : {{method.name}}OriginSafeAttributeConfigurati on)
688 V8DOMConfiguration::InstallAttribute(isolate, world, {{instance_template}}, {{ prototype_template}}, attributeConfig); 688 V8DOMConfiguration::InstallAttribute(isolate, world, {{instance_template}}, {{ prototype_template}}, attributeConfig);
689 {%- endmacro %} 689 {%- endmacro %}
690 690
691 691
692 {##############################################################################} 692 {##############################################################################}
693 {% macro install_indexed_property_handler(target) %} 693 {% macro install_indexed_property_handler(target) %}
694 {% set indexed_property_getter_callback = 694 {% set indexed_property_getter_callback =
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 } 934 }
935 935
936 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 936 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
937 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { 937 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) {
938 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 938 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
939 } 939 }
940 940
941 {% endfor %} 941 {% endfor %}
942 {% endif %} 942 {% endif %}
943 {% endblock %} 943 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698