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

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

Issue 429853002: IDL: Add build target for IDL dictionary impl generation in core (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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: Source/bindings/scripts/idl_compiler.py
diff --git a/Source/bindings/scripts/idl_compiler.py b/Source/bindings/scripts/idl_compiler.py
index c74aae7a002777349c65c6c18c68f1ae8c266ba8..5ed382cb9648522cd5547b4e8ad278502540f684 100755
--- a/Source/bindings/scripts/idl_compiler.py
+++ b/Source/bindings/scripts/idl_compiler.py
@@ -38,7 +38,7 @@ import os
import cPickle as pickle
import sys
-from code_generator_v8 import CodeGeneratorV8
+from code_generator_v8 import CodeGeneratorV8, MODE_BINDINGS, MODE_DICTIONARY_IMPL
from idl_reader import IdlReader
from utilities import write_file
@@ -47,6 +47,8 @@ def parse_options():
parser = OptionParser()
parser.add_option('--cache-directory',
help='cache directory, defaults to output directory')
+ parser.add_option('--generate-dictionary-impl',
+ action="store_true", default=False)
parser.add_option('--output-directory')
parser.add_option('--interfaces-info-file')
parser.add_option('--write-file-only-if-changed', type='int')
@@ -81,7 +83,8 @@ class IdlCompiler(object):
def __init__(self, output_directory, cache_directory='',
code_generator=None, interfaces_info=None,
- interfaces_info_filename='', only_if_changed=False):
+ interfaces_info_filename='', only_if_changed=False,
+ generate_dictionary_impl=False):
"""
Args:
interfaces_info:
@@ -92,6 +95,10 @@ class IdlCompiler(object):
cache_directory = cache_directory or output_directory
self.cache_directory = cache_directory
self.code_generator = code_generator
+ if generate_dictionary_impl:
+ self.generating_mode = MODE_DICTIONARY_IMPL
+ else:
+ self.generating_mode = MODE_BINDINGS
if interfaces_info_filename:
with open(interfaces_info_filename) as interfaces_info_file:
interfaces_info = pickle.load(interfaces_info_file)
@@ -104,7 +111,7 @@ class IdlCompiler(object):
interface_name = idl_filename_to_interface_name(idl_filename)
definitions = self.reader.read_idl_definitions(idl_filename)
output_code_list = self.code_generator.generate_code(
- definitions, interface_name)
+ definitions, interface_name, mode=self.generating_mode)
for output_path, output_code in output_code_list:
write_file(output_code, output_path, self.only_if_changed)
@@ -130,7 +137,8 @@ def main():
options.output_directory,
cache_directory=options.cache_directory,
interfaces_info_filename=options.interfaces_info_file,
- only_if_changed=options.write_file_only_if_changed)
+ only_if_changed=options.write_file_only_if_changed,
+ generate_dictionary_impl=options.generate_dictionary_impl)
idl_compiler.compile_file(idl_filename)

Powered by Google App Engine
This is Rietveld 408576698