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

Side by Side Diff: Source/bindings/templates/interface.cpp

Issue 968583002: bindings: Supports conditionally-enabled accessors. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
OLDNEW
1 {% extends 'interface_base.cpp' %} 1 {% extends 'interface_base.cpp' %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% block indexed_property_getter %} 5 {% block indexed_property_getter %}
6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %}
7 {% set getter = indexed_property_getter %} 7 {% set getter = indexed_property_getter %}
8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
9 { 9 {
10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 {% from 'attributes.cpp' import attribute_configuration with context %} 883 {% from 'attributes.cpp' import attribute_configuration with context %}
884 {% if has_conditional_attributes %} 884 {% if has_conditional_attributes %}
885 void {{v8_class}}::installConditionallyEnabledProperties(v8::Local<v8::Object> i nstanceObject, v8::Isolate* isolate) 885 void {{v8_class}}::installConditionallyEnabledProperties(v8::Local<v8::Object> i nstanceObject, v8::Isolate* isolate)
886 { 886 {
887 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance Object->GetPrototype()); 887 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance Object->GetPrototype());
888 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext()); 888 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext());
889 889
890 {% for attribute in attributes if attribute.per_context_enabled_function or attribute.exposed_test %} 890 {% for attribute in attributes if attribute.per_context_enabled_function or attribute.exposed_test %}
891 {% filter per_context_enabled(attribute.per_context_enabled_function) %} 891 {% filter per_context_enabled(attribute.per_context_enabled_function) %}
892 {% filter exposed(attribute.exposed_test) %} 892 {% filter exposed(attribute.exposed_test) %}
893 static const V8DOMConfiguration::AttributeConfiguration attributeConfigurati on =\ 893 {% if attribute.is_expose_js_accessors %}
894 {{attribute_configuration(attribute)}}; 894 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attribute_configuration(attribute)}};
895 V8DOMConfiguration::installAccessor(isolate, prototypeObject, accessorConfig uration);
896 {% else %}
897 static const V8DOMConfiguration::AttributeConfiguration attributeConfigurati on = {{attribute_configuration(attribute)}};
895 V8DOMConfiguration::installAttribute(isolate, instanceObject, prototypeObjec t, attributeConfiguration); 898 V8DOMConfiguration::installAttribute(isolate, instanceObject, prototypeObjec t, attributeConfiguration);
899 {% endif %}
896 {% endfilter %} 900 {% endfilter %}
897 {% endfilter %} 901 {% endfilter %}
898 {% endfor %} 902 {% endfor %}
899 } 903 }
900 904
901 {% endif %} 905 {% endif %}
902 {% endblock %} 906 {% endblock %}
903 907
904 908
905 {##############################################################################} 909 {##############################################################################}
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 } 989 }
986 990
987 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 991 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
988 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 992 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
989 { 993 {
990 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 994 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
991 } 995 }
992 {% endfor %} 996 {% endfor %}
993 {% endif %} 997 {% endif %}
994 {% endblock %} 998 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698