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

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

Issue 2568403002: [Bindings][Refactoring] Remove attribute filters from .tmpl files (Closed)
Patch Set: Created 4 years 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 b0e4194ec4cf0d2f3811261cd1ce71910cc038fd..715be5d8c5cef30616233555338a4b563905cb9e 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -228,7 +228,7 @@ def attribute_context(interface, attribute, interfaces):
return context
-def filter_has_accessor_configuration(attributes):
+def filter_accessors(attributes):
return [attribute for attribute in attributes if
not (attribute['exposed_test'] or
attribute['secure_context_test'] or
@@ -238,26 +238,25 @@ def filter_has_accessor_configuration(attributes):
attribute['should_be_exposed_to_script']]
-def filter_has_data_attribute_configuration(attributes):
- return [attribute for attribute in attributes if
- not (attribute['exposed_test'] or
+def is_data_attribute(attribute):
+ return (not (attribute['exposed_test'] or
attribute['secure_context_test'] or
attribute['origin_trial_enabled_function'] or
attribute['runtime_enabled_function']) and
attribute['is_data_type_property'] and
- attribute['should_be_exposed_to_script']]
+ attribute['should_be_exposed_to_script'])
def is_lazy_data_attribute(attribute):
return attribute['constructor_type'] and not attribute['needs_constructor_getter_callback']
-def filter_has_attribute_configuration(attributes):
- return [attribute for attribute in filter_has_data_attribute_configuration(attributes) if not is_lazy_data_attribute(attribute)]
+def filter_data_attributes(attributes):
+ return [attribute for attribute in attributes if is_data_attribute(attribute) and not is_lazy_data_attribute(attribute)]
-def filter_has_lazy_data_attribute_configuration(attributes):
- return [attribute for attribute in filter_has_data_attribute_configuration(attributes) if is_lazy_data_attribute(attribute)]
+def filter_lazy_data_attributes(attributes):
+ return [attribute for attribute in attributes if is_data_attribute(attribute) and is_lazy_data_attribute(attribute)]
def filter_origin_trial_enabled(attributes):
@@ -266,21 +265,13 @@ def filter_origin_trial_enabled(attributes):
not attribute['exposed_test']]
-def filter_purely_runtime_enabled(attributes):
+def filter_runtime_enabled(attributes):
return [attribute for attribute in attributes if
not (attribute['exposed_test'] or
attribute['secure_context_test']) and
attribute['runtime_feature_name']]
-def attribute_filters():
- return {'has_accessor_configuration': filter_has_accessor_configuration,
- 'has_attribute_configuration': filter_has_attribute_configuration,
- 'has_lazy_data_attribute_configuration': filter_has_lazy_data_attribute_configuration,
- 'origin_trial_enabled_attributes': filter_origin_trial_enabled,
- 'purely_runtime_enabled_attributes': filter_purely_runtime_enabled}
-
-
################################################################################
# Getter
################################################################################

Powered by Google App Engine
This is Rietveld 408576698