From 492fdf40fe59d6bd0fd2ff0074e8f59c6ec5120e Mon Sep 17 00:00:00 2001 From: Sam Zackrisson Date: Fri, 25 Oct 2019 10:45:58 +0200 Subject: [PATCH] Make rtc_json poisonous in WebRTC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This does not help the attached bugs, but it does allow greater control over what JSON code is running where. Long-term, the JSON library used for parsing configuration should likely be a library already present in Chromium builds, to avoid duplication. And if that happens, then WebRTC bug 9804 may be passé. Note that this CL also sorts our poisons alphabetically. Bug: chromium:895814, webrtc:9804 Change-Id: I70c3efe05a0eba9212895407f73978d8216df920 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158400 Reviewed-by: Karl Wiberg Commit-Queue: Sam Zackrisson Cr-Commit-Position: refs/heads/master@{#29615} --- BUILD.gn | 9 ++++++--- api/audio/BUILD.gn | 1 + rtc_base/BUILD.gn | 1 + webrtc.gni | 9 ++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index a0eda8f72e..5cef1303b2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -711,8 +711,11 @@ if (rtc_include_tests) { group("poison_audio_codecs") { } -group("poison_software_video_codecs") { -} - group("poison_default_task_queue") { } + +group("poison_rtc_json") { +} + +group("poison_software_video_codecs") { +} diff --git a/api/audio/BUILD.gn b/api/audio/BUILD.gn index bc6819050e..9ea145bc2c 100644 --- a/api/audio/BUILD.gn +++ b/api/audio/BUILD.gn @@ -52,6 +52,7 @@ rtc_library("aec3_config") { rtc_library("aec3_config_json") { visibility = [ "*" ] + allow_poison = [ "rtc_json" ] sources = [ "echo_canceller3_config_json.cc", "echo_canceller3_config_json.h", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index acd54b9839..0115429ae4 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -615,6 +615,7 @@ config("rtc_json_suppressions") { rtc_library("rtc_json") { public_configs = [ ":rtc_json_suppressions" ] + poisonous = [ "rtc_json" ] defines = [] sources = [ "strings/json.cc", diff --git a/webrtc.gni b/webrtc.gni index 603376435d..4e0f3641f2 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -366,11 +366,14 @@ all_poison_types = [ # Encoders and decoders for specific audio codecs such as Opus and iSAC. "audio_codecs", - # Software video codecs (VP8 and VP9 through libvpx). - "software_video_codecs", - # Default task queue implementation. "default_task_queue", + + # JSON parsing should not be needed in the "slim and modular" WebRTC. + "rtc_json", + + # Software video codecs (VP8 and VP9 through libvpx). + "software_video_codecs", ] absl_include_config = "//third_party/abseil-cpp:absl_include_config"