commit 8ecde916038ff5c4e43e9a04af9deb49baeebf31
parent 0a9d0d475a099ffe6e1a42c14b438d1e4010acbc
Author: Dan Baker <dbaker@mozilla.com>
Date: Thu, 20 Nov 2025 13:09:53 -0700
Bug 2000941 - Vendor libwebrtc from 73898ac18b
We cherry-picked this in bug 1985396
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}
Diffstat:
13 files changed, 313 insertions(+), 356 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-20T20:07:10.185763+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-11-20T20:09:41.325349+00:00.
# base of lastest vendoring
-15bb3e5cb4
+73898ac18b
diff --git a/third_party/libwebrtc/moz-patch-stack/73898ac18b.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/73898ac18b.no-op-cherry-pick-msg
@@ -1 +0,0 @@
-We cherry-picked this in bug 1985396
diff --git a/third_party/libwebrtc/moz-patch-stack/s0122.patch b/third_party/libwebrtc/moz-patch-stack/s0122.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/s0123.patch b/third_party/libwebrtc/moz-patch-stack/s0123.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 f0bff56911..b51c9e950e 100644
+--- a/rtc_base/cpu_info.cc
++++ b/rtc_base/cpu_info.cc
+@@ -25,7 +25,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>
+@@ -175,7 +177,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/s0124.patch b/third_party/libwebrtc/moz-patch-stack/s0124.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 f0bff56911..b51c9e950e 100644
---- a/rtc_base/cpu_info.cc
-+++ b/rtc_base/cpu_info.cc
-@@ -25,7 +25,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>
-@@ -175,7 +177,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/s0125.patch b/third_party/libwebrtc/moz-patch-stack/s0125.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/s0126.patch b/third_party/libwebrtc/moz-patch-stack/s0126.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 4b6c57b871..3f054776d2 100644
+--- a/audio/audio_receive_stream.h
++++ b/audio/audio_receive_stream.h
+@@ -34,7 +34,11 @@
+ #include "api/transport/rtp/rtp_source.h"
+ #include "api/units/time_delta.h"
+ #include "api/units/timestamp.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"
+@@ -47,6 +51,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/s0127.patch b/third_party/libwebrtc/moz-patch-stack/s0127.patch
@@ -1,47 +1,40 @@
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 | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
-diff --git a/audio/audio_receive_stream.h b/audio/audio_receive_stream.h
-index 4b6c57b871..3f054776d2 100644
---- a/audio/audio_receive_stream.h
-+++ b/audio/audio_receive_stream.h
-@@ -34,7 +34,11 @@
- #include "api/transport/rtp/rtp_source.h"
- #include "api/units/time_delta.h"
- #include "api/units/timestamp.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"
-@@ -47,6 +51,14 @@ class PacketRouter;
- class RtpStreamReceiverControllerInterface;
- class RtpStreamReceiverInterface;
+diff --git a/BUILD.gn b/BUILD.gn
+index 8240fc84d6..a3b738a7e1 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -315,6 +315,16 @@ 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 {
+@@ -420,7 +430,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/s0128.patch b/third_party/libwebrtc/moz-patch-stack/s0128.patch
@@ -1,40 +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 | 12 +++++++++++-
- 1 file changed, 11 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 8240fc84d6..a3b738a7e1 100644
---- a/BUILD.gn
-+++ b/BUILD.gn
-@@ -315,6 +315,16 @@ 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 {
-@@ -420,7 +430,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/s0129.patch b/third_party/libwebrtc/moz-patch-stack/s0129.patch
@@ -1,23 +1,22 @@
-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.
+From: Jan-Ivar Bruaroey <jib@mozilla.com>
+Date: Wed, 8 Oct 2025 17:05:00 +0000
+Subject: Bug 1868223 - Add api:frame_transformer_factory to BUILD.gn r=mjf
-Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/293f1877fead30723696b8f5cb354bdf819af5d3
+Differential Revision: https://phabricator.services.mozilla.com/D267541
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8e7778c59894c284b8bddd39b731e999fe2e807c
---
- rtc_base/ssl_stream_adapter.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ BUILD.gn | 1 +
+ 1 file changed, 1 insertion(+)
-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/BUILD.gn b/BUILD.gn
+index a3b738a7e1..2b3e510f76 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -629,6 +629,7 @@ if (!build_with_chromium) {
+ if (build_with_mozilla) {
+ deps += [
++ "api:frame_transformer_factory",
+ "api/audio:builtin_audio_processing_builder",
+ "api/environment:environment_factory",
+ "api/video:video_frame",
diff --git a/third_party/libwebrtc/moz-patch-stack/s0130.patch b/third_party/libwebrtc/moz-patch-stack/s0130.patch
@@ -1,22 +1,25 @@
-From: Jan-Ivar Bruaroey <jib@mozilla.com>
-Date: Wed, 8 Oct 2025 17:05:00 +0000
-Subject: Bug 1868223 - Add api:frame_transformer_factory to BUILD.gn r=mjf
+From: Landry Breuil <landry@rhaalovely.net>
+Date: Mon, 27 Oct 2025 17:42:00 +0000
+Subject: Bug 1994630: fix build on OpenBSD/arm64 after bug 1988042 r=mjf
-Differential Revision: https://phabricator.services.mozilla.com/D267541
-Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8e7778c59894c284b8bddd39b731e999fe2e807c
+we return false on BSD in Supports(), so no need to include something which doesn't exist
+
+Differential Revision: https://phabricator.services.mozilla.com/D268827
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/6bcf80824ecafc424e41b136705ba08370d66254
---
- BUILD.gn | 1 +
- 1 file changed, 1 insertion(+)
+ rtc_base/cpu_info.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/BUILD.gn b/BUILD.gn
-index a3b738a7e1..2b3e510f76 100644
---- a/BUILD.gn
-+++ b/BUILD.gn
-@@ -629,6 +629,7 @@ if (!build_with_chromium) {
-
- if (build_with_mozilla) {
- deps += [
-+ "api:frame_transformer_factory",
- "api/audio:builtin_audio_processing_builder",
- "api/environment:environment_factory",
- "api/video:video_frame",
+diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc
+index b51c9e950e..d8469535c6 100644
+--- a/rtc_base/cpu_info.cc
++++ b/rtc_base/cpu_info.cc
+@@ -38,7 +38,7 @@
+ #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER)
+ #include <intrin.h>
+ #endif
+-#if defined(WEBRTC_ARCH_ARM_FAMILY) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD))
++#if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(WEBRTC_LINUX)
+ #include <asm/hwcap.h>
+ #include <sys/auxv.h>
+ #endif
diff --git a/third_party/libwebrtc/moz-patch-stack/s0131.patch b/third_party/libwebrtc/moz-patch-stack/s0131.patch
@@ -1,25 +1,42 @@
-From: Landry Breuil <landry@rhaalovely.net>
-Date: Mon, 27 Oct 2025 17:42:00 +0000
-Subject: Bug 1994630: fix build on OpenBSD/arm64 after bug 1988042 r=mjf
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
+Date: Wed, 12 Nov 2025 05:17:00 +0000
+Subject: Bug 1768116 - Compile as C++20. r=glandium,webrtc-reviewers,mjf
-we return false on BSD in Supports(), so no need to include something which doesn't exist
+Co-authored-by: Chris Peterson <cpeterson@mozilla.com>
-Differential Revision: https://phabricator.services.mozilla.com/D268827
-Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/6bcf80824ecafc424e41b136705ba08370d66254
+Differential Revision: https://phabricator.services.mozilla.com/D271779
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/a076ddec60822b1d20f39dd468e025f712b3ba4d
---
- rtc_base/cpu_info.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ BUILD.gn | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
-diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc
-index b51c9e950e..d8469535c6 100644
---- a/rtc_base/cpu_info.cc
-+++ b/rtc_base/cpu_info.cc
-@@ -38,7 +38,7 @@
- #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER)
- #include <intrin.h>
- #endif
--#if defined(WEBRTC_ARCH_ARM_FAMILY) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD))
-+#if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(WEBRTC_LINUX)
- #include <asm/hwcap.h>
- #include <sys/auxv.h>
- #endif
+diff --git a/BUILD.gn b/BUILD.gn
+index 2b3e510f76..b7b2edb51f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -315,16 +315,6 @@ config("common_config") {
+ cflags_objc = []
+ defines = []
+
+- # 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 {
+@@ -430,7 +420,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/s0132.patch b/third_party/libwebrtc/moz-patch-stack/s0132.patch
@@ -1,42 +0,0 @@
-From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
-Date: Wed, 12 Nov 2025 05:17:00 +0000
-Subject: Bug 1768116 - Compile as C++20. r=glandium,webrtc-reviewers,mjf
-
-Co-authored-by: Chris Peterson <cpeterson@mozilla.com>
-
-Differential Revision: https://phabricator.services.mozilla.com/D271779
-Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/a076ddec60822b1d20f39dd468e025f712b3ba4d
----
- BUILD.gn | 12 +-----------
- 1 file changed, 1 insertion(+), 11 deletions(-)
-
-diff --git a/BUILD.gn b/BUILD.gn
-index 2b3e510f76..b7b2edb51f 100644
---- a/BUILD.gn
-+++ b/BUILD.gn
-@@ -315,16 +315,6 @@ config("common_config") {
- cflags_objc = []
- defines = []
-
-- # 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 {
-@@ -430,7 +420,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.