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

Unified Diff: Source/bindings/scripts/v8_interface.py

Issue 1329653003: [bindings] Club related constants for a runtime enabled flag in a single |if| block (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | Source/bindings/templates/constants.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 65e0f37d3529ac33cd432d3746e2d76415dd3a22..6c143aaf97f8cbe9c90949cccfa48682fca80980 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -254,15 +254,18 @@ def interface_context(interface):
constants = [constant_context(constant, interface) for constant in interface.constants]
special_getter_constants = []
- runtime_enabled_constants = []
+ runtime_enabled_constants = dict()
constant_configuration_constants = []
for constant in constants:
if constant['measure_as'] or constant['deprecate_as']:
special_getter_constants.append(constant)
continue
- if constant['runtime_enabled_function']:
- runtime_enabled_constants.append(constant)
+ runtime_enabled_function = constant['runtime_enabled_function']
+ if runtime_enabled_function:
+ if runtime_enabled_function not in runtime_enabled_constants:
+ runtime_enabled_constants[runtime_enabled_function] = []
+ runtime_enabled_constants[runtime_enabled_function].append(constant)
continue
constant_configuration_constants.append(constant)
@@ -274,7 +277,7 @@ def interface_context(interface):
'has_constant_configuration': any(
not constant['runtime_enabled_function']
for constant in constants),
- 'runtime_enabled_constants': runtime_enabled_constants,
+ 'runtime_enabled_constants': sorted(runtime_enabled_constants.iteritems()),
'special_getter_constants': special_getter_constants,
})
« no previous file with comments | « no previous file | Source/bindings/templates/constants.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698