tor-browser

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

commit b9753860aece36e4e39fcd132c497ff3066abb8a
parent 51ba6835592cf8ac76843ac7e9ebfc897d91e7f1
Author: Michael Froman <mfroman@mozilla.com>
Date:   Wed,  8 Oct 2025 16:06:54 -0500

Bug 1993083 - Vendor libwebrtc from 306f5a67ac

We cherry-picked this in bug 1990526

Upstream commit: https://webrtc.googlesource.com/src/+/306f5a67ac952956ecec09fb1ec7ecfd4f593c60
    Revert "Enable scenario test for L4S"

    This reverts commit d8507ca5eb936c46e9b35baab2090522f6d0a6fd.

    Reason for revert: Reverting https://webrtc-review.googlesource.com/c/src/+/396640 to investigate a downstream issue. This CL depends on https://webrtc-review.googlesource.com/c/src/+/396640 so to have a clean revert let's revert this one as well.

    Bug: webrtc:42225697, webrtc:383078466
    Original change's description:
    > Enable scenario test for L4S
    >
    > The fix has landed.
    >
    > Bug: webrtc:42225697, webrtc:383078466
    > Change-Id: I9838c9ed582ddef05d5d1593c5a3e6d9a60543aa
    > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396802
    > Reviewed-by: Per Kjellander <perkj@webrtc.org>
    > Commit-Queue: Per Kjellander <perkj@webrtc.org>
    > Auto-Submit: Harald Alvestrand <hta@webrtc.org>
    > Cr-Commit-Position: refs/heads/main@{#44955}

    No-Try: True
    Bug: webrtc:42225697, webrtc:383078466, b/425662432, b/426394283
    Change-Id: Id2bd39bfb1690539eb8219d666fd1a82a8b297b6
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397880
    Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
    Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
    Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45010}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Dthird_party/libwebrtc/moz-patch-stack/306f5a67ac.no-op-cherry-pick-msg | 1-
Mthird_party/libwebrtc/moz-patch-stack/s0129.patch | 309++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
Mthird_party/libwebrtc/moz-patch-stack/s0130.patch | 319+++++++++++--------------------------------------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/s0131.patch | 74++++++++++++++++++++++++++++++++++----------------------------------------
Dthird_party/libwebrtc/moz-patch-stack/s0132.patch | 41-----------------------------------------
6 files changed, 346 insertions(+), 402 deletions(-)

diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T21:05:27.160993+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T21:06:44.794895+00:00. # base of lastest vendoring -9b3d4e8e23 +306f5a67ac diff --git a/third_party/libwebrtc/moz-patch-stack/306f5a67ac.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/306f5a67ac.no-op-cherry-pick-msg @@ -1 +0,0 @@ -We cherry-picked this in bug 1990526 diff --git a/third_party/libwebrtc/moz-patch-stack/s0129.patch b/third_party/libwebrtc/moz-patch-stack/s0129.patch @@ -1,55 +1,282 @@ From: Michael Froman <mjfroman@mac.com> -Date: Wed, 24 Sep 2025 16:14:15 -0500 -Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit 306f5a67ac r?ng +Date: Wed, 24 Sep 2025 16:16:38 -0500 +Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit d27b4ef208 r?ng -Upstream commit: https://webrtc.googlesource.com/src/+/306f5a67ac952956ecec09fb1ec7ecfd4f593c60 - Revert "Enable scenario test for L4S" +Upstream commit: https://webrtc.googlesource.com/src/+/d27b4ef20820c2aeef358b4a465a8b514517b9f3 + Revert "Change SetLocalContent / SetRemoteContent to update header extensions" - This reverts commit d8507ca5eb936c46e9b35baab2090522f6d0a6fd. + This reverts commit 9496cc0e1b8cc50185ded19522b68d7c94c17298. - Reason for revert: Reverting https://webrtc-review.googlesource.com/c/src/+/396640 to investigate a downstream issue. This CL depends on https://webrtc-review.googlesource.com/c/src/+/396640 so to have a clean revert let's revert this one as well. + Reason for revert: Investigating downstream issue. - Bug: webrtc:42225697, webrtc:383078466 + Bug: webrtc:383078466 Original change's description: - > Enable scenario test for L4S + > Change SetLocalContent / SetRemoteContent to update header extensions > - > The fix has landed. + > The functions were skipping over updating the sender and receiver when + > the list of header extensions was changed. Now it should be better. > - > Bug: webrtc:42225697, webrtc:383078466 - > Change-Id: I9838c9ed582ddef05d5d1593c5a3e6d9a60543aa - > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396802 + > Bug: webrtc:383078466, b/425662432, b/426394283 + > Change-Id: I1b93ed1ba4bbbf6c5b13861a6e21a7a7c82a5a66 + > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396640 > Reviewed-by: Per Kjellander <perkj@webrtc.org> - > Commit-Queue: Per Kjellander <perkj@webrtc.org> - > Auto-Submit: Harald Alvestrand <hta@webrtc.org> - > Cr-Commit-Position: refs/heads/main@{#44955} + > Commit-Queue: Harald Alvestrand <hta@webrtc.org> + > Cr-Commit-Position: refs/heads/main@{#44951} - No-Try: True - Bug: webrtc:42225697, webrtc:383078466, b/425662432, b/426394283 - Change-Id: Id2bd39bfb1690539eb8219d666fd1a82a8b297b6 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397880 - Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> + Bug: webrtc:383078466 + Change-Id: Ie6db6d995021a8699c1c7aa91334ea0ea0e37c1f + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397820 + Reviewed-by: Per Kjellander <perkj@webrtc.org> + Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> - Reviewed-by: Harald Alvestrand <hta@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45010} + Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> + Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> + Cr-Commit-Position: refs/heads/main@{#45012} --- - test/peer_scenario/tests/l4s_test.cc | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) + media/base/codec.h | 3 -- + pc/channel.cc | 15 ++---- + pc/channel_unittest.cc | 24 ++++------ + pc/congestion_control_integrationtest.cc | 58 ++---------------------- + pc/peer_connection_integrationtest.cc | 14 ++---- + 5 files changed, 20 insertions(+), 94 deletions(-) -diff --git a/test/peer_scenario/tests/l4s_test.cc b/test/peer_scenario/tests/l4s_test.cc -index 378ea2e746..ce110f9bf0 100644 ---- a/test/peer_scenario/tests/l4s_test.cc -+++ b/test/peer_scenario/tests/l4s_test.cc -@@ -185,7 +185,11 @@ TEST(L4STest, NegotiateAndUseCcfbIfEnabled) { - - s.ProcessMessages(TimeDelta::Seconds(2)); - EXPECT_GT(send_node_feedback_counter.FeedbackAccordingToRfc8888(), 0); -- EXPECT_EQ(send_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); -+ // TODO: bugs.webrtc.org/42225697 - Fix bug. Caller sends both transport -+ // sequence number feedback and congestion control feedback. So -+ // callee still send packets with transport sequence number header extensions -+ // even though it has been removed from the answer. -+ // EXPECT_EQ(send_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); - - EXPECT_GT(ret_node_feedback_counter.FeedbackAccordingToRfc8888(), 0); - EXPECT_EQ(ret_node_feedback_counter.FeedbackAccordingToTransportCc(), 0); +diff --git a/media/base/codec.h b/media/base/codec.h +index e26306df20..694589dd14 100644 +--- a/media/base/codec.h ++++ b/media/base/codec.h +@@ -192,9 +192,6 @@ struct RTC_EXPORT Codec { + sink.Append("video/"); + } + absl::Format(&sink, "%s/%d/%d", c.name, c.clockrate, c.channels); +- if (c.packetization) { +- absl::Format(&sink, ",packetization=%s", *c.packetization); +- } + for (auto param : c.params) { + sink.Append(";"); + sink.Append(param.first); +diff --git a/pc/channel.cc b/pc/channel.cc +index 8b8d7a7ffb..1ab970f245 100644 +--- a/pc/channel.cc ++++ b/pc/channel.cc +@@ -99,7 +99,7 @@ void MediaChannelParametersFromMediaDescription( + desc->type() == MediaType::VIDEO); + params->is_stream_active = is_stream_active; + params->codecs = desc->codecs(); +- // TODO: bugs.webrtc.org/11513 - See if we really need ++ // TODO(bugs.webrtc.org/11513): See if we really need + // rtp_header_extensions_set() and remove it if we don't. + if (desc->rtp_header_extensions_set()) { + params->extensions = extensions; +@@ -915,6 +915,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, + } + } + } ++ + last_recv_params_ = recv_params; + + if (!UpdateLocalStreams_w(content->streams(), type, error_desc)) { +@@ -925,7 +926,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, + set_local_content_direction(content->direction()); + UpdateMediaSendRecvState_w(); + +- // Disabled because suggesting PTs takes thread jumps. ++ // Disabled because suggeting PTs takes thread jumps. + // TODO: https://issues.webrtc.org/360058654 - reenable after cleanup + // RTC_DCHECK_BLOCK_COUNT_NO_MORE_THAN(0); + +@@ -1041,6 +1042,7 @@ bool VideoChannel::SetLocalContent_w(const MediaContentDescription* content, + media_send_channel()->SetExtmapAllowMixed(content->extmap_allow_mixed()); + + VideoReceiverParameters recv_params = last_recv_params_; ++ + MediaChannelParametersFromMediaDescription( + content, header_extensions, + RtpTransceiverDirectionHasRecv(content->direction()), &recv_params); +@@ -1115,12 +1117,7 @@ bool VideoChannel::SetLocalContent_w(const MediaContentDescription* content, + + last_recv_params_ = recv_params; + +- // Also update send parameters if header extensions are changed. +- needs_send_params_update |= +- (last_send_params_.extensions != header_extensions && +- !send_params.codecs.empty()); + if (needs_send_params_update) { +- send_params.extensions = header_extensions; + if (!media_send_channel()->SetSenderParameters(send_params)) { + error_desc = StringFormat( + "Failed to set send parameters for m-section with mid='%s'.", +@@ -1231,11 +1228,7 @@ bool VideoChannel::SetRemoteContent_w(const MediaContentDescription* content, + media_send_channel()->SendCodecRtxTime()); + last_send_params_ = send_params; + +- needs_recv_params_update |= +- (recv_params.extensions != send_params.extensions && +- !recv_params.codecs.empty()); + if (needs_recv_params_update) { +- recv_params.extensions = send_params.extensions; + if (!media_receive_channel()->SetReceiverParameters(recv_params)) { + error_desc = StringFormat( + "Failed to set recv parameters for m-section with mid='%s'.", +diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc +index 4bb9573632..e3488a98a9 100644 +--- a/pc/channel_unittest.cc ++++ b/pc/channel_unittest.cc +@@ -2385,22 +2385,18 @@ TEST_F(VideoChannelSingleThreadTest, + + EXPECT_THAT( + media_receive_channel1_impl()->recv_codecs(), +- ElementsAre( +- AllOf(Field("id", &webrtc::Codec::id, 96), +- Field("packetization", &webrtc::Codec::packetization, "foo")), +- AllOf(Field("id", &webrtc::Codec::id, 98), +- Field("packetization", &webrtc::Codec::packetization, +- std::nullopt)))); ++ ElementsAre(AllOf(Field(&webrtc::Codec::id, 96), ++ Field(&webrtc::Codec::packetization, "foo")), ++ AllOf(Field(&webrtc::Codec::id, 98), ++ Field(&webrtc::Codec::packetization, std::nullopt)))); + EXPECT_THAT( + media_send_channel1_impl()->send_codecs(), +- ElementsAre( +- AllOf(Field("id", &webrtc::Codec::id, 96), +- Field("packetization", &webrtc::Codec::packetization, "foo")), +- AllOf(Field("id", &webrtc::Codec::id, 97), +- Field("packetization", &webrtc::Codec::packetization, "bar")), +- AllOf(Field("id", &webrtc::Codec::id, 99), +- Field("packetization", &webrtc::Codec::packetization, +- std::nullopt)))); ++ ElementsAre(AllOf(Field(&webrtc::Codec::id, 96), ++ Field(&webrtc::Codec::packetization, "foo")), ++ AllOf(Field(&webrtc::Codec::id, 97), ++ Field(&webrtc::Codec::packetization, "bar")), ++ AllOf(Field(&webrtc::Codec::id, 99), ++ Field(&webrtc::Codec::packetization, std::nullopt)))); + } + + TEST_F(VideoChannelSingleThreadTest, +diff --git a/pc/congestion_control_integrationtest.cc b/pc/congestion_control_integrationtest.cc +index e5ba493d1a..d93a31924f 100644 +--- a/pc/congestion_control_integrationtest.cc ++++ b/pc/congestion_control_integrationtest.cc +@@ -12,13 +12,9 @@ + // are correctly negotiated in the SDP offer/answer. + + #include <string> +-#include <vector> + + #include "absl/strings/str_cat.h" +-#include "api/media_types.h" + #include "api/peer_connection_interface.h" +-#include "api/rtp_parameters.h" +-#include "api/rtp_transceiver_direction.h" + #include "api/test/rtc_error_matchers.h" + #include "pc/test/integration_test_helpers.h" + #include "test/gmock.h" +@@ -27,12 +23,11 @@ + + namespace webrtc { + +-using ::testing::Eq; +-using ::testing::Field; ++using testing::Eq; + using ::testing::Gt; +-using ::testing::HasSubstr; ++using testing::HasSubstr; + using ::testing::IsTrue; +-using ::testing::Not; ++using testing::Not; + + class PeerConnectionCongestionControlTest + : public PeerConnectionIntegrationBaseTest { +@@ -82,53 +77,6 @@ TEST_F(PeerConnectionCongestionControlTest, ReceiveOfferSetsCcfbFlag) { + EXPECT_THAT(answer_str, Not(HasSubstr("transport-cc"))); + } + +-TEST_F(PeerConnectionCongestionControlTest, NegotiatingCcfbRemovesTsn) { +- SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); +- ASSERT_TRUE(CreatePeerConnectionWrappers()); +- ConnectFakeSignalingForSdpOnly(); +- callee()->AddVideoTrack(); +- // Add transceivers to caller in order to accomodate reception +- caller()->pc()->AddTransceiver(MediaType::VIDEO); +- auto parameters = caller()->pc()->GetSenders()[0]->GetParameters(); +- caller()->CreateAndSetAndSignalOffer(); +- ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), +- IsRtcOk()); +- +- std::vector<RtpHeaderExtensionCapability> negotiated_header_extensions = +- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); +- EXPECT_THAT( +- negotiated_header_extensions, +- Not(Contains( +- AllOf(Field("uri", &RtpHeaderExtensionCapability::uri, +- RtpExtension::kTransportSequenceNumberUri), +- Not(Field("direction", &RtpHeaderExtensionCapability::direction, +- RtpTransceiverDirection::kStopped)))))) +- << " in caller negotiated header extensions"; +- +- parameters = caller()->pc()->GetSenders()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in caller sender parameters"; +- parameters = caller()->pc()->GetReceivers()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in caller receiver parameters"; +- +- parameters = callee()->pc()->GetSenders()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in callee sender parameters"; +- +- parameters = callee()->pc()->GetReceivers()[0]->GetParameters(); +- EXPECT_THAT(parameters.header_extensions, +- Not(Contains(Field("uri", &RtpExtension::uri, +- RtpExtension::kTransportSequenceNumberUri)))) +- << " in callee receiver parameters"; +-} +- + TEST_F(PeerConnectionCongestionControlTest, CcfbGetsUsed) { + SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); + ASSERT_TRUE(CreatePeerConnectionWrappers()); +diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc +index 4d4ec552d7..3a2babda3e 100644 +--- a/pc/peer_connection_integrationtest.cc ++++ b/pc/peer_connection_integrationtest.cc +@@ -4631,9 +4631,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, + PeerConnectionInterface::kStable); + } + +-// TODO: issues.webrtc.org/425336456 - figure out correct behavior and reenable + TEST_F(PeerConnectionIntegrationTestUnifiedPlan, +- DISABLED_OnlyOnePairWantsCorruptionScorePlumbing) { ++ OnlyOnePairWantsCorruptionScorePlumbing) { + // In order for corruption score to be logged, encryption of RTP header + // extensions must be allowed. + CryptoOptions crypto_options; +@@ -4657,19 +4656,12 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, + ASSERT_THAT( + WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), + IsRtcOk()); +- std::vector<RtpHeaderExtensionCapability> negotiated_extensions = +- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); +- ASSERT_THAT(negotiated_extensions, +- Contains(Field("uri", &RtpHeaderExtensionCapability::uri, +- RtpExtension::kCorruptionDetectionUri))); + ASSERT_THAT(WaitUntil([&] { return caller()->GetCorruptionScoreCount(); }, + ::testing::Gt(0), {.timeout = kMaxWaitForStats}), +- IsRtcOk()) +- << "Waiting for caller corruption score count > 0"; ++ IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return callee()->GetCorruptionScoreCount(); }, + ::testing::Eq(0), {.timeout = kMaxWaitForStats}), +- IsRtcOk()) +- << "Waiting for callee corruption score count = 0"; ++ IsRtcOk()); + + for (const auto& pair : {caller(), callee()}) { + scoped_refptr<const RTCStatsReport> report = pair->NewGetStats(); diff --git a/third_party/libwebrtc/moz-patch-stack/s0130.patch b/third_party/libwebrtc/moz-patch-stack/s0130.patch @@ -1,282 +1,47 @@ -From: Michael Froman <mjfroman@mac.com> -Date: Wed, 24 Sep 2025 16:16:38 -0500 -Subject: Bug 1990526 - Cherry-pick upstream libwebrtc commit d27b4ef208 r?ng +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! -Upstream commit: https://webrtc.googlesource.com/src/+/d27b4ef20820c2aeef358b4a465a8b514517b9f3 - Revert "Change SetLocalContent / SetRemoteContent to update header extensions" +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). - This reverts commit 9496cc0e1b8cc50185ded19522b68d7c94c17298. - - Reason for revert: Investigating downstream issue. - - Bug: webrtc:383078466 - Original change's description: - > Change SetLocalContent / SetRemoteContent to update header extensions - > - > The functions were skipping over updating the sender and receiver when - > the list of header extensions was changed. Now it should be better. - > - > Bug: webrtc:383078466, b/425662432, b/426394283 - > Change-Id: I1b93ed1ba4bbbf6c5b13861a6e21a7a7c82a5a66 - > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396640 - > Reviewed-by: Per Kjellander <perkj@webrtc.org> - > Commit-Queue: Harald Alvestrand <hta@webrtc.org> - > Cr-Commit-Position: refs/heads/main@{#44951} - - Bug: webrtc:383078466 - Change-Id: Ie6db6d995021a8699c1c7aa91334ea0ea0e37c1f - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397820 - Reviewed-by: Per Kjellander <perkj@webrtc.org> - Reviewed-by: Harald Alvestrand <hta@webrtc.org> - Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> - Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> - Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> - Reviewed-by: Christoffer Dewerin <jansson@webrtc.org> - Cr-Commit-Position: refs/heads/main@{#45012} +Differential Revision: https://phabricator.services.mozilla.com/D267993 +Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/9c487a574d218cc1c261b646c501db4d159754f0 --- - media/base/codec.h | 3 -- - pc/channel.cc | 15 ++---- - pc/channel_unittest.cc | 24 ++++------ - pc/congestion_control_integrationtest.cc | 58 ++---------------------- - pc/peer_connection_integrationtest.cc | 14 ++---- - 5 files changed, 20 insertions(+), 94 deletions(-) + audio/audio_receive_stream.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) -diff --git a/media/base/codec.h b/media/base/codec.h -index e26306df20..694589dd14 100644 ---- a/media/base/codec.h -+++ b/media/base/codec.h -@@ -192,9 +192,6 @@ struct RTC_EXPORT Codec { - sink.Append("video/"); - } - absl::Format(&sink, "%s/%d/%d", c.name, c.clockrate, c.channels); -- if (c.packetization) { -- absl::Format(&sink, ",packetization=%s", *c.packetization); -- } - for (auto param : c.params) { - sink.Append(";"); - sink.Append(param.first); -diff --git a/pc/channel.cc b/pc/channel.cc -index 8b8d7a7ffb..1ab970f245 100644 ---- a/pc/channel.cc -+++ b/pc/channel.cc -@@ -99,7 +99,7 @@ void MediaChannelParametersFromMediaDescription( - desc->type() == MediaType::VIDEO); - params->is_stream_active = is_stream_active; - params->codecs = desc->codecs(); -- // TODO: bugs.webrtc.org/11513 - See if we really need -+ // TODO(bugs.webrtc.org/11513): See if we really need - // rtp_header_extensions_set() and remove it if we don't. - if (desc->rtp_header_extensions_set()) { - params->extensions = extensions; -@@ -915,6 +915,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, - } - } - } +diff --git a/audio/audio_receive_stream.h b/audio/audio_receive_stream.h +index bc248120ef..fd00dfb3ed 100644 +--- a/audio/audio_receive_stream.h ++++ b/audio/audio_receive_stream.h +@@ -31,7 +31,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" +@@ -43,6 +47,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 + - last_recv_params_ = recv_params; - - if (!UpdateLocalStreams_w(content->streams(), type, error_desc)) { -@@ -925,7 +926,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, - set_local_content_direction(content->direction()); - UpdateMediaSendRecvState_w(); - -- // Disabled because suggesting PTs takes thread jumps. -+ // Disabled because suggeting PTs takes thread jumps. - // TODO: https://issues.webrtc.org/360058654 - reenable after cleanup - // RTC_DCHECK_BLOCK_COUNT_NO_MORE_THAN(0); - -@@ -1041,6 +1042,7 @@ bool VideoChannel::SetLocalContent_w(const MediaContentDescription* content, - media_send_channel()->SetExtmapAllowMixed(content->extmap_allow_mixed()); - - VideoReceiverParameters recv_params = last_recv_params_; -+ - MediaChannelParametersFromMediaDescription( - content, header_extensions, - RtpTransceiverDirectionHasRecv(content->direction()), &recv_params); -@@ -1115,12 +1117,7 @@ bool VideoChannel::SetLocalContent_w(const MediaContentDescription* content, - - last_recv_params_ = recv_params; - -- // Also update send parameters if header extensions are changed. -- needs_send_params_update |= -- (last_send_params_.extensions != header_extensions && -- !send_params.codecs.empty()); - if (needs_send_params_update) { -- send_params.extensions = header_extensions; - if (!media_send_channel()->SetSenderParameters(send_params)) { - error_desc = StringFormat( - "Failed to set send parameters for m-section with mid='%s'.", -@@ -1231,11 +1228,7 @@ bool VideoChannel::SetRemoteContent_w(const MediaContentDescription* content, - media_send_channel()->SendCodecRtxTime()); - last_send_params_ = send_params; - -- needs_recv_params_update |= -- (recv_params.extensions != send_params.extensions && -- !recv_params.codecs.empty()); - if (needs_recv_params_update) { -- recv_params.extensions = send_params.extensions; - if (!media_receive_channel()->SetReceiverParameters(recv_params)) { - error_desc = StringFormat( - "Failed to set recv parameters for m-section with mid='%s'.", -diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc -index 4bb9573632..e3488a98a9 100644 ---- a/pc/channel_unittest.cc -+++ b/pc/channel_unittest.cc -@@ -2385,22 +2385,18 @@ TEST_F(VideoChannelSingleThreadTest, - - EXPECT_THAT( - media_receive_channel1_impl()->recv_codecs(), -- ElementsAre( -- AllOf(Field("id", &webrtc::Codec::id, 96), -- Field("packetization", &webrtc::Codec::packetization, "foo")), -- AllOf(Field("id", &webrtc::Codec::id, 98), -- Field("packetization", &webrtc::Codec::packetization, -- std::nullopt)))); -+ ElementsAre(AllOf(Field(&webrtc::Codec::id, 96), -+ Field(&webrtc::Codec::packetization, "foo")), -+ AllOf(Field(&webrtc::Codec::id, 98), -+ Field(&webrtc::Codec::packetization, std::nullopt)))); - EXPECT_THAT( - media_send_channel1_impl()->send_codecs(), -- ElementsAre( -- AllOf(Field("id", &webrtc::Codec::id, 96), -- Field("packetization", &webrtc::Codec::packetization, "foo")), -- AllOf(Field("id", &webrtc::Codec::id, 97), -- Field("packetization", &webrtc::Codec::packetization, "bar")), -- AllOf(Field("id", &webrtc::Codec::id, 99), -- Field("packetization", &webrtc::Codec::packetization, -- std::nullopt)))); -+ ElementsAre(AllOf(Field(&webrtc::Codec::id, 96), -+ Field(&webrtc::Codec::packetization, "foo")), -+ AllOf(Field(&webrtc::Codec::id, 97), -+ Field(&webrtc::Codec::packetization, "bar")), -+ AllOf(Field(&webrtc::Codec::id, 99), -+ Field(&webrtc::Codec::packetization, std::nullopt)))); - } - - TEST_F(VideoChannelSingleThreadTest, -diff --git a/pc/congestion_control_integrationtest.cc b/pc/congestion_control_integrationtest.cc -index e5ba493d1a..d93a31924f 100644 ---- a/pc/congestion_control_integrationtest.cc -+++ b/pc/congestion_control_integrationtest.cc -@@ -12,13 +12,9 @@ - // are correctly negotiated in the SDP offer/answer. - - #include <string> --#include <vector> - - #include "absl/strings/str_cat.h" --#include "api/media_types.h" - #include "api/peer_connection_interface.h" --#include "api/rtp_parameters.h" --#include "api/rtp_transceiver_direction.h" - #include "api/test/rtc_error_matchers.h" - #include "pc/test/integration_test_helpers.h" - #include "test/gmock.h" -@@ -27,12 +23,11 @@ - - namespace webrtc { - --using ::testing::Eq; --using ::testing::Field; -+using testing::Eq; - using ::testing::Gt; --using ::testing::HasSubstr; -+using testing::HasSubstr; - using ::testing::IsTrue; --using ::testing::Not; -+using testing::Not; - - class PeerConnectionCongestionControlTest - : public PeerConnectionIntegrationBaseTest { -@@ -82,53 +77,6 @@ TEST_F(PeerConnectionCongestionControlTest, ReceiveOfferSetsCcfbFlag) { - EXPECT_THAT(answer_str, Not(HasSubstr("transport-cc"))); - } - --TEST_F(PeerConnectionCongestionControlTest, NegotiatingCcfbRemovesTsn) { -- SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); -- ASSERT_TRUE(CreatePeerConnectionWrappers()); -- ConnectFakeSignalingForSdpOnly(); -- callee()->AddVideoTrack(); -- // Add transceivers to caller in order to accomodate reception -- caller()->pc()->AddTransceiver(MediaType::VIDEO); -- auto parameters = caller()->pc()->GetSenders()[0]->GetParameters(); -- caller()->CreateAndSetAndSignalOffer(); -- ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), -- IsRtcOk()); -- -- std::vector<RtpHeaderExtensionCapability> negotiated_header_extensions = -- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); -- EXPECT_THAT( -- negotiated_header_extensions, -- Not(Contains( -- AllOf(Field("uri", &RtpHeaderExtensionCapability::uri, -- RtpExtension::kTransportSequenceNumberUri), -- Not(Field("direction", &RtpHeaderExtensionCapability::direction, -- RtpTransceiverDirection::kStopped)))))) -- << " in caller negotiated header extensions"; -- -- parameters = caller()->pc()->GetSenders()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in caller sender parameters"; -- parameters = caller()->pc()->GetReceivers()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in caller receiver parameters"; -- -- parameters = callee()->pc()->GetSenders()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in callee sender parameters"; -- -- parameters = callee()->pc()->GetReceivers()[0]->GetParameters(); -- EXPECT_THAT(parameters.header_extensions, -- Not(Contains(Field("uri", &RtpExtension::uri, -- RtpExtension::kTransportSequenceNumberUri)))) -- << " in callee receiver parameters"; --} -- - TEST_F(PeerConnectionCongestionControlTest, CcfbGetsUsed) { - SetFieldTrials("WebRTC-RFC8888CongestionControlFeedback/Enabled/"); - ASSERT_TRUE(CreatePeerConnectionWrappers()); -diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc -index 4d4ec552d7..3a2babda3e 100644 ---- a/pc/peer_connection_integrationtest.cc -+++ b/pc/peer_connection_integrationtest.cc -@@ -4631,9 +4631,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, - PeerConnectionInterface::kStable); - } - --// TODO: issues.webrtc.org/425336456 - figure out correct behavior and reenable - TEST_F(PeerConnectionIntegrationTestUnifiedPlan, -- DISABLED_OnlyOnePairWantsCorruptionScorePlumbing) { -+ OnlyOnePairWantsCorruptionScorePlumbing) { - // In order for corruption score to be logged, encryption of RTP header - // extensions must be allowed. - CryptoOptions crypto_options; -@@ -4657,19 +4656,12 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); -- std::vector<RtpHeaderExtensionCapability> negotiated_extensions = -- caller()->pc()->GetTransceivers()[0]->GetNegotiatedHeaderExtensions(); -- ASSERT_THAT(negotiated_extensions, -- Contains(Field("uri", &RtpHeaderExtensionCapability::uri, -- RtpExtension::kCorruptionDetectionUri))); - ASSERT_THAT(WaitUntil([&] { return caller()->GetCorruptionScoreCount(); }, - ::testing::Gt(0), {.timeout = kMaxWaitForStats}), -- IsRtcOk()) -- << "Waiting for caller corruption score count > 0"; -+ IsRtcOk()); - ASSERT_THAT(WaitUntil([&] { return callee()->GetCorruptionScoreCount(); }, - ::testing::Eq(0), {.timeout = kMaxWaitForStats}), -- IsRtcOk()) -- << "Waiting for callee corruption score count = 0"; -+ IsRtcOk()); - - for (const auto& pair : {caller(), callee()}) { - scoped_refptr<const RTCStatsReport> report = pair->NewGetStats(); + namespace voe { + class ChannelReceiveInterface; + } // namespace voe diff --git a/third_party/libwebrtc/moz-patch-stack/s0131.patch b/third_party/libwebrtc/moz-patch-stack/s0131.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 bc248120ef..fd00dfb3ed 100644 ---- a/audio/audio_receive_stream.h -+++ b/audio/audio_receive_stream.h -@@ -31,7 +31,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" -@@ -43,6 +47,14 @@ class PacketRouter; - class RtpStreamReceiverControllerInterface; - class RtpStreamReceiverInterface; +diff --git a/BUILD.gn b/BUILD.gn +index ff12ae0545..1ac89c4090 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -317,6 +317,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 { +@@ -418,7 +429,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,41 +0,0 @@ -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! - -Differential Revision: https://phabricator.services.mozilla.com/D267994 -Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/43de54a6e52daf0a06956ae01951ef1e29d46e82 ---- - BUILD.gn | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/BUILD.gn b/BUILD.gn -index ff12ae0545..1ac89c4090 100644 ---- a/BUILD.gn -+++ b/BUILD.gn -@@ -317,6 +317,17 @@ 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 { -@@ -418,7 +429,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.