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

Unified Diff: third_party/WebKit/Source/build/scripts/make_runtime_features.py

Issue 2656163005: Convert RuntimeEnabledFeatures.in config file to JSON format. (Closed)
Patch Set: Rebase and add MediaCaptureDepth, MojoJS Created 3 years, 10 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/build/scripts/make_runtime_features.py
diff --git a/third_party/WebKit/Source/build/scripts/make_runtime_features.py b/third_party/WebKit/Source/build/scripts/make_runtime_features.py
index 24515df18fb983030e4c22d0e537767cb1684e66..9f647fb1e21244b2fcbe1623d801014428b2cba8 100755
--- a/third_party/WebKit/Source/build/scripts/make_runtime_features.py
+++ b/third_party/WebKit/Source/build/scripts/make_runtime_features.py
@@ -29,38 +29,22 @@
import sys
-import in_generator
+import json5_generator
import name_utilities
from name_utilities import lower_first
import template_expander
-class RuntimeFeatureWriter(in_generator.Writer):
+class RuntimeFeatureWriter(json5_generator.Writer):
class_name = 'RuntimeEnabledFeatures'
- # FIXME: valid_values and defaults should probably roll into one object.
- valid_values = {
- 'status': ['stable', 'experimental', 'test'],
- }
- defaults = {
- 'condition': None,
- 'custom': False,
- 'depends_on': [],
- 'feature_policy': None,
- 'implied_by': [],
- 'origin_trial_feature_name': None,
- 'origin_trial_os': [],
- 'settable_from_internals': False,
- 'status': None,
- }
-
- def __init__(self, in_file_path):
- super(RuntimeFeatureWriter, self).__init__(in_file_path)
+ def __init__(self, json5_file_path):
+ super(RuntimeFeatureWriter, self).__init__(json5_file_path)
self._outputs = {(self.class_name + '.h'): self.generate_header,
(self.class_name + '.cpp'): self.generate_implementation,
}
- self._features = self.in_file.name_dictionaries
+ self._features = self.json5_file.name_dictionaries
# Make sure the resulting dictionaries have all the keys we expect.
for feature in self._features:
feature['first_lowered_name'] = lower_first(feature['name'])
@@ -78,7 +62,7 @@ class RuntimeFeatureWriter(in_generator.Writer):
def _feature_sets(self):
# Another way to think of the status levels is as "sets of features"
# which is how we're referring to them in this generator.
- return list(self.valid_values['status'])
+ return self.json5_file.parameters['status']['valid_values']
def _template_inputs(self):
return {
@@ -97,4 +81,4 @@ class RuntimeFeatureWriter(in_generator.Writer):
if __name__ == '__main__':
- in_generator.Maker(RuntimeFeatureWriter).main(sys.argv)
+ json5_generator.Maker(RuntimeFeatureWriter).main()
« no previous file with comments | « third_party/WebKit/Source/build/scripts/make_origin_trials.py ('k') | third_party/WebKit/Source/build/scripts/scripts.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698