commit 7adc7970a3ee45771799935ccb907b09ff091f90
parent 463085f5019080a08eac1a27209d6b12ecc7cfb2
Author: Michael Froman <mfroman@mozilla.com>
Date: Wed, 8 Oct 2025 17:29:22 -0500
Bug 1993083 - Vendor libwebrtc from 611ac4e13f
Upstream commit: https://webrtc.googlesource.com/src/+/611ac4e13f28431384fc478de8e0f1b9cd6e7100
Deprecate FieldTrials::CreateNoGlobal
FieldTrials are always no global now, there is no longer need to stress
that in the factory name.
Depending on the context, this function can be replace either with
std::make_unique<FieldTrials>, FieldTrials::Create, or, in WebRTC
unittests with CreateTestFieldTrials
Bug: webrtc:419453427
Change-Id: I1bcdbb699f46a9d259ece5800eec37882fa3a936
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/398440
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45045}
Diffstat:
11 files changed, 48 insertions(+), 50 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor
@@ -1,4 +1,4 @@
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
-libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T22:28:09.782321+00:00.
+libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T22:29:12.720215+00:00.
# base of lastest vendoring
-e7b2586e3b
+611ac4e13f
diff --git a/third_party/libwebrtc/api/field_trials.h b/third_party/libwebrtc/api/field_trials.h
@@ -70,8 +70,8 @@ class FieldTrials : public FieldTrialsRegistry {
// Setting empty `group` is valid and removes the `trial`.
void Set(absl::string_view trial, absl::string_view group);
- // TODO: bugs.webrtc.org/42220378 - Deprecate and inline once no longer used
- // within webrtc.
+ // TODO: bugs.webrtc.org/42220378 - Delete after August 1, 2025.
+ [[deprecated]]
static std::unique_ptr<FieldTrials> CreateNoGlobal(absl::string_view s) {
return std::make_unique<FieldTrials>(s);
}
diff --git a/third_party/libwebrtc/api/voip/BUILD.gn b/third_party/libwebrtc/api/voip/BUILD.gn
@@ -72,6 +72,7 @@ if (rtc_include_tests) {
"../../modules/audio_device:mock_audio_device",
"../../modules/audio_processing:mocks",
"../../test:audio_codec_mocks",
+ "../../test:create_test_field_trials",
"../../test:test_support",
"../environment:environment_factory",
]
diff --git a/third_party/libwebrtc/api/voip/test/voip_engine_factory_unittest.cc b/third_party/libwebrtc/api/voip/test/voip_engine_factory_unittest.cc
@@ -14,10 +14,10 @@
#include <utility>
#include "api/environment/environment_factory.h"
-#include "api/field_trials.h"
#include "api/make_ref_counted.h"
#include "modules/audio_device/include/mock_audio_device.h"
#include "modules/audio_processing/include/mock_audio_processing.h"
+#include "test/create_test_field_trials.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_audio_decoder_factory.h"
@@ -33,7 +33,7 @@ TEST(VoipEngineFactoryTest, CreateEngineWithMockModules) {
VoipEngineConfig config;
config.encoder_factory = make_ref_counted<MockAudioEncoderFactory>();
config.decoder_factory = make_ref_counted<MockAudioDecoderFactory>();
- config.env = CreateEnvironment(FieldTrials::CreateNoGlobal(""));
+ config.env = CreateEnvironment(CreateTestFieldTrialsPtr());
config.audio_processing_builder =
std::make_unique<NiceMock<test::MockAudioProcessingBuilder>>();
config.audio_device_module = test::MockAudioDeviceModule::CreateNice();
diff --git a/third_party/libwebrtc/modules/audio_processing/agc/BUILD.gn b/third_party/libwebrtc/modules/audio_processing/agc/BUILD.gn
@@ -119,6 +119,7 @@ if (rtc_include_tests) {
"../../../rtc_base:safe_minmax",
"../../../rtc_base:stringutils",
"../../../system_wrappers:metrics",
+ "../../../test:create_test_field_trials",
"../../../test:fileutils",
"../../../test:test_support",
"//testing/gtest",
diff --git a/third_party/libwebrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc b/third_party/libwebrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc
@@ -26,7 +26,6 @@
#include "api/audio/audio_processing.h"
#include "api/environment/environment.h"
#include "api/environment/environment_factory.h"
-#include "api/field_trials.h"
#include "modules/audio_processing/agc/agc.h"
#include "modules/audio_processing/agc/gain_control.h"
#include "modules/audio_processing/agc/mock_agc.h"
@@ -34,6 +33,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_minmax.h"
#include "rtc_base/strings/string_builder.h"
+#include "test/create_test_field_trials.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/testsupport/file_utils.h"
@@ -105,8 +105,7 @@ struct AgcManagerDirectTestParams {
std::unique_ptr<AgcManagerDirect> CreateAgcManagerDirect(
AgcManagerDirectTestParams p = {}) {
auto manager = std::make_unique<AgcManagerDirect>(
- CreateEnvironment(FieldTrials::CreateNoGlobal(p.field_trials)),
- kNumChannels,
+ CreateEnvironment(CreateTestFieldTrialsPtr(p.field_trials)), kNumChannels,
AnalogAgcConfig{.startup_min_volume = kInitialInputVolume,
.clipped_level_min = p.clipped_level_min,
.enable_digital_adaptive = p.enable_digital_adaptive,
@@ -459,7 +458,7 @@ class AgcManagerDirectParametrizedTest
: public ::testing::TestWithParam<std::tuple<std::optional<int>, bool>> {
protected:
AgcManagerDirectParametrizedTest()
- : env_(CreateEnvironment(FieldTrials::CreateNoGlobal(
+ : env_(CreateEnvironment(CreateTestFieldTrialsPtr(
GetAgcMinMicLevelExperimentFieldTrial(std::get<0>(GetParam()))))) {}
bool IsMinMicLevelOverridden() const {
diff --git a/third_party/libwebrtc/moz-patch-stack/s0034.patch b/third_party/libwebrtc/moz-patch-stack/s0034.patch
@@ -224,7 +224,7 @@ index a945d0c58d..f01637f2da 100644
} else {
sources += [ "aecm_core_c.cc" ]
diff --git a/modules/audio_processing/agc/BUILD.gn b/modules/audio_processing/agc/BUILD.gn
-index f0824fea75..de7a61b909 100644
+index 090fbd4604..45d08ad066 100644
--- a/modules/audio_processing/agc/BUILD.gn
+++ b/modules/audio_processing/agc/BUILD.gn
@@ -84,7 +84,7 @@ rtc_library("legacy_agc") {
diff --git a/third_party/libwebrtc/moz-patch-stack/s0103.patch b/third_party/libwebrtc/moz-patch-stack/s0103.patch
@@ -481,7 +481,7 @@ index f01637f2da..d5bdc070be 100644
}
}
diff --git a/modules/audio_processing/agc/BUILD.gn b/modules/audio_processing/agc/BUILD.gn
-index de7a61b909..795649ccd9 100644
+index 45d08ad066..2d6f3ca0b4 100644
--- a/modules/audio_processing/agc/BUILD.gn
+++ b/modules/audio_processing/agc/BUILD.gn
@@ -86,7 +86,7 @@ rtc_library("legacy_agc") {
diff --git a/third_party/libwebrtc/p2p/base/p2p_transport_channel_unittest.cc b/third_party/libwebrtc/p2p/base/p2p_transport_channel_unittest.cc
@@ -96,6 +96,7 @@
#include "rtc_base/time_utils.h"
#include "rtc_base/virtual_socket_server.h"
#include "system_wrappers/include/metrics.h"
+#include "test/create_test_field_trials.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/wait_until.h"
@@ -1304,7 +1305,7 @@ const P2PTransportChannelMatrixTest::Result*
#define P2P_TEST_DECLARATION(x, y, z) \
TEST_P(P2PTransportChannelMatrixTest, z##Test##x##To##y) { \
const Environment env = \
- CreateEnvironment(FieldTrials::CreateNoGlobal(GetParam())); \
+ CreateEnvironment(CreateTestFieldTrialsPtr(GetParam())); \
ConfigureEndpoints(env, x, y, PORTALLOCATOR_ENABLE_SHARED_SOCKET, \
PORTALLOCATOR_ENABLE_SHARED_SOCKET); \
if (kMatrix[x][y] != NULL) \
@@ -2568,7 +2569,7 @@ TEST_F(P2PTransportChannelTest,
TEST_F(P2PTransportChannelTest,
CanConnectWithPiggybackCheckAcknowledgementWhenCheckResponseBlocked) {
ScopedFakeClock clock;
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-PiggybackIceCheckAcknowledgement/Enabled/"));
ConfigureEndpoints(env, OPEN, OPEN, kOnlyLocalPorts, kOnlyLocalPorts);
IceConfig ep1_config;
@@ -4617,7 +4618,7 @@ TEST_F(P2PTransportChannelPingTest, TestSelectConnectionBeforeNomination) {
// that sends a ping directly when a connection has been nominated
// i.e on the ICE_CONTROLLED-side.
TEST_F(P2PTransportChannelPingTest, TestPingOnNomination) {
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/send_ping_on_nomination_ice_controlled:true/"));
FakePortAllocator pa(env, ss());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
@@ -4663,7 +4664,7 @@ TEST_F(P2PTransportChannelPingTest, TestPingOnNomination) {
// that sends a ping directly when switching to a new connection
// on the ICE_CONTROLLING-side.
TEST_F(P2PTransportChannelPingTest, TestPingOnSwitch) {
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/send_ping_on_switch_ice_controlling:true/"));
FakePortAllocator pa(env, ss());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
@@ -4706,7 +4707,7 @@ TEST_F(P2PTransportChannelPingTest, TestPingOnSwitch) {
// that sends a ping directly when selecteing a new connection
// on the ICE_CONTROLLING-side (i.e also initial selection).
TEST_F(P2PTransportChannelPingTest, TestPingOnSelected) {
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/send_ping_on_selected_ice_controlling:true/"));
FakePortAllocator pa(env, ss());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
@@ -5570,7 +5571,7 @@ TEST_F(P2PTransportChannelPingTest, TestPortDestroyedAfterTimeoutAndPruned) {
}
TEST_F(P2PTransportChannelPingTest, TestMaxOutstandingPingsFieldTrial) {
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/max_outstanding_pings:3/"));
FakePortAllocator pa(env, ss());
P2PTransportChannel ch("max", 1, &pa, &env.field_trials());
@@ -5831,7 +5832,7 @@ TEST_F(P2PTransportChannelMostLikelyToWorkFirstTest,
// I.e that we never create connection between relay and non-relay.
TEST_F(P2PTransportChannelMostLikelyToWorkFirstTest,
TestSkipRelayToNonRelayConnectionsFieldTrial) {
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/skip_relay_to_non_relay_connections:true/"));
CreatePortAllocator(env);
P2PTransportChannel& ch = StartTransportChannel(env, true, 500);
@@ -6818,7 +6819,7 @@ TEST_F(P2PTransportChannelTest,
// coordination outside of webrtc to function properly.
TEST_F(P2PTransportChannelTest, SurfaceRequiresCoordination) {
ScopedFakeClock clock;
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/skip_relay_to_non_relay_connections:true/"));
ConfigureEndpoints(
@@ -6898,7 +6899,7 @@ TEST_F(P2PTransportChannelPingTest, TestInitialSelectDampening0) {
constexpr int kMargin = 10;
ScopedFakeClock clock;
clock.AdvanceTime(TimeDelta::Seconds(1));
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/initial_select_dampening:0/"));
FakePortAllocator pa(env, ss());
@@ -6925,7 +6926,7 @@ TEST_F(P2PTransportChannelPingTest, TestInitialSelectDampening) {
constexpr int kMargin = 10;
ScopedFakeClock clock;
clock.AdvanceTime(TimeDelta::Seconds(1));
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/initial_select_dampening:100/"));
FakePortAllocator pa(env, ss());
@@ -6952,7 +6953,7 @@ TEST_F(P2PTransportChannelPingTest, TestInitialSelectDampeningPingReceived) {
constexpr int kMargin = 10;
ScopedFakeClock clock;
clock.AdvanceTime(TimeDelta::Seconds(1));
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/initial_select_dampening_ping_received:100/"));
FakePortAllocator pa(env, ss());
@@ -6980,7 +6981,7 @@ TEST_F(P2PTransportChannelPingTest, TestInitialSelectDampeningBoth) {
constexpr int kMargin = 10;
ScopedFakeClock clock;
clock.AdvanceTime(TimeDelta::Seconds(1));
- const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
+ const Environment env = CreateEnvironment(CreateTestFieldTrialsPtr(
"WebRTC-IceFieldTrials/"
"initial_select_dampening:100,initial_select_dampening_ping_received:"
"50/"));
@@ -7339,7 +7340,7 @@ TEST_P(GatherAfterConnectedTest, GatherAfterConnected) {
ScopedFakeClock clock;
const Environment env =
- CreateEnvironment(FieldTrials::CreateNoGlobal(field_trial));
+ CreateEnvironment(CreateTestFieldTrialsPtr(field_trial));
// Use local + relay
constexpr uint32_t flags =
kDefaultPortAllocatorFlags | PORTALLOCATOR_ENABLE_SHARED_SOCKET |
@@ -7419,7 +7420,7 @@ TEST_P(GatherAfterConnectedTest, GatherAfterConnectedMultiHomed) {
ScopedFakeClock clock;
const Environment env =
- CreateEnvironment(FieldTrials::CreateNoGlobal(field_trial));
+ CreateEnvironment(CreateTestFieldTrialsPtr(field_trial));
// Use local + relay
constexpr uint32_t flags =
diff --git a/third_party/libwebrtc/p2p/dtls/dtls_ice_integrationtest.cc b/third_party/libwebrtc/p2p/dtls/dtls_ice_integrationtest.cc
@@ -48,6 +48,7 @@
#include "rtc_base/third_party/sigslot/sigslot.h"
#include "rtc_base/thread.h"
#include "rtc_base/virtual_socket_server.h"
+#include "test/create_test_field_trials.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/wait_until.h"
@@ -81,7 +82,7 @@ class DtlsIceIntegrationTest : public ::testing::TestWithParam<std::tuple<
private:
struct Endpoint {
explicit Endpoint(bool dtls_in_stun, bool pqc_)
- : env(CreateEnvironment(FieldTrials::CreateNoGlobal(
+ : env(CreateEnvironment(CreateTestFieldTrialsPtr(
dtls_in_stun ? "WebRTC-IceHandshakeDtls/Enabled/" : ""))),
dtls_stun_piggyback(dtls_in_stun),
pqc(pqc_) {}
diff --git a/third_party/libwebrtc/pc/sdp_munging_detector_unittest.cc b/third_party/libwebrtc/pc/sdp_munging_detector_unittest.cc
@@ -27,7 +27,6 @@
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/create_peerconnection_factory.h"
-#include "api/field_trials.h"
#include "api/jsep.h"
#include "api/media_types.h"
#include "api/peer_connection_interface.h"
@@ -208,67 +207,63 @@ TEST_F(SdpMungingTest, DISABLED_ReportUMAMetricsWithNoMunging) {
TEST_F(SdpMungingTest, AllowWithDenyListForRollout) {
// Don't munge and you are good.
EXPECT_TRUE(IsSdpMungingAllowed(SdpMungingType::kNoModification,
- *FieldTrials::CreateNoGlobal("")));
+ CreateTestFieldTrials()));
// Empty string (default) means everything is allowed from the perspective of
// the trial.
EXPECT_TRUE(IsSdpMungingAllowed(SdpMungingType::kUnknownModification,
- *FieldTrials::CreateNoGlobal("")));
+ CreateTestFieldTrials()));
// Deny list is set, modification on deny list is rejected.
EXPECT_FALSE(IsSdpMungingAllowed(
SdpMungingType::kUnknownModification /*=1*/,
- *FieldTrials::CreateNoGlobal("WebRTC-NoSdpMangleReject/Enabled,1/")));
+ CreateTestFieldTrials("WebRTC-NoSdpMangleReject/Enabled,1/")));
// Deny list is set, modification not on deny list is allowed.
EXPECT_TRUE(IsSdpMungingAllowed(
SdpMungingType::kWithoutCreateAnswer /*=2*/,
- *FieldTrials::CreateNoGlobal("WebRTC-NoSdpMangleReject/Enabled,1/")));
+ CreateTestFieldTrials("WebRTC-NoSdpMangleReject/Enabled,1/")));
// Split by comma.
EXPECT_FALSE(IsSdpMungingAllowed(
SdpMungingType::kUnknownModification /*=1*/,
- *FieldTrials::CreateNoGlobal("WebRTC-NoSdpMangleReject/Enabled,1,2/")));
+ CreateTestFieldTrials("WebRTC-NoSdpMangleReject/Enabled,1,2/")));
EXPECT_FALSE(IsSdpMungingAllowed(
SdpMungingType::kWithoutCreateAnswer /*=2*/,
- *FieldTrials::CreateNoGlobal("WebRTC-NoSdpMangleReject/Enabled,1,2/")));
+ CreateTestFieldTrials("WebRTC-NoSdpMangleReject/Enabled,1,2/")));
EXPECT_TRUE(IsSdpMungingAllowed(
SdpMungingType::kWithoutCreateOffer /*=3*/,
- *FieldTrials::CreateNoGlobal("WebRTC-NoSdpMangleReject/Enabled,1,2,4/")));
+ CreateTestFieldTrials("WebRTC-NoSdpMangleReject/Enabled,1,2,4/")));
}
TEST_F(SdpMungingTest, DenyWithAllowListForTesting) {
// Don't munge and you are good.
EXPECT_TRUE(IsSdpMungingAllowed(SdpMungingType::kNoModification,
- *FieldTrials::CreateNoGlobal("")));
+ CreateTestFieldTrials()));
// Empty string (default) means everything is allowed from the perspective of
// the trial.
EXPECT_TRUE(IsSdpMungingAllowed(SdpMungingType::kUnknownModification,
- *FieldTrials::CreateNoGlobal("")));
+ CreateTestFieldTrials()));
// Allow-list is set, modification is on allow list.
- EXPECT_TRUE(
- IsSdpMungingAllowed(SdpMungingType::kUnknownModification /*=1*/,
- *FieldTrials::CreateNoGlobal(
- "WebRTC-NoSdpMangleAllowForTesting/Enabled,1/")));
+ EXPECT_TRUE(IsSdpMungingAllowed(
+ SdpMungingType::kUnknownModification /*=1*/,
+ CreateTestFieldTrials("WebRTC-NoSdpMangleAllowForTesting/Enabled,1/")));
// Allow-list is set, modification is not on allow list.
- EXPECT_FALSE(
- IsSdpMungingAllowed(SdpMungingType::kWithoutCreateAnswer /*=2*/,
- *FieldTrials::CreateNoGlobal(
- "WebRTC-NoSdpMangleAllowForTesting/Enabled,1/")));
+ EXPECT_FALSE(IsSdpMungingAllowed(
+ SdpMungingType::kWithoutCreateAnswer /*=2*/,
+ CreateTestFieldTrials("WebRTC-NoSdpMangleAllowForTesting/Enabled,1/")));
// Split by comma.
EXPECT_TRUE(IsSdpMungingAllowed(
SdpMungingType::kUnknownModification /*=1*/,
- *FieldTrials::CreateNoGlobal(
- "WebRTC-NoSdpMangleAllowForTesting/Enabled,1,2/")));
+ CreateTestFieldTrials("WebRTC-NoSdpMangleAllowForTesting/Enabled,1,2/")));
EXPECT_TRUE(IsSdpMungingAllowed(
SdpMungingType::kWithoutCreateAnswer /*=2*/,
- *FieldTrials::CreateNoGlobal(
- "WebRTC-NoSdpMangleAllowForTesting/Enabled,1,2/")));
+ CreateTestFieldTrials("WebRTC-NoSdpMangleAllowForTesting/Enabled,1,2/")));
EXPECT_FALSE(IsSdpMungingAllowed(
SdpMungingType::kWithoutCreateOffer /*=3*/,
- *FieldTrials::CreateNoGlobal(
+ CreateTestFieldTrials(
"WebRTC-NoSdpMangleAllowForTesting/Enabled,1,2,4/")));
}