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

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

Issue 2335203006: Add [CachedAccessor] attribute to cache (almost) constant accessors (window.document). (Closed)
Patch Set: Fix rebase dirt Created 4 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.tmpl' %} 1 {% extends 'interface_base.cpp.tmpl' %}
2 2
3 {% set has_prepare_prototype_and_interface_object = 3 {% set has_prepare_prototype_and_interface_object =
4 unscopables or has_conditional_attributes_on_prototype or 4 unscopables or has_conditional_attributes_on_prototype or
5 methods | conditionally_exposed(is_partial) %} 5 methods | conditionally_exposed(is_partial) %}
6 {% set prepare_prototype_and_interface_object_func = 6 {% set prepare_prototype_and_interface_object_func =
7 '%s::preparePrototypeAndInterfaceObject' % v8_class 7 '%s::preparePrototypeAndInterfaceObject' % v8_class
8 if has_prepare_prototype_and_interface_object 8 if has_prepare_prototype_and_interface_object
9 else 'nullptr' %} 9 else 'nullptr' %}
10 10
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 {% else %} 695 {% else %}
696 {% set getter_callback_for_main_world = '0' %} 696 {% set getter_callback_for_main_world = '0' %}
697 {% set setter_callback_for_main_world = '0' %} 697 {% set setter_callback_for_main_world = '0' %}
698 {% endif %} 698 {% endif %}
699 {% set property_attribute = 699 {% set property_attribute =
700 'static_cast<v8::PropertyAttribute>(%s)' % 700 'static_cast<v8::PropertyAttribute>(%s)' %
701 ' | '.join(method.property_attributes or ['v8::None']) %} 701 ' | '.join(method.property_attributes or ['v8::None']) %}
702 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %} 702 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %}
703 {% set holder_check = 'V8DOMConfiguration::CheckHolder' %} 703 {% set holder_check = 'V8DOMConfiguration::CheckHolder' %}
704 const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttrib uteConfiguration = { 704 const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttrib uteConfiguration = {
705 "{{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}}, 705 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba ck_for_main_world}}, {{setter_callback_for_main_world}}, nullptr, &{{v8_class}}: :wrapperTypeInfo, v8::ALL_CAN_READ, {{property_attribute}}, {{only_exposed_to_pr ivate_script}}, {{property_location(method)}}, {{holder_check}},
706 }; 706 };
707 V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{pr ototype_template}}, {{method.name}}OriginSafeAttributeConfiguration); 707 V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{pr ototype_template}}, {{method.name}}OriginSafeAttributeConfiguration);
708 {%- endmacro %} 708 {%- endmacro %}
709 709
710 710
711 {##############################################################################} 711 {##############################################################################}
712 {% macro install_indexed_property_handler(target) %} 712 {% macro install_indexed_property_handler(target) %}
713 {% set indexed_property_getter_callback = 713 {% set indexed_property_getter_callback =
714 '%sV8Internal::indexedPropertyGetterCallback' % cpp_class %} 714 '%sV8Internal::indexedPropertyGetterCallback' % cpp_class %}
715 {% set indexed_property_setter_callback = 715 {% set indexed_property_setter_callback =
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 990
991 {% 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 %}
992 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>&))
993 { 993 {
994 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 994 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
995 } 995 }
996 996
997 {% endfor %} 997 {% endfor %}
998 {% endif %} 998 {% endif %}
999 {% endblock %} 999 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698