tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a49734b9a14c564a2e1c5909f0e2bbde509ede7c
parent e774818fc59945332a71daa449756ddfbd05576b
Author: Dan Baker <dbaker@mozilla.com>
Date:   Wed, 22 Oct 2025 14:01:38 -0600

Bug 1995393 - Vendor libwebrtc from 80b3659d7d

Upstream commit: https://webrtc.googlesource.com/src/+/80b3659d7db613638946484010d440001d42fbb7
    Remove deprecated FieldTrialBasedConfig from api

    Move it as an implementation detail of the EnvironmentFactory as a
    default field trials fallback.

    Bug: webrtc:42220378
    Change-Id: Iaed0b847fae715e0b74674749baa5ce8ede6bff6
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/398960
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45290}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/api/environment/BUILD.gn | 16+++++++++++++++-
Athird_party/libwebrtc/api/environment/deprecated_global_field_trials.cc | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Athird_party/libwebrtc/api/environment/deprecated_global_field_trials.h | 27+++++++++++++++++++++++++++
Mthird_party/libwebrtc/api/environment/environment_factory.cc | 7++-----
Mthird_party/libwebrtc/api/transport/BUILD.gn | 15---------------
Dthird_party/libwebrtc/api/transport/field_trial_based_config.cc | 53-----------------------------------------------------
Dthird_party/libwebrtc/api/transport/field_trial_based_config.h | 29-----------------------------
Mthird_party/libwebrtc/modules/congestion_controller/goog_cc/BUILD.gn | 1-
Mthird_party/libwebrtc/moz-patch-stack/s0027.patch | 12++++++------
Mthird_party/libwebrtc/moz-patch-stack/s0055.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0084.patch | 8++++----
Mthird_party/libwebrtc/moz-patch-stack/s0099.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0103.patch | 8++++----
Mthird_party/libwebrtc/pc/BUILD.gn | 1-
Mthird_party/libwebrtc/rtc_tools/BUILD.gn | 1-
Mthird_party/libwebrtc/sdk/BUILD.gn | 1-
Mthird_party/libwebrtc/test/BUILD.gn | 1-
Mthird_party/libwebrtc/test/network/BUILD.gn | 1-
19 files changed, 117 insertions(+), 129 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 /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-22T19:58:41.295699+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-22T20:01:23.819721+00:00. # base of lastest vendoring -8f712e0ae3 +80b3659d7d diff --git a/third_party/libwebrtc/api/environment/BUILD.gn b/third_party/libwebrtc/api/environment/BUILD.gn @@ -23,6 +23,20 @@ rtc_source_set("environment") { ] } +rtc_library("deprecated_global_field_trials") { + visibility = [ ":environment_factory" ] + allow_poison = [ "environment_construction" ] + sources = [ + "deprecated_global_field_trials.cc", + "deprecated_global_field_trials.h", + ] + deps = [ + "../:field_trials_registry", + "../../system_wrappers:field_trial", + "//third_party/abseil-cpp/absl/strings:string_view", + ] +} + rtc_library("environment_factory") { visibility = [ "*" ] poisonous = [ "environment_construction" ] @@ -31,6 +45,7 @@ rtc_library("environment_factory") { "environment_factory.h", ] deps = [ + ":deprecated_global_field_trials", ":environment", "..:field_trials_view", "..:make_ref_counted", @@ -42,7 +57,6 @@ rtc_library("environment_factory") { "../rtc_event_log", "../task_queue", "../task_queue:default_task_queue_factory", - "../transport:field_trial_based_config", "//third_party/abseil-cpp/absl/base:nullability", ] } diff --git a/third_party/libwebrtc/api/environment/deprecated_global_field_trials.cc b/third_party/libwebrtc/api/environment/deprecated_global_field_trials.cc @@ -0,0 +1,53 @@ +/* + * Copyright 2019 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ +#include "api/environment/deprecated_global_field_trials.h" + +#include <cstddef> +#include <string> + +#include "absl/strings/string_view.h" +#include "system_wrappers/include/field_trial.h" + +namespace webrtc { +std::string DeprecatedGlobalFieldTrials::GetValue(absl::string_view key) const { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + const char* global_field_trial_string = field_trial::GetFieldTrialString(); +#pragma clang diagnostic pop + + if (global_field_trial_string == nullptr) + return std::string(); + + absl::string_view trials_string(global_field_trial_string); + if (trials_string.empty()) + return std::string(); + + size_t next_item = 0; + while (next_item < trials_string.length()) { + // Find next name/value pair in field trial configuration string. + size_t field_name_end = trials_string.find('/', next_item); + if (field_name_end == trials_string.npos || field_name_end == next_item) + break; + size_t field_value_end = trials_string.find('/', field_name_end + 1); + if (field_value_end == trials_string.npos || + field_value_end == field_name_end + 1) + break; + absl::string_view field_name = + trials_string.substr(next_item, field_name_end - next_item); + absl::string_view field_value = trials_string.substr( + field_name_end + 1, field_value_end - field_name_end - 1); + next_item = field_value_end + 1; + + if (key == field_name) + return std::string(field_value); + } + return std::string(); +} +} // namespace webrtc diff --git a/third_party/libwebrtc/api/environment/deprecated_global_field_trials.h b/third_party/libwebrtc/api/environment/deprecated_global_field_trials.h @@ -0,0 +1,27 @@ +/* + * Copyright 2019 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ +#ifndef API_ENVIRONMENT_DEPRECATED_GLOBAL_FIELD_TRIALS_H_ +#define API_ENVIRONMENT_DEPRECATED_GLOBAL_FIELD_TRIALS_H_ + +#include <string> + +#include "absl/strings/string_view.h" +#include "api/field_trials_registry.h" + +namespace webrtc { +// TODO: bugs.webrtc.org/42220378 - Delete after January 1, 2026 when functions +// to set global field trials are deleted. +class DeprecatedGlobalFieldTrials : public FieldTrialsRegistry { + private: + std::string GetValue(absl::string_view key) const override; +}; +} // namespace webrtc + +#endif // API_ENVIRONMENT_DEPRECATED_GLOBAL_FIELD_TRIALS_H_ diff --git a/third_party/libwebrtc/api/environment/environment_factory.cc b/third_party/libwebrtc/api/environment/environment_factory.cc @@ -14,6 +14,7 @@ #include <utility> #include "absl/base/nullability.h" +#include "api/environment/deprecated_global_field_trials.h" #include "api/environment/environment.h" #include "api/field_trials_view.h" #include "api/make_ref_counted.h" @@ -22,7 +23,6 @@ #include "api/scoped_refptr.h" #include "api/task_queue/default_task_queue_factory.h" #include "api/task_queue/task_queue_factory.h" -#include "api/transport/field_trial_based_config.h" #include "rtc_base/checks.h" #include "system_wrappers/include/clock.h" @@ -100,10 +100,7 @@ void EnvironmentFactory::Set( Environment EnvironmentFactory::CreateWithDefaults() && { if (field_trials_ == nullptr) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - Set(std::make_unique<FieldTrialBasedConfig>()); -#pragma clang diagnostic pop + Set(std::make_unique<DeprecatedGlobalFieldTrials>()); } #if defined(WEBRTC_MOZILLA_BUILD) // We want to use our clock, not GetRealTimeClockRaw, and we avoid diff --git a/third_party/libwebrtc/api/transport/BUILD.gn b/third_party/libwebrtc/api/transport/BUILD.gn @@ -60,21 +60,6 @@ rtc_library("network_control") { ] } -rtc_library("field_trial_based_config") { - visibility = [ "*" ] - allow_poison = [ "environment_construction" ] - sources = [ - "field_trial_based_config.cc", - "field_trial_based_config.h", - ] - deps = [ - "../../api:field_trials_registry", - "../../rtc_base/system:rtc_export", - "../../system_wrappers:field_trial", - "//third_party/abseil-cpp/absl/strings:string_view", - ] -} - rtc_source_set("datagram_transport_interface") { visibility = [ "*" ] sources = [ "data_channel_transport_interface.h" ] diff --git a/third_party/libwebrtc/api/transport/field_trial_based_config.cc b/third_party/libwebrtc/api/transport/field_trial_based_config.cc @@ -1,53 +0,0 @@ -/* - * Copyright 2019 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "api/transport/field_trial_based_config.h" - -#include <cstddef> -#include <string> - -#include "absl/strings/string_view.h" -#include "system_wrappers/include/field_trial.h" - -namespace webrtc { -std::string FieldTrialBasedConfig::GetValue(absl::string_view key) const { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - const char* global_field_trial_string = field_trial::GetFieldTrialString(); -#pragma clang diagnostic pop - - if (global_field_trial_string == nullptr) - return std::string(); - - absl::string_view trials_string(global_field_trial_string); - if (trials_string.empty()) - return std::string(); - - size_t next_item = 0; - while (next_item < trials_string.length()) { - // Find next name/value pair in field trial configuration string. - size_t field_name_end = trials_string.find('/', next_item); - if (field_name_end == trials_string.npos || field_name_end == next_item) - break; - size_t field_value_end = trials_string.find('/', field_name_end + 1); - if (field_value_end == trials_string.npos || - field_value_end == field_name_end + 1) - break; - absl::string_view field_name = - trials_string.substr(next_item, field_name_end - next_item); - absl::string_view field_value = trials_string.substr( - field_name_end + 1, field_value_end - field_name_end - 1); - next_item = field_value_end + 1; - - if (key == field_name) - return std::string(field_value); - } - return std::string(); -} -} // namespace webrtc diff --git a/third_party/libwebrtc/api/transport/field_trial_based_config.h b/third_party/libwebrtc/api/transport/field_trial_based_config.h @@ -1,29 +0,0 @@ -/* - * Copyright 2019 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef API_TRANSPORT_FIELD_TRIAL_BASED_CONFIG_H_ -#define API_TRANSPORT_FIELD_TRIAL_BASED_CONFIG_H_ - -#include <string> - -#include "absl/strings/string_view.h" -#include "api/field_trials_registry.h" -#include "rtc_base/system/rtc_export.h" - -namespace webrtc { -// Implementation using the field trial API fo the key value lookup. -// TODO: bugs.webrtc.org/42220378 - Remove from public api after August 1, 2025. -class [[deprecated]] RTC_EXPORT FieldTrialBasedConfig - : public FieldTrialsRegistry { - private: - std::string GetValue(absl::string_view key) const override; -}; -} // namespace webrtc - -#endif // API_TRANSPORT_FIELD_TRIAL_BASED_CONFIG_H_ diff --git a/third_party/libwebrtc/modules/congestion_controller/goog_cc/BUILD.gn b/third_party/libwebrtc/modules/congestion_controller/goog_cc/BUILD.gn @@ -287,7 +287,6 @@ if (rtc_include_tests) { "../../../api/test/network_emulation", "../../../api/test/network_emulation:create_cross_traffic", "../../../api/transport:bandwidth_usage", - "../../../api/transport:field_trial_based_config", "../../../api/transport:goog_cc", "../../../api/transport:network_control", "../../../api/units:data_rate", diff --git a/third_party/libwebrtc/moz-patch-stack/s0027.patch b/third_party/libwebrtc/moz-patch-stack/s0027.patch @@ -458,10 +458,10 @@ index 71778f52ec..7db75d5fd3 100644 rtc_library("default_task_queue_factory") { visibility = [ "*" ] diff --git a/api/transport/BUILD.gn b/api/transport/BUILD.gn -index b99d40378d..c017173a7e 100644 +index 67a2dbf7ec..9c5e881a70 100644 --- a/api/transport/BUILD.gn +++ b/api/transport/BUILD.gn -@@ -108,6 +108,7 @@ rtc_source_set("sctp_transport_factory_interface") { +@@ -93,6 +93,7 @@ rtc_source_set("sctp_transport_factory_interface") { } rtc_library("stun_types") { @@ -469,7 +469,7 @@ index b99d40378d..c017173a7e 100644 visibility = [ "*" ] sources = [ "stun.cc", -@@ -130,6 +131,7 @@ rtc_library("stun_types") { +@@ -115,6 +116,7 @@ rtc_library("stun_types") { "//third_party/abseil-cpp/absl/strings:string_view", ] } @@ -1199,7 +1199,7 @@ index c1181618e9..4a772795ed 100644 deps += [ "..:logging", diff --git a/test/BUILD.gn b/test/BUILD.gn -index 75a3fbcdd9..f469105112 100644 +index 4a6e127fc9..f6658eb8d1 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -258,6 +258,7 @@ rtc_library("audio_test_common") { @@ -1241,7 +1241,7 @@ index 75a3fbcdd9..f469105112 100644 sources += [ "testsupport/jpeg_frame_writer.cc" ] } else { sources += [ "testsupport/jpeg_frame_writer_ios.cc" ] -@@ -1337,6 +1345,7 @@ if (!build_with_chromium) { +@@ -1336,6 +1344,7 @@ if (!build_with_chromium) { } } @@ -1249,7 +1249,7 @@ index 75a3fbcdd9..f469105112 100644 if (!build_with_chromium && is_android) { rtc_android_library("native_test_java") { testonly = true -@@ -1379,6 +1388,7 @@ if (!build_with_chromium && is_android) { +@@ -1378,6 +1387,7 @@ if (!build_with_chromium && is_android) { sources = [ "android/org/webrtc/native_test/NativeTestWebrtc.java" ] } } diff --git a/third_party/libwebrtc/moz-patch-stack/s0055.patch b/third_party/libwebrtc/moz-patch-stack/s0055.patch @@ -26,7 +26,7 @@ index 1896ed1d07..8704f0f34a 100644 deps += [ "logging:rtc_event_log_proto" ] } diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn -index cd90d6d033..11c94ec229 100644 +index 17324f6913..27d9d0056d 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -571,6 +571,7 @@ if (is_ios || is_mac) { @@ -69,7 +69,7 @@ index cd90d6d033..11c94ec229 100644 rtc_library("videocodec_objc") { visibility = [ "*" ] configs += [ "..:no_global_constructors" ] -@@ -1820,5 +1825,6 @@ if (is_ios || is_mac) { +@@ -1819,5 +1824,6 @@ if (is_ios || is_mac) { "VideoToolbox.framework", ] } diff --git a/third_party/libwebrtc/moz-patch-stack/s0084.patch b/third_party/libwebrtc/moz-patch-stack/s0084.patch @@ -23,12 +23,12 @@ index 8704f0f34a..3eab1126bf 100644 "api/video:video_rtp_headers", "test:rtp_test_utils", diff --git a/api/environment/environment_factory.cc b/api/environment/environment_factory.cc -index 0dd380a70b..4f48c1a06c 100644 +index 529bbecad7..6e0810267b 100644 --- a/api/environment/environment_factory.cc +++ b/api/environment/environment_factory.cc -@@ -105,12 +105,22 @@ Environment EnvironmentFactory::CreateWithDefaults() && { - Set(std::make_unique<FieldTrialBasedConfig>()); - #pragma clang diagnostic pop +@@ -102,12 +102,22 @@ Environment EnvironmentFactory::CreateWithDefaults() && { + if (field_trials_ == nullptr) { + Set(std::make_unique<DeprecatedGlobalFieldTrials>()); } +#if defined(WEBRTC_MOZILLA_BUILD) + // We want to use our clock, not GetRealTimeClockRaw, and we avoid diff --git a/third_party/libwebrtc/moz-patch-stack/s0099.patch b/third_party/libwebrtc/moz-patch-stack/s0099.patch @@ -61,7 +61,7 @@ index 0aec2d94c7..83c1b21260 100644 } } diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn -index 11c94ec229..df32a6863d 100644 +index 27d9d0056d..c78cdec7cc 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -632,6 +632,20 @@ if (is_ios || is_mac) { @@ -86,7 +86,7 @@ index 11c94ec229..df32a6863d 100644 if (!build_with_mozilla) { diff --git a/test/BUILD.gn b/test/BUILD.gn -index f469105112..975dd7b222 100644 +index f6658eb8d1..f5039000f6 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -470,6 +470,12 @@ rtc_source_set("test_support") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0103.patch b/third_party/libwebrtc/moz-patch-stack/s0103.patch @@ -601,7 +601,7 @@ index 88655146af..70782e51b6 100644 import("../../webrtc.gni") diff --git a/pc/BUILD.gn b/pc/BUILD.gn -index 5a064183f3..8120144fe2 100644 +index 0c5df79fb4..70075055cf 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -30,8 +30,8 @@ @@ -702,7 +702,7 @@ index 4fa98d73a2..72c01d50ab 100644 output_extension = "so" } diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn -index df32a6863d..c394964852 100644 +index c78cdec7cc..cc5d90b42f 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -9,12 +9,12 @@ @@ -731,7 +731,7 @@ index df32a6863d..c394964852 100644 } } -@@ -1281,7 +1281,7 @@ if (is_ios || is_mac) { +@@ -1280,7 +1280,7 @@ if (is_ios || is_mac) { } public_deps = [ @@ -756,7 +756,7 @@ index 822b565610..f2ea548824 100644 import("../webrtc.gni") diff --git a/test/BUILD.gn b/test/BUILD.gn -index 975dd7b222..d9f6c6d346 100644 +index f5039000f6..27fbece69e 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -6,10 +6,10 @@ diff --git a/third_party/libwebrtc/pc/BUILD.gn b/third_party/libwebrtc/pc/BUILD.gn @@ -2528,7 +2528,6 @@ if (rtc_include_tests && !build_with_chromium) { "../api/transport:bitrate_settings", "../api/transport:datagram_transport_interface", "../api/transport:enums", - "../api/transport:field_trial_based_config", "../api/transport:sctp_transport_factory_interface", "../api/transport/rtp:rtp_source", "../api/units:data_rate", diff --git a/third_party/libwebrtc/rtc_tools/BUILD.gn b/third_party/libwebrtc/rtc_tools/BUILD.gn @@ -175,7 +175,6 @@ if (!is_component_build) { "../api/environment:environment_factory", "../api/task_queue", "../api/test/video:function_video_factory", - "../api/transport:field_trial_based_config", "../api/units:time_delta", "../api/units:timestamp", "../api/video:encoded_image", diff --git a/third_party/libwebrtc/sdk/BUILD.gn b/third_party/libwebrtc/sdk/BUILD.gn @@ -1150,7 +1150,6 @@ if (is_ios || is_mac) { "../api/environment:environment_factory", "../api/rtc_event_log:rtc_event_log_factory", "../api/task_queue:default_task_queue_factory", - "../api/transport:field_trial_based_config", "../api/transport:network_control", "../api/transport/rtp:rtp_source", "../api/video:video_frame", diff --git a/third_party/libwebrtc/test/BUILD.gn b/third_party/libwebrtc/test/BUILD.gn @@ -1312,7 +1312,6 @@ if (!build_with_chromium) { "../api/task_queue", "../api/test/video:function_video_factory", "../api/transport:bitrate_settings", - "../api/transport:field_trial_based_config", "../api/transport:network_control", "../api/units:time_delta", "../api/units:timestamp", diff --git a/third_party/libwebrtc/test/network/BUILD.gn b/third_party/libwebrtc/test/network/BUILD.gn @@ -118,7 +118,6 @@ if (rtc_include_tests && !build_with_chromium) { "../../api/rtc_event_log:rtc_event_log_factory", "../../api/task_queue:default_task_queue_factory", "../../api/test/network_emulation", - "../../api/transport:field_trial_based_config", "../../modules/audio_device:test_audio_device_module", "../../p2p:port_allocator", "../../pc:pc_test_utils",