tor-browser

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

commit cb78ea67440ae74837aad54cdc655f3c038e9e4d
parent ffe9c92e95c411a3647c0e3dc598280ec890f208
Author: Michael Froman <mfroman@mozilla.com>
Date:   Thu,  9 Oct 2025 10:09:14 -0500

Bug 1993083 - Vendor libwebrtc from a084fd66f2

Upstream commit: https://webrtc.googlesource.com/src/+/a084fd66f2b6a20485b714a6ad52e157ffb0690e
    Make the rtc_rusty_base64 flag apply globally

    This prevents ODR violations as there can no longer be 2 implementations of
    base64.h

    Bug: webrtc:430259982
    Change-Id: I989ad6c05df6df93a2534474fc5168747ecf8f7b
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/399600
    Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
    Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45127}

Diffstat:
Mthird_party/libwebrtc/BUILD.gn | 9+++++++--
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0001.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0027.patch | 16++++++++--------
Mthird_party/libwebrtc/moz-patch-stack/s0034.patch | 8++++----
Mthird_party/libwebrtc/moz-patch-stack/s0045.patch | 6+++---
Mthird_party/libwebrtc/moz-patch-stack/s0053.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0055.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0069.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0084.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0091.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0093.patch | 6+++---
Mthird_party/libwebrtc/moz-patch-stack/s0094.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0101.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0102.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0103.patch | 26+++++++++++++-------------
Mthird_party/libwebrtc/moz-patch-stack/s0104.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0106.patch | 6+++---
Mthird_party/libwebrtc/moz-patch-stack/s0108.patch | 10+++++-----
Mthird_party/libwebrtc/moz-patch-stack/s0112.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0117.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0122.patch | 57++++++++++++++++++++++++++++++++++++++++-----------------
Mthird_party/libwebrtc/moz-patch-stack/s0123.patch | 77+++++++++++++++++++++++++++++++++++++----------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0124.patch | 94++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0125.patch | 102++++++++++++++++++++++++++++++-------------------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0126.patch | 73++++++++++++++++++++++++++++++++++---------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0127.patch | 31+++++++------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0128.patch | 59++++++++++++++++++++++++++++++++++++++++++-----------------
Mthird_party/libwebrtc/moz-patch-stack/s0129.patch | 74++++++++++++++++++++++++++++++++++----------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0130.patch | 54++++++++++++++++++------------------------------------
Dthird_party/libwebrtc/moz-patch-stack/s0131.patch | 23-----------------------
Mthird_party/libwebrtc/rtc_base/BUILD.gn | 73+++++++++++++++++++++----------------------------------------------------
Mthird_party/libwebrtc/rtc_base/base64.rs | 19+++++++------------
Mthird_party/libwebrtc/rtc_base/base64_rust.cc | 15++++++++++++++-
Mthird_party/libwebrtc/webrtc.gni | 2+-
35 files changed, 418 insertions(+), 458 deletions(-)

