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

Unified Diff: third_party/WebKit/Source/bindings/scripts/v8_attributes.py

Issue 2335203006: Add [CachedAccessor] attribute to cache (almost) constant accessors (window.document). (Closed)
Patch Set: Polishing + naming revisited 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/scripts/v8_attributes.py
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
index f27015b2e7e865dd0506b293046eabdb2841326a..4375ff9e3b8e7a791d2a133fc91ab5954f45d7f8 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -119,12 +119,12 @@ def attribute_context(interface, attribute):
'enum_type': idl_type.enum_type,
'enum_values': idl_type.enum_values,
'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed]
- 'has_fast_accessor': 'FastAccessor' in extended_attributes,
'has_custom_getter': has_custom_getter(attribute),
'has_custom_setter': has_custom_setter(attribute),
'has_fast_accessor': 'FastAccessor' in extended_attributes,
'has_setter': has_setter(interface, attribute),
'idl_type': str(idl_type), # need trailing [] on array for Dictionary::ConversionContext::setConversionType
+ 'is_cached_accessor': 'CachedAccessor' in extended_attributes,
'is_call_with_execution_context': has_extended_attribute_value(attribute, 'CallWith', 'ExecutionContext'),
'is_call_with_script_state': has_extended_attribute_value(attribute, 'CallWith', 'ScriptState'),
'is_ce_reactions': is_ce_reactions,
@@ -132,7 +132,7 @@ def attribute_context(interface, attribute):
'is_check_security_for_return_value': is_check_security_for_return_value,
'is_custom_element_callbacks': is_custom_element_callbacks,
# TODO(yukishiino): Make all DOM attributes accessor-type properties.
- 'is_data_type_property': is_data_type_property(interface, attribute),
+ 'is_data_type_property': not ('CachedAccessor' in extended_attributes) and is_data_type_property(interface, attribute),
'is_getter_raises_exception': # [RaisesException]
'RaisesException' in extended_attributes and
extended_attributes['RaisesException'] in (None, 'Getter'),
@@ -172,6 +172,7 @@ def attribute_context(interface, attribute):
'runtime_feature_name': v8_utilities.runtime_feature_name(attribute), # [RuntimeEnabled]
'secure_context_test': v8_utilities.secure_context(attribute, interface), # [SecureContext]
'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
+ 'cache_property_name': '%s%s' % (interface.name, attribute.name.capitalize()),
haraken 2016/09/20 14:15:03 cached_accessor_name
'world_suffixes': (
['', 'ForMainWorld']
if 'PerWorldBindings' in extended_attributes

Powered by Google App Engine
This is Rietveld 408576698