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

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

Issue 1202683002: bindings: Supports per-member [Exposed] for attributes on prototype. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed review comments. Created 5 years, 6 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 { 790 {
791 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0; 791 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0;
792 } 792 }
793 793
794 {% endblock %} 794 {% endblock %}
795 795
796 796
797 {##############################################################################} 797 {##############################################################################}
798 {% block install_conditional_attributes %} 798 {% block install_conditional_attributes %}
799 {% from 'attributes.cpp' import attribute_configuration with context %} 799 {% from 'attributes.cpp' import attribute_configuration with context %}
800 {% if has_conditional_attributes %} 800 {% if has_conditional_attributes_on_instance %}
801 void {{v8_class}}::installConditionallyEnabledProperties(v8::Local<v8::Object> i nstanceObject, v8::Isolate* isolate) 801 void {{v8_class}}::installConditionallyEnabledProperties(v8::Local<v8::Object> i nstanceObject, v8::Isolate* isolate)
802 { 802 {
803 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(instance Object->GetPrototype()); 803 #error TODO(yukishiino): Rename this function to prepareInstanceObject (c.f. pre parePrototypeObject) and implement this function if necessary. http://crbug.com /503508
804 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext());
805
806 {% for attribute in attributes if attribute.exposed_test %}
807 {% filter exposed(attribute.exposed_test) %}
808 #error No one is actually using per-member [Exposed] extended attribute. Not su pported. Contact to blink-reviews-bindings@ if you need.
809 // TODO(yukishiino): Implement the feature again if there is a client.
810 {% endfilter %}
811 {% endfor %}
812 {% for method in methods if method.exposed_test %}
813 {% filter exposed(method.exposed_test) %}
814 #error No one is actually using per-member [Exposed] extended attribute. Not su pported. Contact to blink-reviews-bindings@ if you need.
815 // TODO(yukishiino): Implement the feature again if there is a client.
816 {% endfilter %}
817 {% endfor %}
818 } 804 }
819 805
820 {% endif %} 806 {% endif %}
821 {% endblock %} 807 {% endblock %}
822 808
823 809
824 {##############################################################################} 810 {##############################################################################}
825 {% block prepare_prototype_object %} 811 {% block prepare_prototype_object %}
812 {% from 'attributes.cpp' import attribute_configuration with context %}
826 {% from 'methods.cpp' import install_conditionally_enabled_methods with context %} 813 {% from 'methods.cpp' import install_conditionally_enabled_methods with context %}
827 {% if unscopeables or conditionally_enabled_methods %} 814 {% if has_conditional_member_on_prototype or unscopeables %}
828 void {{v8_class}}::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8::Ob ject> prototypeObject) 815 void {{v8_class}}::preparePrototypeObject(v8::Isolate* isolate, v8::Local<v8::Ob ject> prototypeObject, v8::Local<v8::FunctionTemplate> interfaceTemplate)
829 { 816 {
830 {% if unscopeables %} 817 {% if unscopeables %}
831 {{install_unscopeables() | indent}} 818 {{install_unscopeables() | indent}}
832 {% endif %} 819 {% endif %}
820 {% if has_conditional_attributes_on_prototype %}
821 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext());
haraken 2015/06/23 09:14:07 What is the ExecutionContext for?
Yuki 2015/06/23 12:41:38 To check what is the global object. For [Exposed=
822 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTe mplate);
823
824 {% for attribute in attributes if attribute.exposed_test and attribute.on_pr ototype %}
825 {% filter exposed(attribute.exposed_test) %}
826 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attribute_configuration(attribute)}};
827 V8DOMConfiguration::installAccessor(isolate, v8::Local<v8::Object>(), protot ypeObject, v8::Local<v8::Function>(), signature, accessorConfiguration);
828 {% endfilter %}
829 {% endfor %}
830 {% endif %}
833 {% if conditionally_enabled_methods %} 831 {% if conditionally_enabled_methods %}
834 {{install_conditionally_enabled_methods() | indent}} 832 {{install_conditionally_enabled_methods() | indent}}
835 {% endif %} 833 {% endif %}
836 } 834 }
837 835
838 {% endif %} 836 {% endif %}
839 {% endblock %} 837 {% endblock %}
840 838
841 839
842 {##############################################################################} 840 {##############################################################################}
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 } 938 }
941 939
942 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 940 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
943 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 941 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
944 { 942 {
945 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 943 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
946 } 944 }
947 {% endfor %} 945 {% endfor %}
948 {% endif %} 946 {% endif %}
949 {% endblock %} 947 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698