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

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

Issue 2312093003: Generated bindings for IDL callback functions (Closed)
Patch Set: Addressed comments Created 4 years, 3 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/bindings/scripts/idl_compiler.py
diff --git a/third_party/WebKit/Source/bindings/scripts/idl_compiler.py b/third_party/WebKit/Source/bindings/scripts/idl_compiler.py
index baf268636e8e9cce89e0a81a73028748e9ac5148..5718b6af8ed5bcdb3b83de35e592b8c0760f850d 100755
--- a/third_party/WebKit/Source/bindings/scripts/idl_compiler.py
+++ b/third_party/WebKit/Source/bindings/scripts/idl_compiler.py
@@ -38,7 +38,7 @@ import os
import cPickle as pickle
import sys
-from code_generator_v8 import CodeGeneratorDictionaryImpl, CodeGeneratorV8, CodeGeneratorUnionType
+from code_generator_v8 import CodeGeneratorDictionaryImpl, CodeGeneratorV8, CodeGeneratorUnionType, CodeGeneratorCallbackFunction # pylint: disable=W0403
from idl_reader import IdlReader
from utilities import create_component_info_provider, read_idl_files_list_from_file, write_file, idl_filename_to_component
@@ -187,6 +187,19 @@ def generate_union_type_containers(options):
write_file(output_code, output_path, options.write_file_only_if_changed)
+def generate_callback_function_impl(options):
+ info_provider = create_component_info_provider(
+ options.info_dir, options.target_component)
+ generator = CodeGeneratorCallbackFunction(
+ info_provider,
+ options.cache_directory,
+ options.output_directory,
+ options.target_component)
+ output_code_list = generator.generate_code()
+ for output_path, output_code in output_code_list:
+ write_file(output_code, output_path, options.write_file_only_if_changed)
+
+
def main():
options, input_filename = parse_options()
if options.generate_impl:
@@ -194,6 +207,7 @@ def main():
# dictionary paths.
generate_dictionary_impl(options, input_filename)
generate_union_type_containers(options)
+ generate_callback_function_impl(options)
else:
# |input_filename| should be a path of an IDL file.
generate_bindings(options, input_filename)

Powered by Google App Engine
This is Rietveld 408576698