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

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

Issue 1386843002: bindings: Implements the named properties object (WindowProperties). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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' %} 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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 {% endif %} 658 {% endif %}
659 {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class, v8 _class) if has_partial_interface else 'install%sTemplate' % v8_class %} 659 {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class, v8 _class) if has_partial_interface else 'install%sTemplate' % v8_class %}
660 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), {{installTemplateFunction}}); 660 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), {{installTemplateFunction}});
661 } 661 }
662 662
663 {% endif %} 663 {% endif %}
664 {% endblock %} 664 {% endblock %}
665 665
666 666
667 {##############################################################################} 667 {##############################################################################}
668 {% block get_dom_template_for_named_properties_object %}
669 {% if has_named_properties_object %}
670 v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplateForNamedPropertiesObjec t(v8::Isolate* isolate)
671 {
672 v8::Local<v8::FunctionTemplate> parentTemplate = V8{{parent_interface}}::dom Template(isolate);
673 v8::Local<v8::FunctionTemplate> namedPropertiesObjectFunctionTemplate = v8:: FunctionTemplate::New(isolate);
674 namedPropertiesObjectFunctionTemplate->SetClassName(v8AtomicString(isolate, "{{interface_name}}Properties"));
675 namedPropertiesObjectFunctionTemplate->Inherit(parentTemplate);
676 v8::Local<v8::ObjectTemplate> namedPropertiesObjectTemplate = namedPropertie sObjectFunctionTemplate->PrototypeTemplate();
677
678 return namedPropertiesObjectFunctionTemplate;
679 }
680
681 {% endif %}
682 {% endblock %}
683
684
685 {##############################################################################}
668 {% block has_instance %} 686 {% block has_instance %}
669 bool {{v8_class}}::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolat e) 687 bool {{v8_class}}::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolat e)
670 { 688 {
671 {% if is_array_buffer_or_view %} 689 {% if is_array_buffer_or_view %}
672 return v8Value->Is{{interface_name}}(); 690 return v8Value->Is{{interface_name}}();
673 {% else %} 691 {% else %}
674 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e); 692 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e);
675 {% endif %} 693 {% endif %}
676 } 694 }
677 695
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 {{v8_class}}::install{{v8_class}}TemplateFunction = installTemplateFunction; 913 {{v8_class}}::install{{v8_class}}TemplateFunction = installTemplateFunction;
896 if (preparePrototypeAndInterfaceObjectFunction) 914 if (preparePrototypeAndInterfaceObjectFunction)
897 {{v8_class}}::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunction = preparePrototypeAndInterfaceObjectFunction; 915 {{v8_class}}::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunction = preparePrototypeAndInterfaceObjectFunction;
898 } 916 }
899 917
900 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 918 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
901 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 919 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
902 { 920 {
903 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 921 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
904 } 922 }
923
905 {% endfor %} 924 {% endfor %}
906 {% endif %} 925 {% endif %}
907 {% endblock %} 926 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698