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

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

Issue 2000483002: Clean up V8 bindings template code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 9bffba91adbd7ed8b603dc6046571bb53d4aa6dd..315a07da574a9311247b1fdf18b2b94e6f9f075c 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -155,6 +155,7 @@ def attribute_context(interface, attribute):
'reflect_missing': extended_attributes.get('ReflectMissing'),
'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly'),
'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(attribute), # [RuntimeEnabled]
+ 'runtime_feature_name': v8_utilities.runtime_feature_name(attribute), # [RuntimeEnabled]
'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
'world_suffixes': (
['', 'ForMainWorld']
@@ -172,6 +173,35 @@ def attribute_context(interface, attribute):
return context
+def filter_has_accessor_configuration(attributes):
+ return [attribute for attribute in attributes if
+ not (attribute['exposed_test'] or
+ attribute['runtime_enabled_function']) and
+ not attribute['is_data_type_property'] and
+ attribute['should_be_exposed_to_script']]
+
+
+def filter_has_attribute_configuration(attributes):
+ return [attribute for attribute in attributes if
+ not (attribute['exposed_test'] or
+ attribute['runtime_enabled_function']) and
+ attribute['is_data_type_property'] and
+ attribute['should_be_exposed_to_script']]
+
+
+def filter_runtime_enabled(attributes):
+ return [attribute for attribute in attributes if
+ attribute['runtime_feature_name'] and
+ not attribute['exposed_test']]
+
+
+def attribute_filters():
+ return {'has_accessor_configuration': filter_has_accessor_configuration,
+ 'has_attribute_configuration': filter_has_attribute_configuration,
+ 'runtime_enabled_attributes': filter_runtime_enabled,
+ }
+
+
################################################################################
# Getter
################################################################################

Powered by Google App Engine
This is Rietveld 408576698