Add Chromium default values for rtc_exclude_field_trial_default.
In theory Chromium defaults should be defined here: [1]. But a comment warns
that is_nacl (and similar) are not available when that file is processed
and that this kind of logic should be implemented in the "other" repo (in
WebRTC in this case).
This CL reimplements the same logic of //third_party/webrtc_overrides/BUILD.gn,
and it exclude the default field trial implementation in Chromium unless
is_nacl or is_chromecast are true [2].
[1] - https://cs.chromium.org/chromium/src/.gn?l=25-30&rcl=8f5ee77915e339939c43b39b01e73379cbbe43d8
[2] - https://cs.chromium.org/chromium/src/third_party/webrtc_overrides/BUILD.gn?l=63-89&rcl=8f5ee77915e339939c43b39b01e73379cbbe43d8
Bug: webrtc:9631
Change-Id: I15c365cd19b7358e7a0fee199957a27a6315b9dc
Reviewed-on: https://webrtc-review.googlesource.com/95422
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24381}
diff --git a/webrtc.gni b/webrtc.gni
index 4b1f028..ec3c447 100644
--- a/webrtc.gni
+++ b/webrtc.gni
@@ -33,11 +33,18 @@
declare_args() {
# WARNING: This argument doesn't have any effect on the WebRTC build until
# https://webrtc-review.googlesource.com/c/src/+/94766 will land.
- # Setting this to false will define WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT which
+ # Setting this to true will define WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT which
# will tell the pre-processor to remove the default definition of symbols
# needed to use field_trial. In that case a new implementation needs to be
# provided.
- rtc_exclude_field_trial_default = true
+ if (build_with_chromium) {
+ # When WebRTC is built as part of Chromium it should exclude the default
+ # implementation of field_trial unless it is building for NACL or
+ # Chromecast.
+ rtc_exclude_field_trial_default = !is_nacl && !is_chromecast
+ } else {
+ rtc_exclude_field_trial_default = false
+ }
# Setting this to false will require the API user to pass in their own
# SSLCertificateVerifier to verify the certificates presented from a