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

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

Issue 1360233007: bindings: Moves event handlers and methods of Window to the instance object. (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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 {% if method.is_per_world_bindings %} 628 {% if method.is_per_world_bindings %}
629 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} 629 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %}
630 {% set setter_callback_for_main_world = '%sForMainWorld' % setter_callback 630 {% set setter_callback_for_main_world = '%sForMainWorld' % setter_callback
631 if not method.is_read_only else '0' %} 631 if not method.is_read_only else '0' %}
632 {% else %} 632 {% else %}
633 {% set getter_callback_for_main_world = '0' %} 633 {% set getter_callback_for_main_world = '0' %}
634 {% set setter_callback_for_main_world = '0' %} 634 {% set setter_callback_for_main_world = '0' %}
635 {% endif %} 635 {% endif %}
636 {% set property_attribute = 636 {% set property_attribute =
637 'static_cast<v8::PropertyAttribute>(%s)' % 637 'static_cast<v8::PropertyAttribute>(%s)' %
638 ' | '.join(method.property_attributes or ['v8::DontDelete']) %} 638 ' | '.join(method.property_attributes or ['v8::None']) %}
haraken 2015/09/25 10:41:35 Just help me understand: Why do we need to make th
Yuki 2015/09/25 14:40:43 Unless it's [Unforgeable], JS properties correspon
639 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %} 639 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %}
640 {% set holder_check = 'V8DOMConfiguration::DoNotCheckHolder' if method.is_do_not _check_signature else 'V8DOMConfiguration::CheckHolder' %} 640 {% set holder_check = 'V8DOMConfiguration::DoNotCheckHolder' if method.is_do_not _check_signature else 'V8DOMConfiguration::CheckHolder' %}
641 const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttrib uteConfiguration = { 641 const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttrib uteConfiguration = {
642 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba ck_for_main_world}}, {{setter_callback_for_main_world}}, &{{v8_class}}::wrapperT ypeInfo, v8::ALL_CAN_READ, {{property_attribute}}, {{only_exposed_to_private_scr ipt}}, {{property_location(method)}}, {{holder_check}}, 642 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba ck_for_main_world}}, {{setter_callback_for_main_world}}, &{{v8_class}}::wrapperT ypeInfo, v8::ALL_CAN_READ, {{property_attribute}}, {{only_exposed_to_private_scr ipt}}, {{property_location(method)}}, {{holder_check}},
643 }; 643 };
644 V8DOMConfiguration::installAttribute(isolate, {{instance_template}}, {{prototype _template}}, {{method.name}}OriginSafeAttributeConfiguration); 644 V8DOMConfiguration::installAttribute(isolate, {{instance_template}}, {{prototype _template}}, {{method.name}}OriginSafeAttributeConfiguration);
645 {%- endmacro %} 645 {%- endmacro %}
646 646
647 647
648 {##############################################################################} 648 {##############################################################################}
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 } 898 }
899 899
900 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 900 {% 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>&)) 901 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
902 { 902 {
903 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 903 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
904 } 904 }
905 {% endfor %} 905 {% endfor %}
906 {% endif %} 906 {% endif %}
907 {% endblock %} 907 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698