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

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

Issue 298893006: Split modules-dependent Event code in core. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/bindings/core_bindings_generated.gyp ('k') | Source/bindings/v8/custom/V8EventCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/generate_event_interfaces.py
diff --git a/Source/bindings/scripts/generate_event_interfaces.py b/Source/bindings/scripts/generate_event_interfaces.py
index 036e2c0890be4901635afc5ebfcd6fae0b279f57..92abe426b11e9bd541a77e74c89cafea8ec38d27 100755
--- a/Source/bindings/scripts/generate_event_interfaces.py
+++ b/Source/bindings/scripts/generate_event_interfaces.py
@@ -61,6 +61,7 @@ def parse_options():
parser.add_option('--event-idl-files-list', help='file listing event IDL files')
parser.add_option('--event-interfaces-file', help='output file')
parser.add_option('--write-file-only-if-changed', type='int', help='if true, do not write an output file if it would be identical to the existing one, which avoids unnecessary rebuilds in ninja')
+ parser.add_option('--suffix', help='specify a suffix to the namespace, i.e., "Modules". Default is None.')
options, args = parser.parse_args()
if options.event_idl_files_list is None:
@@ -75,7 +76,7 @@ def parse_options():
return options
-def write_event_interfaces_file(event_idl_files, destination_filename, only_if_changed):
+def write_event_interfaces_file(event_idl_files, destination_filename, only_if_changed, suffix):
def extended_attribute_string(name, value):
if name == 'RuntimeEnabled':
value += 'Enabled'
@@ -95,8 +96,10 @@ def write_event_interfaces_file(event_idl_files, destination_filename, only_if_c
return '%s %s\n' % (relative_path_posix,
', '.join(extended_attributes_list))
- lines = ['namespace="Event"\n',
- '\n']
+ lines = ['namespace="Event"\n']
+ if suffix:
+ lines.append('suffix="' + suffix + '"\n')
+ lines.append('\n')
interface_lines = [interface_line(event_idl_file)
for event_idl_file in event_idl_files]
interface_lines.sort()
@@ -112,7 +115,8 @@ def main():
event_idl_files = [line.rstrip('\n') for line in event_idl_files_list]
write_event_interfaces_file(event_idl_files,
options.event_interfaces_file,
- options.write_file_only_if_changed)
+ options.write_file_only_if_changed,
+ options.suffix)
if __name__ == '__main__':
« no previous file with comments | « Source/bindings/core_bindings_generated.gyp ('k') | Source/bindings/v8/custom/V8EventCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698