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

Unified Diff: Source/build/scripts/make_media_features.py

Issue 185533012: Auto generate MediaFeatureNames, its macros and MediaTypeNames (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed comment from RuntimeEnabled Created 6 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
« no previous file with comments | « Source/build/scripts/make_media_feature_names.py ('k') | Source/build/scripts/media_feature_symbol.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/make_media_features.py
diff --git a/Source/build/scripts/make_media_features.py b/Source/build/scripts/make_media_features.py
new file mode 100755
index 0000000000000000000000000000000000000000..f3f4ae2f4f279e54d39e15ef90cd742abb453db7
--- /dev/null
+++ b/Source/build/scripts/make_media_features.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import media_feature_symbol
+import in_generator
+import template_expander
+import name_utilities
+import sys
+
+
+class MakeMediaFeaturesWriter(in_generator.Writer):
+ defaults = {
+ 'Conditional': None, # FIXME: Add support for Conditional.
+ 'RuntimeEnabled': None,
+ 'ImplementedAs': None,
+ }
+ filters = {
+ 'symbol': media_feature_symbol.getMediaFeatureSymbolWithSuffix(''),
+ 'to_macro_style': name_utilities.to_macro_style,
+ }
+ default_parameters = {
+ 'namespace': '',
+ 'export': '',
+ }
+
+ def __init__(self, in_file_path):
+ super(MakeMediaFeaturesWriter, self).__init__(in_file_path)
+
+ self._outputs = {
+ ('MediaFeatures.h'): self.generate_header,
+ }
+ self._template_context = {
+ 'namespace': '',
+ 'export': '',
+ 'entries': self.in_file.name_dictionaries,
+ }
+
+ @template_expander.use_jinja("MediaFeatures.h.tmpl", filters=filters)
+ def generate_header(self):
+ return self._template_context
+
+if __name__ == "__main__":
+ in_generator.Maker(MakeMediaFeaturesWriter).main(sys.argv)
« no previous file with comments | « Source/build/scripts/make_media_feature_names.py ('k') | Source/build/scripts/media_feature_symbol.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698