tor-browser

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

commit 1640351772b8d3d36403c1af270c228aaa823797
parent 01c0500d3a933ee96b06d05649f6ed4f0819c97f
Author: Dan Baker <dbaker@mozilla.com>
Date:   Wed, 19 Nov 2025 18:51:15 -0700

Bug 2000941 - Vendor libwebrtc from 91d13f7105

Upstream commit: https://webrtc.googlesource.com/src/+/91d13f7105ae8ad9b274265fc776506af7c75c70
    Delete deprecated GetFieldTrialString() from api

    Move the deprecated global field trial string to another target so that
    fallback field trials still can use it.

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

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/api/environment/BUILD.gn | 6++++--
Mthird_party/libwebrtc/api/environment/deprecated_global_field_trials.cc | 16++++++++++------
Mthird_party/libwebrtc/api/environment/deprecated_global_field_trials.h | 3+++
Mthird_party/libwebrtc/moz-patch-stack/s0102.patch | 2+-
Mthird_party/libwebrtc/system_wrappers/BUILD.gn | 1+
Mthird_party/libwebrtc/system_wrappers/include/field_trial.h | 4----
Mthird_party/libwebrtc/system_wrappers/source/field_trial.cc | 10++--------
8 files changed, 23 insertions(+), 23 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-11-20T01:16:05.397090+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-11-20T01:51:00.752853+00:00. # base of lastest vendoring -5b634ccedc +91d13f7105 diff --git a/third_party/libwebrtc/api/environment/BUILD.gn b/third_party/libwebrtc/api/environment/BUILD.gn @@ -24,7 +24,10 @@ rtc_source_set("environment") { } rtc_library("deprecated_global_field_trials") { - visibility = [ ":environment_factory" ] + visibility = [ + ":environment_factory", + "../../system_wrappers:field_trial", + ] allow_poison = [ "environment_construction" ] sources = [ "deprecated_global_field_trials.cc", @@ -32,7 +35,6 @@ rtc_library("deprecated_global_field_trials") { ] deps = [ "../:field_trials_registry", - "../../system_wrappers:field_trial", "//third_party/abseil-cpp/absl/strings:string_view", ] } diff --git a/third_party/libwebrtc/api/environment/deprecated_global_field_trials.cc b/third_party/libwebrtc/api/environment/deprecated_global_field_trials.cc @@ -13,15 +13,19 @@ #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 +namespace { + +constinit const char* global_field_trial_string = nullptr; + +} // namespace +void DeprecatedGlobalFieldTrials::Set(const char* field_trials) { + global_field_trial_string = field_trials; +} + +std::string DeprecatedGlobalFieldTrials::GetValue(absl::string_view key) const { if (global_field_trial_string == nullptr) return std::string(); diff --git a/third_party/libwebrtc/api/environment/deprecated_global_field_trials.h b/third_party/libwebrtc/api/environment/deprecated_global_field_trials.h @@ -19,6 +19,9 @@ 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 { + public: + static void Set(const char* field_trials); + private: std::string GetValue(absl::string_view key) const override; }; diff --git a/third_party/libwebrtc/moz-patch-stack/s0102.patch b/third_party/libwebrtc/moz-patch-stack/s0102.patch @@ -741,7 +741,7 @@ index 90389a59fc..b430795605 100644 ] } diff --git a/system_wrappers/BUILD.gn b/system_wrappers/BUILD.gn -index 822b565610..f2ea548824 100644 +index 2823625062..fdd5474c33 100644 --- a/system_wrappers/BUILD.gn +++ b/system_wrappers/BUILD.gn @@ -7,8 +7,8 @@ diff --git a/third_party/libwebrtc/system_wrappers/BUILD.gn b/third_party/libwebrtc/system_wrappers/BUILD.gn @@ -52,6 +52,7 @@ rtc_library("field_trial") { "source/field_trial.cc", ] deps = [ + "../api/environment:deprecated_global_field_trials", "../rtc_base:checks", "../rtc_base:logging", "../rtc_base:stringutils", diff --git a/third_party/libwebrtc/system_wrappers/include/field_trial.h b/third_party/libwebrtc/system_wrappers/include/field_trial.h @@ -34,10 +34,6 @@ namespace field_trial { "Create FieldTrials and pass is where FieldTrialsView is expected")]] void InitFieldTrialsFromString(const char* trials_string); -// TODO: bugs.webrtc.org/42220378 - Remove from api after September 1, 2025. -[[deprecated("Propagate and query FieldTrialsView interface")]] -const char* GetFieldTrialString(); - // Validates the given field trial string. // TODO: bugs.webrtc.org/42220378 - Delete after January 1, 2026. [[deprecated("Use FieldTrials::Create to validate field trial string")]] diff --git a/third_party/libwebrtc/system_wrappers/source/field_trial.cc b/third_party/libwebrtc/system_wrappers/source/field_trial.cc @@ -16,6 +16,7 @@ #include <vector> #include "absl/strings/string_view.h" +#include "api/environment/deprecated_global_field_trials.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" #include "rtc_base/string_encode.h" @@ -24,9 +25,6 @@ // specify desired flags in InitFieldTrialsFromString. namespace webrtc { namespace field_trial { - -static const char* trials_init_string = nullptr; - namespace { constexpr char kPersistentStringSeparator = '/'; @@ -114,11 +112,7 @@ void InitFieldTrialsFromString(const char* trials_string) { RTC_DCHECK(FieldTrialsStringIsValidInternal(trials_string)) << "Invalid field trials string:" << trials_string; }; - trials_init_string = trials_string; -} - -const char* GetFieldTrialString() { - return trials_init_string; + DeprecatedGlobalFieldTrials::Set(trials_string); } } // namespace field_trial