Commit fbddb8ed authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

GN: Define GN var to use new IDL compiler for dictionary

Also updates some BUILD.gn files to stop the current IDL compiler
generate code of dictionaries, if |use_idl_compiler_v2_for_dictionary|
is set true in gn.args.


Bug: 839389
Change-Id: I69bd10cf4e7f57cd1d9873c4b2202a917ed67ba5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1969318
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#725448}
parent b6c3d125
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
import("//third_party/blink/renderer/bindings/modules/v8/v8.gni") import("//third_party/blink/renderer/bindings/modules/v8/v8.gni")
declare_args() {
# If this variable is set true, we use a new code generator to generate code
# of IDL dictionaries. See https://crbug.com/839389 for the details.
use_v8_bind_gen_for_dictionary = false
}
bindings_core_v8_files = bindings_core_v8_files =
get_path_info([ get_path_info([
"core/v8/active_script_wrappable.cc", "core/v8/active_script_wrappable.cc",
......
...@@ -202,9 +202,13 @@ if (is_win && is_official_build) { ...@@ -202,9 +202,13 @@ if (is_win && is_official_build) {
bindings_core_generated_interface_files = bindings_core_generated_interface_files =
[ "$bindings_core_v8_output_dir/v8_generated_core_bindings.cc" ] [ "$bindings_core_v8_output_dir/v8_generated_core_bindings.cc" ]
} else { } else {
_core_definition_idl_files = core_definition_idl_files
if (use_v8_bind_gen_for_dictionary) {
_core_definition_idl_files -= core_dictionary_idl_files
}
bindings_core_generated_interface_files = bindings_core_generated_interface_files =
process_file_template( process_file_template(
core_definition_idl_files, _core_definition_idl_files,
[ [
"$bindings_core_v8_output_dir/v8_{{source_name_part}}.cc", "$bindings_core_v8_output_dir/v8_{{source_name_part}}.cc",
"$bindings_core_v8_output_dir/v8_{{source_name_part}}.h", "$bindings_core_v8_output_dir/v8_{{source_name_part}}.h",
...@@ -227,6 +231,9 @@ group("bindings_core_v8_generated") { ...@@ -227,6 +231,9 @@ group("bindings_core_v8_generated") {
idl_compiler("generate_bindings_core_v8_interfaces") { idl_compiler("generate_bindings_core_v8_interfaces") {
sources = core_definition_idl_files + core_testing_definition_idl_files + sources = core_definition_idl_files + core_testing_definition_idl_files +
generated_webcore_testing_idl_files generated_webcore_testing_idl_files
if (use_v8_bind_gen_for_dictionary) {
sources -= core_dictionary_idl_files
}
output_dir = bindings_core_v8_output_dir output_dir = bindings_core_v8_output_dir
output_name_suffix = "" output_name_suffix = ""
target_component = "core" target_component = "core"
...@@ -234,6 +241,9 @@ idl_compiler("generate_bindings_core_v8_interfaces") { ...@@ -234,6 +241,9 @@ idl_compiler("generate_bindings_core_v8_interfaces") {
aggregate_generated_bindings("generate_bindings_core_v8_all_interfaces") { aggregate_generated_bindings("generate_bindings_core_v8_all_interfaces") {
sources = core_definition_idl_files sources = core_definition_idl_files
if (use_v8_bind_gen_for_dictionary) {
sources -= core_dictionary_idl_files
}
outputs = [ outputs = [
"$bindings_core_v8_output_dir/v8_generated_core_bindings.cc", "$bindings_core_v8_output_dir/v8_generated_core_bindings.cc",
] ]
...@@ -244,7 +254,11 @@ aggregate_generated_bindings("generate_bindings_core_v8_all_interfaces") { ...@@ -244,7 +254,11 @@ aggregate_generated_bindings("generate_bindings_core_v8_all_interfaces") {
} }
idl_impl("bindings_core_impl_generated") { idl_impl("bindings_core_impl_generated") {
dict_idls = core_dictionary_idl_files + core_testing_dictionary_idl_files if (use_v8_bind_gen_for_dictionary) {
dict_idls = []
} else {
dict_idls = core_dictionary_idl_files + core_testing_dictionary_idl_files
}
non_dict_outputs = bindings_core_generated_union_type_files + non_dict_outputs = bindings_core_generated_union_type_files +
generated_core_testing_callback_function_files + generated_core_testing_callback_function_files +
generated_core_callback_function_files generated_core_callback_function_files
...@@ -267,8 +281,10 @@ generated_core_testing_dictionary_files = ...@@ -267,8 +281,10 @@ generated_core_testing_dictionary_files =
# Compile the non-test sources generated above. # Compile the non-test sources generated above.
blink_core_sources("bindings_core_impl") { blink_core_sources("bindings_core_impl") {
_non_testing_sources = get_target_outputs(":bindings_core_impl_generated") - _non_testing_sources = get_target_outputs(":bindings_core_impl_generated") -
generated_core_testing_dictionary_files -
generated_core_testing_callback_function_files generated_core_testing_callback_function_files
if (!use_v8_bind_gen_for_dictionary) {
_non_testing_sources -= generated_core_testing_dictionary_files
}
sources = _non_testing_sources + bindings_core_generated_interface_files + sources = _non_testing_sources + bindings_core_generated_interface_files +
get_target_outputs(":bindings_core_origin_trial_features") get_target_outputs(":bindings_core_origin_trial_features")
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//third_party/blink/renderer/bindings/bindings.gni")
import("//third_party/blink/renderer/bindings/modules/v8/generated.gni") import("//third_party/blink/renderer/bindings/modules/v8/generated.gni")
import("//third_party/blink/renderer/bindings/scripts/scripts.gni") import("//third_party/blink/renderer/bindings/scripts/scripts.gni")
import("//third_party/blink/renderer/modules/modules.gni") import("//third_party/blink/renderer/modules/modules.gni")
...@@ -22,13 +23,20 @@ group("bindings_modules_v8_generated") { ...@@ -22,13 +23,20 @@ group("bindings_modules_v8_generated") {
idl_compiler("generate_bindings_modules_v8_interfaces") { idl_compiler("generate_bindings_modules_v8_interfaces") {
sources = modules_definition_idl_files sources = modules_definition_idl_files
if (use_v8_bind_gen_for_dictionary) {
sources -= modules_dictionary_idl_files
}
output_dir = bindings_modules_v8_output_dir output_dir = bindings_modules_v8_output_dir
output_name_suffix = "" output_name_suffix = ""
target_component = "modules" target_component = "modules"
} }
idl_impl("bindings_modules_impl_generated") { idl_impl("bindings_modules_impl_generated") {
dict_idls = modules_dictionary_idl_files if (use_v8_bind_gen_for_dictionary) {
dict_idls = []
} else {
dict_idls = modules_dictionary_idl_files
}
non_dict_outputs = bindings_modules_generated_union_type_files + non_dict_outputs = bindings_modules_generated_union_type_files +
generated_modules_callback_function_files generated_modules_callback_function_files
non_dict_output_dir = bindings_modules_v8_output_dir non_dict_output_dir = bindings_modules_v8_output_dir
......
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