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

Unified Diff: third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl

Issue 2335203006: Add [CachedAccessor] attribute to cache (almost) constant accessors (window.document). (Closed)
Patch Set: Fix rebase dirt Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
index a12395f8db880b259bb4490915321789bb407aff..a916d84740bbd1505ed06d9af368a85567eec0e4 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
@@ -94,11 +94,15 @@ static void (*{{method.name}}MethodForPartialInterface)(const v8::FunctionCallba
{##############################################################################}
{% from 'attributes.cpp.tmpl' import constructor_getter_callback,
attribute_getter, attribute_getter_callback,
- attribute_setter, attribute_setter_callback,
+ attribute_setter, attribute_setter_callback,
+ attribute_cache_property_callback,
attribute_getter_implemented_in_private_script,
attribute_setter_implemented_in_private_script
with context %}
{% for attribute in attributes if attribute.should_be_exposed_to_script %}
+{% if attribute.is_cached_accessor %}
+{{attribute_cache_property_callback(attribute)}}
+{% endif %}
{% for world_suffix in attribute.world_suffixes %}
{% if not attribute.has_custom_getter and not attribute.constructor_type %}
{{attribute_getter(attribute, world_suffix)}}

Powered by Google App Engine
This is Rietveld 408576698