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

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

Issue 2638233002: Convert make_names and make_event_factory to use json5 config format. (Closed)
Patch Set: fix PLATFORM_EXPORT Created 3 years, 11 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_event_factory.py
diff --git a/third_party/WebKit/Source/build/scripts/make_event_factory.py b/third_party/WebKit/Source/build/scripts/make_event_factory.py
index c197c8165a10beb9f95e63daefdb52e3f31fb616..c6688f8790e1d8925e3313fc1ee521d4a7001955 100755
--- a/third_party/WebKit/Source/build/scripts/make_event_factory.py
+++ b/third_party/WebKit/Source/build/scripts/make_event_factory.py
@@ -30,7 +30,7 @@
import os.path
import sys
-import in_generator
+import json5_generator
import license
import name_utilities
import template_expander
@@ -102,12 +102,12 @@ def measure_name(name):
return 'DocumentCreateEvent' + name
-class EventFactoryWriter(in_generator.Writer):
- defaults = {
+class EventFactoryWriter(json5_generator.Writer):
+ default_parameters = {
'ImplementedAs': None,
'RuntimeEnabled': None,
}
- default_parameters = {
+ default_metadata = {
'export': '',
'namespace': '',
'suffix': '',
@@ -121,10 +121,10 @@ class EventFactoryWriter(in_generator.Writer):
'measure_name': measure_name,
}
- def __init__(self, in_file_path):
- super(EventFactoryWriter, self).__init__(in_file_path)
- self.namespace = self.in_file.parameters['namespace'].strip('"')
- self.suffix = self.in_file.parameters['suffix'].strip('"')
+ def __init__(self, json5_file_path):
+ super(EventFactoryWriter, self).__init__(json5_file_path)
+ self.namespace = self.json5_file.metadata['namespace'].strip('"')
+ self.suffix = self.json5_file.metadata['suffix'].strip('"')
self._outputs = {(self.namespace + self.suffix + "Headers.h"): self.generate_headers_header,
(self.namespace + self.suffix + ".cpp"): self.generate_implementation,
}
@@ -170,7 +170,7 @@ class EventFactoryWriter(in_generator.Writer):
'namespace': self.namespace,
'suffix': self.suffix,
'base_header_for_suffix': base_header_for_suffix,
- 'includes': '\n'.join(self._headers_header_includes(self.in_file.name_dictionaries)),
+ 'includes': '\n'.join(self._headers_header_includes(self.json5_file.name_dictionaries)),
}
@template_expander.use_jinja('EventFactory.cpp.tmpl', filters=filters)
@@ -178,9 +178,9 @@ class EventFactoryWriter(in_generator.Writer):
return {
'namespace': self.namespace,
'suffix': self.suffix,
- 'events': self.in_file.name_dictionaries,
+ 'events': self.json5_file.name_dictionaries,
}
if __name__ == "__main__":
- in_generator.Maker(EventFactoryWriter).main(sys.argv)
+ json5_generator.Maker(EventFactoryWriter).main()

Powered by Google App Engine
This is Rietveld 408576698