diff --git a/third_party/libwebrtc/BUILD.gn b/third_party/libwebrtc/BUILD.gn @@ -82,7 +82,9 @@ if (!build_with_chromium && !build_with_mozilla) { if (use_libfuzzer) { deps += [ "test/fuzzers" ] } - if (!is_asan) { + + # TODO(bugs.webrtc.org/430260876): Remove once rust links with libwebrtc. + if (!is_asan && !rtc_rusty_base64) { # Do not build :webrtc_lib_link_test because lld complains on some OS # (e.g. when target_os = "mac") when is_asan=true. For more details, # see bugs.webrtc.org/11027#c5. @@ -545,6 +547,7 @@ if (!build_with_chromium) { ] sources = [] + complete_static_lib = true suppressed_configs += [ "//chromium/build/config/compiler:thin_archive" ] defines = [] @@ -654,7 +657,9 @@ if (!build_with_chromium) { } } - if (rtc_include_tests && !is_asan) { + # TODO(bugs.webrtc.org/430260876): Compile webrtc lib with rust once toolchain + # is working. + if (rtc_include_tests && !is_asan && !rtc_rusty_base64) { rtc_executable("webrtc_lib_link_test") { testonly = true 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-09T14:33:58.948608+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T15:09:04.663181+00:00. # base of lastest vendoring -cb4d3d4f3f +a084fd66f2 diff --git a/third_party/libwebrtc/moz-patch-stack/s0001.patch b/third_party/libwebrtc/moz-patch-stack/s0001.patch @@ -1383,7 +1383,7 @@ index d5ce6105a3..8bfd24de2b 100644 const bool enable_svc_for_simulcast_; std::optional<SimulcastToSvcConverter> simulcast_to_svc_converter_; diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index cffc631ba1..212939da78 100644 +index cfbdae4c23..e2481ce813 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -450,6 +450,12 @@ rtc_library("logging") { @@ -1501,7 +1501,7 @@ index b7933130bd..428fc9615d 100644 vcm_ = nullptr; } diff --git a/webrtc.gni b/webrtc.gni -index 30ca2afdd3..519e0849d2 100644 +index 112233b7d3..209cf7656d 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -123,7 +123,7 @@ declare_args() { diff --git a/third_party/libwebrtc/moz-patch-stack/s0027.patch b/third_party/libwebrtc/moz-patch-stack/s0027.patch @@ -116,7 +116,7 @@ index 1b112b34c0..18cf5d67f7 100644 # TODO(https://bugs.webrtc.org/14437): Remove this section if general # Chromium fix resolves the problem. diff --git a/BUILD.gn b/BUILD.gn -index 1565aeb592..cfbba26987 100644 +index a57c4e9497..de4c4b174c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -33,7 +33,7 @@ if (is_android) { @@ -128,7 +128,7 @@ index 1565aeb592..cfbba26987 100644 # This target should (transitively) cause everything to be built; if you run # 'ninja default' and then 'ninja all', the second build should do no work. group("default") { -@@ -157,6 +157,10 @@ config("common_inherited_config") { +@@ -159,6 +159,10 @@ config("common_inherited_config") { defines += [ "WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT" ] } @@ -139,7 +139,7 @@ index 1565aeb592..cfbba26987 100644 if (!rtc_builtin_ssl_root_certificates) { defines += [ "WEBRTC_EXCLUDE_BUILT_IN_SSL_ROOT_CERTS" ] } -@@ -495,9 +499,11 @@ config("common_config") { +@@ -497,9 +501,11 @@ config("common_config") { } } @@ -151,7 +151,7 @@ index 1565aeb592..cfbba26987 100644 if (!rtc_build_ssl) { config("external_ssl_library") { -@@ -560,6 +566,33 @@ if (!build_with_chromium) { +@@ -563,6 +569,33 @@ if (!build_with_chromium) { "sdk", "video", ] @@ -185,7 +185,7 @@ index 1565aeb592..cfbba26987 100644 if (rtc_include_builtin_audio_codecs) { deps += [ -@@ -572,6 +605,16 @@ if (!build_with_chromium) { +@@ -575,6 +608,16 @@ if (!build_with_chromium) { deps += [ "api/video:video_frame", "api/video:video_rtp_headers", @@ -1013,7 +1013,7 @@ index 058b86bce4..2f7b5b5333 100644 "/config/external/nspr", "/nsprpub/lib/ds", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 212939da78..db39bc5d26 100644 +index e2481ce813..5d98f2c0be 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -326,6 +326,7 @@ rtc_library("sample_counter") { @@ -1176,7 +1176,7 @@ index 212939da78..db39bc5d26 100644 rtc_library("ssl_adapter") { visibility = [ "*" ] -@@ -2359,7 +2383,7 @@ if (rtc_include_tests) { +@@ -2328,7 +2352,7 @@ if (rtc_include_tests) { } } @@ -1280,7 +1280,7 @@ index c1acd56382..7abdf541f8 100644 "../api:sequence_checker", "../api/adaptation:resource_adaptation_api", diff --git a/webrtc.gni b/webrtc.gni -index 519e0849d2..aabdb21780 100644 +index 209cf7656d..1c85298081 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -35,6 +35,11 @@ if (is_mac) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0034.patch b/third_party/libwebrtc/moz-patch-stack/s0034.patch @@ -20,10 +20,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/58f47eacaf10d12e2 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/BUILD.gn b/BUILD.gn -index cfbba26987..887cfbac2f 100644 +index de4c4b174c..c967019b11 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -438,12 +438,12 @@ config("common_config") { +@@ -440,12 +440,12 @@ config("common_config") { } } @@ -38,7 +38,7 @@ index cfbba26987..887cfbac2f 100644 defines += [ "WEBRTC_ARCH_ARM" ] if (arm_version >= 7) { defines += [ "WEBRTC_ARCH_ARM_V7" ] -@@ -453,7 +453,7 @@ config("common_config") { +@@ -455,7 +455,7 @@ config("common_config") { } } @@ -276,7 +276,7 @@ index ff3f4d5b93..b95f1aa2d0 100644 config("x11_config") { if (rtc_use_x11_extensions) { diff --git a/webrtc.gni b/webrtc.gni -index aabdb21780..6f7c987bd2 100644 +index 1c85298081..b48581b93e 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -169,13 +169,13 @@ declare_args() { diff --git a/third_party/libwebrtc/moz-patch-stack/s0045.patch b/third_party/libwebrtc/moz-patch-stack/s0045.patch @@ -18,10 +18,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/0300b32b7de70fb89 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/BUILD.gn b/BUILD.gn -index 887cfbac2f..ec62984044 100644 +index c967019b11..bd66288681 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -222,6 +222,9 @@ config("common_inherited_config") { +@@ -224,6 +224,9 @@ config("common_inherited_config") { if (is_linux || is_chromeos) { defines += [ "WEBRTC_LINUX" ] } @@ -74,7 +74,7 @@ index f057d4b7c3..61d8af14c2 100644 #endif // defined(WEBRTC_POSIX) } diff --git a/webrtc.gni b/webrtc.gni -index 6f7c987bd2..3847a3c833 100644 +index b48581b93e..091fb4aed8 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -359,7 +359,7 @@ rtc_opus_dir = "//third_party/opus" diff --git a/third_party/libwebrtc/moz-patch-stack/s0053.patch b/third_party/libwebrtc/moz-patch-stack/s0053.patch @@ -29,7 +29,7 @@ index 7db75d5fd3..d0feb5007c 100644 rtc_library("task_queue_test") { visibility = [ "*" ] diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index db39bc5d26..18cb8eb684 100644 +index 5d98f2c0be..956aac290d 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -665,10 +665,14 @@ if (is_mac || is_ios) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0055.patch b/third_party/libwebrtc/moz-patch-stack/s0055.patch @@ -11,10 +11,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b0658888969395dca 2 files changed, 10 insertions(+) diff --git a/BUILD.gn b/BUILD.gn -index ec62984044..25b8dddb8b 100644 +index bd66288681..3dca573133 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -621,6 +621,10 @@ if (!build_with_chromium) { +@@ -624,6 +624,10 @@ if (!build_with_chromium) { ] } diff --git a/third_party/libwebrtc/moz-patch-stack/s0069.patch b/third_party/libwebrtc/moz-patch-stack/s0069.patch @@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/46fb51c90709be64c 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc.gni b/webrtc.gni -index 3847a3c833..e9dea332d0 100644 +index 091fb4aed8..c4b66134ce 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -310,7 +310,7 @@ declare_args() { diff --git a/third_party/libwebrtc/moz-patch-stack/s0084.patch b/third_party/libwebrtc/moz-patch-stack/s0084.patch @@ -11,10 +11,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2185cab977988fd4a 3 files changed, 16 insertions(+) diff --git a/BUILD.gn b/BUILD.gn -index 25b8dddb8b..11d7fec9d2 100644 +index 3dca573133..b3497c121e 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -606,6 +606,7 @@ if (!build_with_chromium) { +@@ -609,6 +609,7 @@ if (!build_with_chromium) { if (build_with_mozilla) { deps += [ diff --git a/third_party/libwebrtc/moz-patch-stack/s0091.patch b/third_party/libwebrtc/moz-patch-stack/s0091.patch @@ -13,7 +13,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/4e7b3c485e549e7e3 1 file changed, 6 insertions(+) diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 18cb8eb684..138a41e57d 100644 +index 956aac290d..c731d0d0c3 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -992,6 +992,12 @@ rtc_library("threading") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0093.patch b/third_party/libwebrtc/moz-patch-stack/s0093.patch @@ -10,10 +10,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b050c455caa1d24a0 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BUILD.gn b/BUILD.gn -index 11d7fec9d2..29fa9ffdc7 100644 +index b3497c121e..396f850586 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -278,6 +278,7 @@ config("rtc_prod_config") { +@@ -280,6 +280,7 @@ config("rtc_prod_config") { } group("tracing") { @@ -21,7 +21,7 @@ index 11d7fec9d2..29fa9ffdc7 100644 all_dependent_configs = [ "//third_party/perfetto/gn:public_config" ] if (rtc_use_perfetto) { if (build_with_chromium) { -@@ -294,6 +295,7 @@ group("tracing") { +@@ -296,6 +297,7 @@ group("tracing") { [ "//third_party/perfetto/include/perfetto/tracing" ] } } diff --git a/third_party/libwebrtc/moz-patch-stack/s0094.patch b/third_party/libwebrtc/moz-patch-stack/s0094.patch @@ -9,7 +9,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/ee2f06666bcc6d22c 1 file changed, 2 insertions(+) diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 138a41e57d..ad3ee8da5f 100644 +index c731d0d0c3..73b8c89fb1 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -1643,6 +1643,7 @@ if (!build_with_mozilla) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0101.patch b/third_party/libwebrtc/moz-patch-stack/s0101.patch @@ -52,7 +52,7 @@ index b93ed8c707..f79625d651 100644 rtc_library("encoded_frame") { diff --git a/webrtc.gni b/webrtc.gni -index e9dea332d0..40679b2358 100644 +index c4b66134ce..761c0006b8 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -496,8 +496,8 @@ all_poison_types = [ diff --git a/third_party/libwebrtc/moz-patch-stack/s0102.patch b/third_party/libwebrtc/moz-patch-stack/s0102.patch @@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/45b99d1ba95b46896 1 file changed, 71 insertions(+) diff --git a/webrtc.gni b/webrtc.gni -index 40679b2358..a448f64dd3 100644 +index 761c0006b8..8c293ba42c 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -700,6 +700,36 @@ template("rtc_source_set") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0103.patch b/third_party/libwebrtc/moz-patch-stack/s0103.patch @@ -75,7 +75,7 @@ index cdbd705ec2..4ee826ec58 100644 # The python interpreter to use by default. On Windows, this will look # for vpython3.exe and vpython3.bat. diff --git a/BUILD.gn b/BUILD.gn -index 29fa9ffdc7..5f3497a925 100644 +index 396f850586..5f268214e8 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -21,15 +21,15 @@ @@ -98,16 +98,16 @@ index 29fa9ffdc7..5f3497a925 100644 import("//third_party/jni_zero/jni_zero.gni") } -@@ -533,7 +533,7 @@ if (!build_with_chromium) { - +@@ -536,7 +536,7 @@ if (!build_with_chromium) { sources = [] + complete_static_lib = true - suppressed_configs += [ "//build/config/compiler:thin_archive" ] + suppressed_configs += [ "//chromium/build/config/compiler:thin_archive" ] defines = [] deps = [ -@@ -846,7 +846,7 @@ rtc_static_library("dcsctp") { +@@ -851,7 +851,7 @@ rtc_static_library("dcsctp") { visibility = [ "//:default" ] sources = [] complete_static_lib = true @@ -116,7 +116,7 @@ index 29fa9ffdc7..5f3497a925 100644 defines = [] deps = [ "net/dcsctp/public:factory", -@@ -881,7 +881,7 @@ group("poison_software_video_codecs") { +@@ -886,7 +886,7 @@ group("poison_software_video_codecs") { if (!build_with_chromium) { # Write debug logs to gn_logs.txt. # This is also required for Siso builds. @@ -616,7 +616,7 @@ index 605b9bb84a..278e312c85 100644 if (rtc_build_libsrtp) { diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index ad3ee8da5f..8a7ca1e90b 100644 +index 73b8c89fb1..28fd1f0e90 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -9,8 +9,8 @@ @@ -630,17 +630,17 @@ index ad3ee8da5f..8a7ca1e90b 100644 } rtc_source_set("protobuf_utils") { -@@ -1880,8 +1880,8 @@ rtc_library("base64") { - } - - if (rtc_rusty_base64) { +@@ -1882,8 +1882,8 @@ if (!rtc_rusty_base64) { + ] + } + } else { - import("//build/config/rust.gni") - import("//build/rust/rust_static_library.gni") + import("//chromium/build/config/rust.gni") + import("//chromium/build/rust/rust_static_library.gni") - rtc_source_set("base64_header") { - sources = [ "base64.h" ] + rust_static_library("base64_rust_bridge") { + allow_unsafe = true # Needed for FFI with cxx crate. diff --git a/rtc_base/memory/BUILD.gn b/rtc_base/memory/BUILD.gn index 9a55af3ea9..3d272ba975 100644 --- a/rtc_base/memory/BUILD.gn @@ -804,7 +804,7 @@ index d8f0eba11f..eb25867dc9 100644 } } diff --git a/webrtc.gni b/webrtc.gni -index a448f64dd3..2332abaee9 100644 +index 8c293ba42c..7759842c6f 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -5,12 +5,12 @@ diff --git a/third_party/libwebrtc/moz-patch-stack/s0104.patch b/third_party/libwebrtc/moz-patch-stack/s0104.patch @@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/f18c05287ce831369 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/webrtc.gni b/webrtc.gni -index 2332abaee9..2fe407181c 100644 +index 7759842c6f..86e324ffae 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -545,7 +545,7 @@ template("rtc_test") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0106.patch b/third_party/libwebrtc/moz-patch-stack/s0106.patch @@ -9,10 +9,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/90a33b06e51017d25 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn -index 5f3497a925..3cb7c1f623 100644 +index 5f268214e8..4e67c43d65 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -562,6 +562,7 @@ if (!build_with_chromium) { +@@ -565,6 +565,7 @@ if (!build_with_chromium) { "call", "common_audio", "common_video", @@ -20,7 +20,7 @@ index 5f3497a925..3cb7c1f623 100644 "logging:rtc_event_log_api", "media", "modules", -@@ -843,7 +844,7 @@ if (rtc_include_tests && !build_with_chromium) { +@@ -848,7 +849,7 @@ if (rtc_include_tests && !build_with_chromium) { # Build target for standalone dcsctp rtc_static_library("dcsctp") { # Only the root target should depend on this. diff --git a/third_party/libwebrtc/moz-patch-stack/s0108.patch b/third_party/libwebrtc/moz-patch-stack/s0108.patch @@ -16,10 +16,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/4527c41ef71d7683c 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/BUILD.gn b/BUILD.gn -index 3cb7c1f623..9e801948e5 100644 +index 4e67c43d65..c2866618aa 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -519,6 +519,9 @@ if (!rtc_build_ssl) { +@@ -521,6 +521,9 @@ if (!rtc_build_ssl) { "crypto", "ssl", ] @@ -29,7 +29,7 @@ index 3cb7c1f623..9e801948e5 100644 } } -@@ -612,6 +615,7 @@ if (!build_with_chromium) { +@@ -615,6 +618,7 @@ if (!build_with_chromium) { "api/environment:environment_factory", "api/video:video_frame", "api/video:video_rtp_headers", @@ -116,7 +116,7 @@ index 6f2dc22e00..e3ee0fe861 100644 public_configs = [] if (!build_with_chromium) { diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 8a7ca1e90b..0dc4f17686 100644 +index 28fd1f0e90..b4451f9ffe 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -1522,6 +1522,7 @@ rtc_source_set("ssl_header") { @@ -147,7 +147,7 @@ index 8a7ca1e90b..0dc4f17686 100644 rtc_library("ssl") { if (!build_with_mozilla) { diff --git a/webrtc.gni b/webrtc.gni -index 2fe407181c..34fae67f24 100644 +index 86e324ffae..8c270e335e 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -125,7 +125,7 @@ declare_args() { diff --git a/third_party/libwebrtc/moz-patch-stack/s0112.patch b/third_party/libwebrtc/moz-patch-stack/s0112.patch @@ -10,10 +10,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/27c29807e6f46562d 1 file changed, 1 insertion(+) diff --git a/BUILD.gn b/BUILD.gn -index 9e801948e5..2166174786 100644 +index c2866618aa..ddf7260445 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -612,6 +612,7 @@ if (!build_with_chromium) { +@@ -615,6 +615,7 @@ if (!build_with_chromium) { if (build_with_mozilla) { deps += [ diff --git a/third_party/libwebrtc/moz-patch-stack/s0117.patch b/third_party/libwebrtc/moz-patch-stack/s0117.patch @@ -18,7 +18,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/c8cf67108972d5cae 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc.gni b/webrtc.gni -index 34fae67f24..2b3ec1be86 100644 +index 8c270e335e..67079c13e7 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -145,7 +145,7 @@ declare_args() { diff --git a/third_party/libwebrtc/moz-patch-stack/s0122.patch b/third_party/libwebrtc/moz-patch-stack/s0122.patch @@ -1,22 +1,45 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Fri, 8 Aug 2025 14:18:00 -0500 -Subject: Bug 1980479 - (fix-2f21adc141) turn off rtc_rusty_base64 +Date: Thu, 11 Sep 2025 14:17:00 -0500 +Subject: Bug 1988042 - add BSD support to new version of libwebrtc's + cpu_info.cc r?ng! -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/6038962cc8531f7bac3a58170b052326f5fabf4a +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/e3b37acb8816aefb9134a68cafad8c7d5e145179 --- - webrtc.gni | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + rtc_base/cpu_info.cc | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) -diff --git a/webrtc.gni b/webrtc.gni -index 2b3ec1be86..8bf7f625ba 100644 ---- a/webrtc.gni -+++ b/webrtc.gni -@@ -338,7 +338,7 @@ declare_args() { - rtc_disable_metrics = false +diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc +index 0923e7aca7..2f2108464b 100644 +--- a/rtc_base/cpu_info.cc ++++ b/rtc_base/cpu_info.cc +@@ -21,8 +21,10 @@ + #include <unistd.h> + #elif defined(WEBRTC_FUCHSIA) + #include <zircon/syscalls.h> +-#elif defined(WEBRTC_LINUX) ++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) ++#if defined(WEBRTC_LINUX) + #include <features.h> ++#endif + #include <stdlib.h> + #include <string.h> // IWYU pragma: keep + #include <unistd.h> +@@ -50,7 +52,7 @@ + #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER) + #include <intrin.h> + #endif +-#if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(WEBRTC_LINUX) ++#if defined(WEBRTC_ARCH_ARM_FAMILY) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)) + #include <asm/hwcap.h> + #endif - # Enables an experimental rust version of base64 for building and testing. -- rtc_rusty_base64 = true -+ rtc_rusty_base64 = !build_with_mozilla - } - - declare_args() { +@@ -189,6 +191,9 @@ bool Supports(ISA instruction_set_architecture) { + if (instruction_set_architecture == ISA::kNeon) { + #if defined(WEBRTC_ANDROID) + return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); ++#elif defined(WEBRTC_BSD) ++ // OpenBSD does not have getauxval() and does not have /proc reading ++ return false; + #elif defined(WEBRTC_LINUX) + uint64_t hwcap = 0; + #if WEBRTC_GLIBC_PREREQ(2, 16) diff --git a/third_party/libwebrtc/moz-patch-stack/s0123.patch b/third_party/libwebrtc/moz-patch-stack/s0123.patch @@ -1,45 +1,42 @@ -From: Michael Froman <mfroman@mozilla.com> -Date: Thu, 11 Sep 2025 14:17:00 -0500 -Subject: Bug 1988042 - add BSD support to new version of libwebrtc's - cpu_info.cc r?ng! +From: Michael Froman <mjfroman@mac.com> +Date: Tue, 16 Sep 2025 09:26:22 -0500 +Subject: Bug 1985396 - Cherry-pick upstream libwebrtc commit 73898ac18b -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/e3b37acb8816aefb9134a68cafad8c7d5e145179 +Upstream commit: https://webrtc.googlesource.com/src/+/73898ac18b498c3322f71b9543a2b77f465a47af + APM data dumpers: add missing include + + Currently, audioproc_f fails to build with apm_debug_dump enabled. + + Bug: webrtc:442745059 + Change-Id: I349468891d798341abdaea32042cbe23c4722f75 + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407641 + Commit-Queue: Sam Zackrisson <saza@webrtc.org> + Commit-Queue: Lionel Koenig <lionelk@webrtc.org> + Reviewed-by: Lionel Koenig <lionelk@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45547} --- - rtc_base/cpu_info.cc | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) + modules/audio_processing/logging/apm_data_dumper.cc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc -index 0923e7aca7..2f2108464b 100644 ---- a/rtc_base/cpu_info.cc -+++ b/rtc_base/cpu_info.cc -@@ -21,8 +21,10 @@ - #include <unistd.h> - #elif defined(WEBRTC_FUCHSIA) - #include <zircon/syscalls.h> --#elif defined(WEBRTC_LINUX) -+#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) -+#if defined(WEBRTC_LINUX) - #include <features.h> -+#endif - #include <stdlib.h> - #include <string.h> // IWYU pragma: keep - #include <unistd.h> -@@ -50,7 +52,7 @@ - #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER) - #include <intrin.h> - #endif --#if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(WEBRTC_LINUX) -+#if defined(WEBRTC_ARCH_ARM_FAMILY) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)) - #include <asm/hwcap.h> +diff --git a/modules/audio_processing/logging/apm_data_dumper.cc b/modules/audio_processing/logging/apm_data_dumper.cc +index b26d90fbc8..d86d8d8d3b 100644 +--- a/modules/audio_processing/logging/apm_data_dumper.cc ++++ b/modules/audio_processing/logging/apm_data_dumper.cc +@@ -10,13 +10,16 @@ + + #include "modules/audio_processing/logging/apm_data_dumper.h" + +- + // Check to verify that the define is properly set. + #if !defined(WEBRTC_APM_DEBUG_DUMP) || \ + (WEBRTC_APM_DEBUG_DUMP != 0 && WEBRTC_APM_DEBUG_DUMP != 1) + #error "Set WEBRTC_APM_DEBUG_DUMP to either 0 or 1" #endif -@@ -189,6 +191,9 @@ bool Supports(ISA instruction_set_architecture) { - if (instruction_set_architecture == ISA::kNeon) { - #if defined(WEBRTC_ANDROID) - return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); -+#elif defined(WEBRTC_BSD) -+ // OpenBSD does not have getauxval() and does not have /proc reading -+ return false; - #elif defined(WEBRTC_LINUX) - uint64_t hwcap = 0; - #if WEBRTC_GLIBC_PREREQ(2, 16) ++#if WEBRTC_APM_DEBUG_DUMP == 1 ++#include "rtc_base/strings/string_builder.h" ++#endif ++ + namespace webrtc { + namespace { + diff --git a/third_party/libwebrtc/moz-patch-stack/s0124.patch b/third_party/libwebrtc/moz-patch-stack/s0124.patch @@ -1,42 +1,68 @@ -From: Michael Froman <mjfroman@mac.com> -Date: Tue, 16 Sep 2025 09:26:22 -0500 -Subject: Bug 1985396 - Cherry-pick upstream libwebrtc commit 73898ac18b +From: Michael Froman <mfroman@mozilla.com> +Date: Thu, 18 Sep 2025 12:09:00 -0500 +Subject: Bug 1985396 - Cherry-pick upstream libwebrtc commit 63a59de808 -Upstream commit: https://webrtc.googlesource.com/src/+/73898ac18b498c3322f71b9543a2b77f465a47af - APM data dumpers: add missing include +Upstream commit: https://webrtc.googlesource.com/src/+/63a59de808ba7669e60bded703e71f360e5337e0 + dcsctp: Avoid iterator invalidation - Currently, audioproc_f fails to build with apm_debug_dump enabled. + The ExpireOutstandingChunks method iterated through the + `outstanding_data_` container while conditionally calling + `AbandonAllFor`. The `AbandonAllFor` method can, in some cases, add new + elements to `outstanding_data_`, which invalidates the iterators used by + the loop in `ExpireOutstandingChunks`. This could lead to undefined + behavior. - Bug: webrtc:442745059 - Change-Id: I349468891d798341abdaea32042cbe23c4722f75 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407641 - Commit-Queue: Sam Zackrisson <saza@webrtc.org> - Commit-Queue: Lionel Koenig <lionelk@webrtc.org> - Reviewed-by: Lionel Koenig <lionelk@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45547} + This aligns the C++ implementation to the Rust dcsctp port, which + handles this correctly by using a two-pass approach. + + Bug: chromium:443213199 + Change-Id: Ib5ac73b743c5ed900a69806088780c213536a4a6 + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408002 + Reviewed-by: Emil Lundmark <lndmrk@webrtc.org> + Commit-Queue: Emil Lundmark <lndmrk@webrtc.org> + Auto-Submit: Victor Boivie <boivie@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45566} +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b85c57c2d6f0604075bf639a9a7342ece543cdf1 --- - modules/audio_processing/logging/apm_data_dumper.cc | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + net/dcsctp/tx/outstanding_data.cc | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) -diff --git a/modules/audio_processing/logging/apm_data_dumper.cc b/modules/audio_processing/logging/apm_data_dumper.cc -index b26d90fbc8..d86d8d8d3b 100644 ---- a/modules/audio_processing/logging/apm_data_dumper.cc -+++ b/modules/audio_processing/logging/apm_data_dumper.cc -@@ -10,13 +10,16 @@ - - #include "modules/audio_processing/logging/apm_data_dumper.h" - -- - // Check to verify that the define is properly set. - #if !defined(WEBRTC_APM_DEBUG_DUMP) || \ - (WEBRTC_APM_DEBUG_DUMP != 0 && WEBRTC_APM_DEBUG_DUMP != 1) - #error "Set WEBRTC_APM_DEBUG_DUMP to either 0 or 1" - #endif +diff --git a/net/dcsctp/tx/outstanding_data.cc b/net/dcsctp/tx/outstanding_data.cc +index 074e3c0461..63e750b5fc 100644 +--- a/net/dcsctp/tx/outstanding_data.cc ++++ b/net/dcsctp/tx/outstanding_data.cc +@@ -402,6 +402,7 @@ std::vector<std::pair<TSN, Data>> OutstandingData::GetChunksToBeRetransmitted( + } -+#if WEBRTC_APM_DEBUG_DUMP == 1 -+#include "rtc_base/strings/string_builder.h" -+#endif + void OutstandingData::ExpireOutstandingChunks(Timestamp now) { ++ std::vector<UnwrappedTSN> tsns_to_expire; + UnwrappedTSN tsn = last_cumulative_tsn_ack_; + for (const Item& item : outstanding_data_) { + tsn.Increment(); +@@ -411,15 +412,22 @@ void OutstandingData::ExpireOutstandingChunks(Timestamp now) { + if (item.is_abandoned()) { + // Already abandoned. + } else if (item.is_nacked() && item.has_expired(now)) { +- RTC_DLOG(LS_VERBOSE) << "Marking nacked chunk " << *tsn.Wrap() +- << " and message " << *item.data().mid +- << " as expired"; +- AbandonAllFor(item); ++ tsns_to_expire.push_back(tsn); + } else { + // A non-expired chunk. No need to iterate any further. + break; + } + } + - namespace webrtc { - namespace { ++ for (UnwrappedTSN tsn_to_expire : tsns_to_expire) { ++ // The item is retrieved by TSN, as AbandonAllFor may have modified ++ // `outstanding_data_` and invalidated iterators from the first loop. ++ Item& item = GetItem(tsn_to_expire); ++ RTC_DLOG(LS_WARNING) << "Marking nacked chunk " << *tsn_to_expire.Wrap() ++ << " and message " << *item.data().mid ++ << " as expired"; ++ AbandonAllFor(item); ++ } + RTC_DCHECK(IsConsistent()); + } diff --git a/third_party/libwebrtc/moz-patch-stack/s0125.patch b/third_party/libwebrtc/moz-patch-stack/s0125.patch @@ -1,68 +1,44 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Thu, 18 Sep 2025 12:09:00 -0500 -Subject: Bug 1985396 - Cherry-pick upstream libwebrtc commit 63a59de808 +Date: Wed, 17 Sep 2025 15:41:00 +0000 +Subject: Bug 1988042 - android build fix in + third_party/libwebrtc/rtc_base/cpu_info.cc r?ng! -Upstream commit: https://webrtc.googlesource.com/src/+/63a59de808ba7669e60bded703e71f360e5337e0 - dcsctp: Avoid iterator invalidation +Supports(...) is really used in unittests and outside of unittests +it is only used when WEBRTC_ARCH_X86_FAMILY is defined. For now, +we'll return false when checking for arm/neon suport. - The ExpireOutstandingChunks method iterated through the - `outstanding_data_` container while conditionally calling - `AbandonAllFor`. The `AbandonAllFor` method can, in some cases, add new - elements to `outstanding_data_`, which invalidates the iterators used by - the loop in `ExpireOutstandingChunks`. This could lead to undefined - behavior. - - This aligns the C++ implementation to the Rust dcsctp port, which - handles this correctly by using a two-pass approach. - - Bug: chromium:443213199 - Change-Id: Ib5ac73b743c5ed900a69806088780c213536a4a6 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408002 - Reviewed-by: Emil Lundmark <lndmrk@webrtc.org> - Commit-Queue: Emil Lundmark <lndmrk@webrtc.org> - Auto-Submit: Victor Boivie <boivie@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45566} -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b85c57c2d6f0604075bf639a9a7342ece543cdf1 +Differential Revision: https://phabricator.services.mozilla.com/D265018 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/eae7b6ec4f7ca191e8eaa8e36787142528f2c132 --- - net/dcsctp/tx/outstanding_data.cc | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) + rtc_base/cpu_info.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) -diff --git a/net/dcsctp/tx/outstanding_data.cc b/net/dcsctp/tx/outstanding_data.cc -index 074e3c0461..63e750b5fc 100644 ---- a/net/dcsctp/tx/outstanding_data.cc -+++ b/net/dcsctp/tx/outstanding_data.cc -@@ -402,6 +402,7 @@ std::vector<std::pair<TSN, Data>> OutstandingData::GetChunksToBeRetransmitted( - } - - void OutstandingData::ExpireOutstandingChunks(Timestamp now) { -+ std::vector<UnwrappedTSN> tsns_to_expire; - UnwrappedTSN tsn = last_cumulative_tsn_ack_; - for (const Item& item : outstanding_data_) { - tsn.Increment(); -@@ -411,15 +412,22 @@ void OutstandingData::ExpireOutstandingChunks(Timestamp now) { - if (item.is_abandoned()) { - // Already abandoned. - } else if (item.is_nacked() && item.has_expired(now)) { -- RTC_DLOG(LS_VERBOSE) << "Marking nacked chunk " << *tsn.Wrap() -- << " and message " << *item.data().mid -- << " as expired"; -- AbandonAllFor(item); -+ tsns_to_expire.push_back(tsn); - } else { - // A non-expired chunk. No need to iterate any further. - break; - } - } -+ -+ for (UnwrappedTSN tsn_to_expire : tsns_to_expire) { -+ // The item is retrieved by TSN, as AbandonAllFor may have modified -+ // `outstanding_data_` and invalidated iterators from the first loop. -+ Item& item = GetItem(tsn_to_expire); -+ RTC_DLOG(LS_WARNING) << "Marking nacked chunk " << *tsn_to_expire.Wrap() -+ << " and message " << *item.data().mid -+ << " as expired"; -+ AbandonAllFor(item); -+ } - RTC_DCHECK(IsConsistent()); - } - +diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc +index 2f2108464b..9052fa4931 100644 +--- a/rtc_base/cpu_info.cc ++++ b/rtc_base/cpu_info.cc +@@ -17,7 +17,9 @@ + #elif defined(WEBRTC_MAC) + #include <sys/sysctl.h> + #elif defined(WEBRTC_ANDROID) ++#if !defined(WEBRTC_MOZILLA_BUILD) + #include <cpu-features.h> ++#endif + #include <unistd.h> + #elif defined(WEBRTC_FUCHSIA) + #include <zircon/syscalls.h> +@@ -190,7 +192,14 @@ bool Supports(ISA instruction_set_architecture) { + #elif defined(WEBRTC_ARCH_ARM_FAMILY) + if (instruction_set_architecture == ISA::kNeon) { + #if defined(WEBRTC_ANDROID) ++#if defined(WEBRTC_MOZILLA_BUILD) ++ // We should revisit this if Supports(...) is ever more widely used. ++ // Currently, it is used in unittests and when WEBRTC_ARCH_X86_FAMILY ++ // is defined in non-unittest code. ++ return false; ++#else + return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); ++#endif + #elif defined(WEBRTC_BSD) + // OpenBSD does not have getauxval() and does not have /proc reading + return false; diff --git a/third_party/libwebrtc/moz-patch-stack/s0126.patch b/third_party/libwebrtc/moz-patch-stack/s0126.patch @@ -1,44 +1,39 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Wed, 17 Sep 2025 15:41:00 +0000 -Subject: Bug 1988042 - android build fix in - third_party/libwebrtc/rtc_base/cpu_info.cc r?ng! +Date: Thu, 18 Sep 2025 22:33:00 -0500 +Subject: Bug 1985396 - (fix-38c5a66082) fix windows build failure caused by a + macro expansion -Supports(...) is really used in unittests and outside of unittests -it is only used when WEBRTC_ARCH_X86_FAMILY is defined. For now, -we'll return false when checking for arm/neon suport. +Commit 38c5a66082 adds the include rtc_base/strings/string_builder.h to +third_party/libwebrtc/modules/desktop_capture/desktop_geometry.h, but we +pick this up through a chain of includes in CamerasParent.cpp. On Windows +builds we then get a failure because Shlwapi.h has a macro that expands +StrCat to StrCatW, which means we're changing absl::StrCat to +absl::StrCatW which doesn't exist. -Differential Revision: https://phabricator.services.mozilla.com/D265018 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/eae7b6ec4f7ca191e8eaa8e36787142528f2c132 +We can avoid the desktop_geometry.h include and forward declare +"class DesktopVector" to work around this issue. +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9541460d001e1a62ae567a18d810e35e50ac791c --- - rtc_base/cpu_info.cc | 9 +++++++++ - 1 file changed, 9 insertions(+) + modules/desktop_capture/desktop_capturer.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc -index 2f2108464b..9052fa4931 100644 ---- a/rtc_base/cpu_info.cc -+++ b/rtc_base/cpu_info.cc -@@ -17,7 +17,9 @@ - #elif defined(WEBRTC_MAC) - #include <sys/sysctl.h> - #elif defined(WEBRTC_ANDROID) -+#if !defined(WEBRTC_MOZILLA_BUILD) - #include <cpu-features.h> -+#endif - #include <unistd.h> - #elif defined(WEBRTC_FUCHSIA) - #include <zircon/syscalls.h> -@@ -190,7 +192,14 @@ bool Supports(ISA instruction_set_architecture) { - #elif defined(WEBRTC_ARCH_ARM_FAMILY) - if (instruction_set_architecture == ISA::kNeon) { - #if defined(WEBRTC_ANDROID) -+#if defined(WEBRTC_MOZILLA_BUILD) -+ // We should revisit this if Supports(...) is ever more widely used. -+ // Currently, it is used in unittests and when WEBRTC_ARCH_X86_FAMILY -+ // is defined in non-unittest code. -+ return false; -+#else - return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); -+#endif - #elif defined(WEBRTC_BSD) - // OpenBSD does not have getauxval() and does not have /proc reading - return false; +diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h +index c85d0eba7a..8219358e1e 100644 +--- a/modules/desktop_capture/desktop_capturer.h ++++ b/modules/desktop_capture/desktop_capturer.h +@@ -23,7 +23,6 @@ + #include "modules/desktop_capture/delegated_source_list_controller.h" + #include "modules/desktop_capture/desktop_capture_metadata.h" + #include "modules/desktop_capture/desktop_capture_types.h" +-#include "modules/desktop_capture/desktop_frame.h" + #include "modules/desktop_capture/desktop_geometry.h" + #include "modules/desktop_capture/shared_memory.h" + #include "rtc_base/system/rtc_export.h" +@@ -34,6 +33,7 @@ void RTC_EXPORT LogDesktopCapturerFullscreenDetectorUsage(); + + class DesktopCaptureOptions; + class DesktopFrame; ++class DesktopVector; + + // Abstract interface for screen and window capturers. + class RTC_EXPORT DesktopCapturer { diff --git a/third_party/libwebrtc/moz-patch-stack/s0127.patch b/third_party/libwebrtc/moz-patch-stack/s0127.patch @@ -1,39 +1,22 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Thu, 18 Sep 2025 22:33:00 -0500 -Subject: Bug 1985396 - (fix-38c5a66082) fix windows build failure caused by a +Date: Fri, 19 Sep 2025 10:46:00 -0500 +Subject: Bug 1985396 - (fix-948f6e7a4e) fix windows build failure caused by a macro expansion -Commit 38c5a66082 adds the include rtc_base/strings/string_builder.h to -third_party/libwebrtc/modules/desktop_capture/desktop_geometry.h, but we -pick this up through a chain of includes in CamerasParent.cpp. On Windows -builds we then get a failure because Shlwapi.h has a macro that expands -StrCat to StrCatW, which means we're changing absl::StrCat to -absl::StrCatW which doesn't exist. - -We can avoid the desktop_geometry.h include and forward declare -"class DesktopVector" to work around this issue. -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9541460d001e1a62ae567a18d810e35e50ac791c +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/5368b134e503299a9cef8590ec91fbc3cf4dcc8a --- - modules/desktop_capture/desktop_capturer.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + modules/desktop_capture/desktop_capturer.h | 1 - + 1 file changed, 1 deletion(-) diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h -index c85d0eba7a..8219358e1e 100644 +index 8219358e1e..9b1efa0bb5 100644 --- a/modules/desktop_capture/desktop_capturer.h +++ b/modules/desktop_capture/desktop_capturer.h @@ -23,7 +23,6 @@ #include "modules/desktop_capture/delegated_source_list_controller.h" #include "modules/desktop_capture/desktop_capture_metadata.h" #include "modules/desktop_capture/desktop_capture_types.h" --#include "modules/desktop_capture/desktop_frame.h" - #include "modules/desktop_capture/desktop_geometry.h" +-#include "modules/desktop_capture/desktop_geometry.h" #include "modules/desktop_capture/shared_memory.h" #include "rtc_base/system/rtc_export.h" -@@ -34,6 +33,7 @@ void RTC_EXPORT LogDesktopCapturerFullscreenDetectorUsage(); - - class DesktopCaptureOptions; - class DesktopFrame; -+class DesktopVector; - // Abstract interface for screen and window capturers. - class RTC_EXPORT DesktopCapturer { diff --git a/third_party/libwebrtc/moz-patch-stack/s0128.patch b/third_party/libwebrtc/moz-patch-stack/s0128.patch @@ -1,22 +1,47 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Fri, 19 Sep 2025 10:46:00 -0500 -Subject: Bug 1985396 - (fix-948f6e7a4e) fix windows build failure caused by a - macro expansion +Date: Wed, 8 Oct 2025 17:49:00 +0000 +Subject: Bug 1980501 - use forward class decl rather than include + audio_state.h r?ng! -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/5368b134e503299a9cef8590ec91fbc3cf4dcc8a +This avoids code outside of libwebrtc inadvertently including +rtc_base/containers/flat_set.h which uses c++20 features. Once +the rest of the Mozilla tree is compiling with c++20, we can +remove this modification (see Bug 1768116). + +Differential Revision: https://phabricator.services.mozilla.com/D267993 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9c487a574d218cc1c261b646c501db4d159754f0 --- - modules/desktop_capture/desktop_capturer.h | 1 - - 1 file changed, 1 deletion(-) + audio/audio_receive_stream.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) -diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h -index 8219358e1e..9b1efa0bb5 100644 ---- a/modules/desktop_capture/desktop_capturer.h -+++ b/modules/desktop_capture/desktop_capturer.h -@@ -23,7 +23,6 @@ - #include "modules/desktop_capture/delegated_source_list_controller.h" - #include "modules/desktop_capture/desktop_capture_metadata.h" - #include "modules/desktop_capture/desktop_capture_types.h" --#include "modules/desktop_capture/desktop_geometry.h" - #include "modules/desktop_capture/shared_memory.h" - #include "rtc_base/system/rtc_export.h" +diff --git a/audio/audio_receive_stream.h b/audio/audio_receive_stream.h +index 0d78482e0e..d7ebd8c9d1 100644 +--- a/audio/audio_receive_stream.h ++++ b/audio/audio_receive_stream.h +@@ -32,7 +32,11 @@ + #include "api/scoped_refptr.h" + #include "api/sequence_checker.h" + #include "api/transport/rtp/rtp_source.h" ++// This can be removed after Bug 1768116 enables ++// c++20 builds across the entire Mozilla tree. ++#if !defined(WEBRTC_MOZILLA_BUILD) + #include "audio/audio_state.h" ++#endif + #include "call/audio_receive_stream.h" + #include "call/audio_state.h" + #include "call/syncable.h" +@@ -44,6 +48,14 @@ class PacketRouter; + class RtpStreamReceiverControllerInterface; + class RtpStreamReceiverInterface; ++// This can be removed after Bug 1768116 enables ++// c++20 builds across the entire Mozilla tree. ++#if defined(WEBRTC_MOZILLA_BUILD) ++namespace internal { ++class AudioState; ++} ++#endif ++ + namespace voe { + class ChannelReceiveInterface; + } // namespace voe diff --git a/third_party/libwebrtc/moz-patch-stack/s0129.patch b/third_party/libwebrtc/moz-patch-stack/s0129.patch @@ -1,47 +1,41 @@ From: Michael Froman <mfroman@mozilla.com> Date: Wed, 8 Oct 2025 17:49:00 +0000 -Subject: Bug 1980501 - use forward class decl rather than include - audio_state.h r?ng! +Subject: Bug 1980501 - enable c++20 builds in libwebrtc. r?ng! -This avoids code outside of libwebrtc inadvertently including -rtc_base/containers/flat_set.h which uses c++20 features. Once -the rest of the Mozilla tree is compiling with c++20, we can -remove this modification (see Bug 1768116). - -Differential Revision: https://phabricator.services.mozilla.com/D267993 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9c487a574d218cc1c261b646c501db4d159754f0 +Differential Revision: https://phabricator.services.mozilla.com/D267994 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/43de54a6e52daf0a06956ae01951ef1e29d46e82 --- - audio/audio_receive_stream.h | 12 ++++++++++++ - 1 file changed, 12 insertions(+) + BUILD.gn | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) -diff --git a/audio/audio_receive_stream.h b/audio/audio_receive_stream.h -index 0d78482e0e..d7ebd8c9d1 100644 ---- a/audio/audio_receive_stream.h -+++ b/audio/audio_receive_stream.h -@@ -32,7 +32,11 @@ - #include "api/scoped_refptr.h" - #include "api/sequence_checker.h" - #include "api/transport/rtp/rtp_source.h" -+// This can be removed after Bug 1768116 enables -+// c++20 builds across the entire Mozilla tree. -+#if !defined(WEBRTC_MOZILLA_BUILD) - #include "audio/audio_state.h" -+#endif - #include "call/audio_receive_stream.h" - #include "call/audio_state.h" - #include "call/syncable.h" -@@ -44,6 +48,14 @@ class PacketRouter; - class RtpStreamReceiverControllerInterface; - class RtpStreamReceiverInterface; +diff --git a/BUILD.gn b/BUILD.gn +index ddf7260445..4a96ff7ae1 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -315,6 +315,17 @@ config("common_config") { + cflags_objc = [] + defines = [] -+// This can be removed after Bug 1768116 enables -+// c++20 builds across the entire Mozilla tree. -+#if defined(WEBRTC_MOZILLA_BUILD) -+namespace internal { -+class AudioState; -+} -+#endif ++ # We should be able to remove this after c++20 is enabled ++ # across the Mozilla tree. ++ if (build_with_mozilla) { ++ if (is_win) { ++ cflags_cc += [ "-std:c++20" ] ++ } ++ else { ++ cflags_cc += [ "-std=gnu++20" ] ++ } ++ } + - namespace voe { - class ChannelReceiveInterface; - } // namespace voe + if (rtc_enable_protobuf) { + defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ] + } else { +@@ -416,7 +427,7 @@ config("common_config") { + # "-Wnested-externs", (C/Obj-C only) + ] + cflags_objc += [ "-Wstrict-prototypes" ] +- cflags_cc = [ ++ cflags_cc += [ + "-Wnon-virtual-dtor", + + # This is enabled for clang; enable for gcc as well. diff --git a/third_party/libwebrtc/moz-patch-stack/s0130.patch b/third_party/libwebrtc/moz-patch-stack/s0130.patch @@ -1,41 +1,23 @@ From: Michael Froman <mfroman@mozilla.com> -Date: Wed, 8 Oct 2025 17:49:00 +0000 -Subject: Bug 1980501 - enable c++20 builds in libwebrtc. r?ng! +Date: Wed, 8 Oct 2025 16:39:00 -0500 +Subject: Bug 1993083 - (fix-032f8c223e) add missing stub implementation for + SSLStreamAdapter static method. -Differential Revision: https://phabricator.services.mozilla.com/D267994 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/43de54a6e52daf0a06956ae01951ef1e29d46e82 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/293f1877fead30723696b8f5cb354bdf819af5d3 --- - BUILD.gn | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) + rtc_base/ssl_stream_adapter.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/BUILD.gn b/BUILD.gn -index 2166174786..f80f81a6fd 100644 ---- a/BUILD.gn -+++ b/BUILD.gn -@@ -313,6 +313,17 @@ config("common_config") { - cflags_objc = [] - defines = [] +diff --git a/rtc_base/ssl_stream_adapter.h b/rtc_base/ssl_stream_adapter.h +index 24fc299b82..ec16887eac 100644 +--- a/rtc_base/ssl_stream_adapter.h ++++ b/rtc_base/ssl_stream_adapter.h +@@ -247,7 +247,7 @@ class SSLStreamAdapter : public StreamInterface { + static std::set<uint16_t> GetSupportedEphemeralKeyExchangeCipherGroups() + { return {}; } + static std::optional<std::string> GetEphemeralKeyExchangeCipherGroupName( +- uint16_t group_id); ++ uint16_t group_id) { return std::nullopt; } + static std::vector<uint16_t> GetDefaultEphemeralKeyExchangeCipherGroups( + const FieldTrialsView* field_trials) { return {}; } -+ # We should be able to remove this after c++20 is enabled -+ # across the Mozilla tree. -+ if (build_with_mozilla) { -+ if (is_win) { -+ cflags_cc += [ "-std:c++20" ] -+ } -+ else { -+ cflags_cc += [ "-std=gnu++20" ] -+ } -+ } -+ - if (rtc_enable_protobuf) { - defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ] - } else { -@@ -414,7 +425,7 @@ config("common_config") { - # "-Wnested-externs", (C/Obj-C only) - ] - cflags_objc += [ "-Wstrict-prototypes" ] -- cflags_cc = [ -+ cflags_cc += [ - "-Wnon-virtual-dtor", - - # This is enabled for clang; enable for gcc as well. diff --git a/third_party/libwebrtc/moz-patch-stack/s0131.patch b/third_party/libwebrtc/moz-patch-stack/s0131.patch @@ -1,23 +0,0 @@ -From: Michael Froman <mfroman@mozilla.com> -Date: Wed, 8 Oct 2025 16:39:00 -0500 -Subject: Bug 1993083 - (fix-032f8c223e) add missing stub implementation for - SSLStreamAdapter static method. - -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/293f1877fead30723696b8f5cb354bdf819af5d3 ---- - rtc_base/ssl_stream_adapter.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/rtc_base/ssl_stream_adapter.h b/rtc_base/ssl_stream_adapter.h -index 24fc299b82..ec16887eac 100644 ---- a/rtc_base/ssl_stream_adapter.h -+++ b/rtc_base/ssl_stream_adapter.h -@@ -247,7 +247,7 @@ class SSLStreamAdapter : public StreamInterface { - static std::set<uint16_t> GetSupportedEphemeralKeyExchangeCipherGroups() - { return {}; } - static std::optional<std::string> GetEphemeralKeyExchangeCipherGroupName( -- uint16_t group_id); -+ uint16_t group_id) { return std::nullopt; } - static std::vector<uint16_t> GetDefaultEphemeralKeyExchangeCipherGroups( - const FieldTrialsView* field_trials) { return {}; } - diff --git a/third_party/libwebrtc/rtc_base/BUILD.gn b/third_party/libwebrtc/rtc_base/BUILD.gn @@ -1870,77 +1870,46 @@ rtc_library("task_queue_for_test") { ] } -rtc_library("base64") { - sources = [ - "base64.cc", - "base64.h", - ] - deps = [ - "../api:array_view", - "//third_party/abseil-cpp/absl/algorithm:container", - "//third_party/abseil-cpp/absl/strings", - "//third_party/abseil-cpp/absl/strings:string_view", - ] -} - -if (rtc_rusty_base64) { - import("//chromium/build/config/rust.gni") - import("//chromium/build/rust/rust_static_library.gni") - - rtc_source_set("base64_header") { - sources = [ "base64.h" ] +# Base64 implementation is backed by either Rust or Abseil. +if (!rtc_rusty_base64) { + # abseil backed base64. + rtc_library("base64") { + sources = [ + "base64.cc", + "base64.h", + ] deps = [ "../api:array_view", + "//third_party/abseil-cpp/absl/algorithm:container", + "//third_party/abseil-cpp/absl/strings", "//third_party/abseil-cpp/absl/strings:string_view", ] } +} else { + import("//chromium/build/config/rust.gni") + import("//chromium/build/rust/rust_static_library.gni") rust_static_library("base64_rust_bridge") { allow_unsafe = true # Needed for FFI with cxx crate. crate_root = "base64.rs" sources = [ "base64.rs" ] cxx_bindings = [ "base64.rs" ] - deps = [ - ":base64_header", - "//third_party/rust/base64/v0_22:lib", - ] - visibility = [ ":rusty_base64" ] + deps = [ "//third_party/rust/base64/v0_22:lib" ] + visibility = [ ":base64" ] } - rtc_library("rusty_base64") { - sources = [ "base64_rust.cc" ] + rtc_library("base64") { + sources = [ + "base64.h", + "base64_rust.cc", + ] deps = [ - ":base64_header", ":base64_rust_bridge", + "../api:array_view", "//build/rust:cxx_cppdeps", "//third_party/abseil-cpp/absl/strings:string_view", ] } - - if (rtc_include_tests) { - rtc_test("rusty_base64_unittest") { - sources = [ "base64_unittest.cc" ] - deps = [ - ":base64_header", - ":rusty_base64", - "../test:test_main", - "../test:test_support", - "//third_party/abseil-cpp/absl/strings:string_view", - ] - } - - if (rtc_enable_google_benchmarks) { - rtc_test("rusty_base64_benchmark") { - sources = [ "base64_benchmark.cc" ] - deps = [ - ":base64_header", - ":rusty_base64", - "../test:benchmark_main", - "//third_party/google_benchmark", - ] - } - } - } } rtc_library("cpu_info") { diff --git a/third_party/libwebrtc/rtc_base/base64.rs b/third_party/libwebrtc/rtc_base/base64.rs @@ -18,21 +18,16 @@ use std::pin::Pin; #[cxx::bridge(namespace = "webrtc")] mod ffi { #[repr(u8)] - enum Base64DecodeOptions { - kStrict, - kForgiving, - } - - extern "C++" { - include!("rtc_base/base64.h"); - type Base64DecodeOptions; + enum Base64DecodeSetting { + Strict, + Forgiving, } extern "Rust" { fn rs_base64_encode(data: &[u8]) -> String; fn rs_base64_decode( data: &[u8], - options: Base64DecodeOptions, + options: Base64DecodeSetting, output: Pin<&mut CxxString>, ) -> bool; } @@ -50,12 +45,12 @@ const FORGIVING_ENGINE: general_purpose::GeneralPurpose = general_purpose::Gener fn rs_base64_decode( data: &[u8], - options: ffi::Base64DecodeOptions, + options: ffi::Base64DecodeSetting, output: Pin<&mut CxxString>, ) -> bool { let result = match options { - ffi::Base64DecodeOptions::kStrict => general_purpose::STANDARD.decode(data), - ffi::Base64DecodeOptions::kForgiving => { + ffi::Base64DecodeSetting::Strict => general_purpose::STANDARD.decode(data), + ffi::Base64DecodeSetting::Forgiving => { let data_without_whitespace: Vec<u8> = data.iter().filter(|&c| !c.is_ascii_whitespace()).copied().collect(); FORGIVING_ENGINE.decode(data_without_whitespace) diff --git a/third_party/libwebrtc/rtc_base/base64_rust.cc b/third_party/libwebrtc/rtc_base/base64_rust.cc @@ -19,6 +19,19 @@ namespace webrtc { +namespace { + +Base64DecodeSetting ToRustDecodeSetting(Base64DecodeOptions options) { + switch (options) { + case Base64DecodeOptions::kStrict: + return Base64DecodeSetting::Strict; + case Base64DecodeOptions::kForgiving: + return Base64DecodeSetting::Forgiving; + } +} + +} // namespace + std::string Base64Encode(absl::string_view data) { rust::Slice<const uint8_t> input_slice( reinterpret_cast<const uint8_t*>(data.data()), data.size()); @@ -32,7 +45,7 @@ std::optional<std::string> Base64Decode(absl::string_view data, rust::Slice<const uint8_t> input_slice( reinterpret_cast<const uint8_t*>(data.data()), data.size()); std::string output; - if (!rs_base64_decode(input_slice, options, output)) { + if (!rs_base64_decode(input_slice, ToRustDecodeSetting(options), output)) { return std::nullopt; } return output; diff --git a/third_party/libwebrtc/webrtc.gni b/third_party/libwebrtc/webrtc.gni @@ -338,7 +338,7 @@ declare_args() { rtc_disable_metrics = false # Enables an experimental rust version of base64 for building and testing. - rtc_rusty_base64 = !build_with_mozilla + rtc_rusty_base64 = false } declare_args() {