Commit 1e63ca39 authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

CodeGen: Make code_generator run on all IDL dictionaries

If you set |use_bind_gen_for_dictionary| true in your gn args,
the build target "generate_bindings_example" generates code for all IDL
dictionaries.


Bug: 839389
Change-Id: I9935e3a0a4339a3f4182dfd24d4ad9830e7b0144
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1971044
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726717}
parent 2893e252
...@@ -26,6 +26,7 @@ generate_origin_trial_features("bindings_core_origin_trial_features") { ...@@ -26,6 +26,7 @@ generate_origin_trial_features("bindings_core_origin_trial_features") {
group("bindings_core_v8_generated") { group("bindings_core_v8_generated") {
public_deps = [ public_deps = [
":bindings_core_impl_generated", ":bindings_core_impl_generated",
"//third_party/blink/renderer/bindings:generate_v8_bindings",
] ]
if (is_win && is_official_build) { if (is_win && is_official_build) {
public_deps += [ ":generate_bindings_core_v8_all_interfaces" ] public_deps += [ ":generate_bindings_core_v8_all_interfaces" ]
......
...@@ -18,6 +18,7 @@ group("bindings_modules_v8_generated") { ...@@ -18,6 +18,7 @@ group("bindings_modules_v8_generated") {
":generate_bindings_modules_v8_partial_interfaces", ":generate_bindings_modules_v8_partial_interfaces",
":generate_bindings_modules_v8_partial_interfaces_for_testing", ":generate_bindings_modules_v8_partial_interfaces_for_testing",
":generate_v8_context_snapshot_external_references", ":generate_v8_context_snapshot_external_references",
"//third_party/blink/renderer/bindings:generate_v8_bindings",
] ]
} }
......
...@@ -662,9 +662,8 @@ def generate_dictionary_cc_file(dictionary): ...@@ -662,9 +662,8 @@ def generate_dictionary_cc_file(dictionary):
enclose_with_namespace(code_node, name_style.namespace("blink")), enclose_with_namespace(code_node, name_style.namespace("blink")),
]) ])
filename = "example_dictionary.cc"
filepath = PathManager.gen_path_to( filepath = PathManager.gen_path_to(
PathManager(dictionary).dict_path(filename=filename)) PathManager(dictionary).dict_path(ext="cc"))
write_code_node_to_file(root_node, filepath) write_code_node_to_file(root_node, filepath)
...@@ -726,14 +725,12 @@ def generate_dictionary_h_file(dictionary): ...@@ -726,14 +725,12 @@ def generate_dictionary_h_file(dictionary):
header_guard_node, header_guard_node,
]) ])
filename = "example_dictionary.h"
filepath = PathManager.gen_path_to( filepath = PathManager.gen_path_to(
PathManager(dictionary).dict_path(filename=filename)) PathManager(dictionary).dict_path(ext="h"))
write_code_node_to_file(root_node, filepath) write_code_node_to_file(root_node, filepath)
def generate_dictionaries(web_idl_database): def generate_dictionaries(web_idl_database):
dictionary = web_idl_database.find("InternalDictionary") for dictionary in web_idl_database.dictionaries:
generate_dictionary_cc_file(dictionary)
generate_dictionary_cc_file(dictionary) generate_dictionary_h_file(dictionary)
generate_dictionary_h_file(dictionary)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment