tor-browser

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

commit 416fd907ecfb59402834c57ddc831014c373859b
parent 2eb400c53144947874748fee1b1dc4588678440a
Author: Dan Baker <dbaker@mozilla.com>
Date:   Thu, 23 Oct 2025 15:57:24 -0600

Bug 1995393 - Vendor libwebrtc from ac2597e9ce

We already cherry-picked this when we vendored f4453c3711.

Upstream commit: https://webrtc.googlesource.com/src/+/ac2597e9ce2b05751ac7ebddb268e874462c5e9f
    Revert "Use field clock instead of global clock where available"

    This reverts commit f4453c3711eff9e8851364687cc55a31de5c059f.

    Reason for revert: Broken downstream

    Bug: webrtc:42223992
    Original change's description:
    > Use field clock instead of global clock where available
    >
    > Bug: webrtc:42223992
    > Change-Id: Ia0eb6a5f9ebfe4031fc72026f31767b2ce7dcc2d
    > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404280
    > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
    > Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
    > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
    > Cr-Commit-Position: refs/heads/main@{#45333}

    Bug: webrtc:42223992
    Change-Id: I5c496d744b977edcda80a1877f9bae1f5864af2a
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404581
    Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
    Owners-Override: Ilya Nikolaevskiy <ilnik@webrtc.org>
    Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
    Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
    Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
    Cr-Commit-Position: refs/heads/main@{#45352}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Dthird_party/libwebrtc/moz-patch-stack/ac2597e9ce.no-op-cherry-pick-msg | 1-
Mthird_party/libwebrtc/moz-patch-stack/p0001.patch | 272+++++++++++--------------------------------------------------------------------
Mthird_party/libwebrtc/moz-patch-stack/p0002.patch | 135++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
Dthird_party/libwebrtc/moz-patch-stack/p0003.patch | 109-------------------------------------------------------------------------------
5 files changed, 139 insertions(+), 382 deletions(-)

diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T21:54:26.795938+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T21:57:12.784990+00:00. # base of lastest vendoring -ffd474e5fa +ac2597e9ce diff --git a/third_party/libwebrtc/moz-patch-stack/ac2597e9ce.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/ac2597e9ce.no-op-cherry-pick-msg @@ -1 +0,0 @@ -We already cherry-picked this when we vendored f4453c3711. diff --git a/third_party/libwebrtc/moz-patch-stack/p0001.patch b/third_party/libwebrtc/moz-patch-stack/p0001.patch @@ -1,242 +1,44 @@ -From: Daniel Baker <dbaker@mozilla.com> -Date: Thu, 23 Oct 2025 15:03:13 -0600 -Subject: (tmp-cherry-pick) Revert "Use field clock instead of global clock - where available" (ac2597e9ce) +From: Philipp Hancke <phancke@meta.com> +Date: Sat, 16 Aug 2025 12:15:50 -0700 +Subject: (cherry-pick-branch-heads/7339) [M140] sdp munging: do not misdetect + rtp attributes on datachannel -This reverts commit f4453c3711eff9e8851364687cc55a31de5c059f. +rtcp-mux and rtcp-rsize are unconditionally set for datachannel +but since they are not serialized in the SDP they are not parsed. +This leads the munging detector to misclassify this. -Reason for revert: Broken downstream +a unit test is added as a separate CL for easier backmerging. -Bug: webrtc:42223992 -Original change's description: -> Use field clock instead of global clock where available -> -> Bug: webrtc:42223992 -> Change-Id: Ia0eb6a5f9ebfe4031fc72026f31767b2ce7dcc2d -> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404280 -> Reviewed-by: Harald Alvestrand <hta@webrtc.org> -> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> -> Auto-Submit: Evan Shrubsole <eshr@webrtc.org> -> Commit-Queue: Harald Alvestrand <hta@webrtc.org> -> Cr-Commit-Position: refs/heads/main@{#45333} +(cherry picked from commit 602b06b1125ea4d107fbfbda7d314b4157c4c74b) -Bug: webrtc:42223992 -Change-Id: I5c496d744b977edcda80a1877f9bae1f5864af2a -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404581 -Commit-Queue: Evan Shrubsole <eshr@webrtc.org> -Owners-Override: Ilya Nikolaevskiy <ilnik@webrtc.org> -Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> -Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> -Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> -Cr-Commit-Position: refs/heads/main@{#45352} +Bug: webrtc:414284082,chromium:40567530 +Fixed: chromium:439807581 +Change-Id: I4ebb2ad5062ea42fc47a314ed929de42f91bbea7 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404740 +Commit-Queue: Philipp Hancke <phancke@meta.com> +Reviewed-by: Harald Alvestrand <hta@webrtc.org> +Cr-Original-Commit-Position: refs/heads/main@{#45357} +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/405281 +Cr-Commit-Position: refs/branch-heads/7339@{#1} +Cr-Branched-From: 9bd64751d9b3b35a820cb72c9029993e218146a1-refs/heads/main@{#45270} --- - api/units/timestamp.h | 4 ---- - api/units/timestamp_unittest.cc | 1 - - audio/channel_receive.cc | 5 +++-- - audio/voip/voip_core.cc | 3 ++- - modules/audio_device/test_audio_device_impl.cc | 3 ++- - p2p/base/port.cc | 6 +++--- - pc/rtc_stats_collector.cc | 2 +- - video/adaptation/overuse_frame_detector.cc | 2 +- - video/encoder_bitrate_adjuster.cc | 3 ++- - video/video_receive_stream2.cc | 3 ++- - 10 files changed, 16 insertions(+), 16 deletions(-) + pc/sdp_munging_detector.cc | 6 ++++++ + 1 file changed, 6 insertions(+) -diff --git a/api/units/timestamp.h b/api/units/timestamp.h -index 0317e9faef..7831bba2d0 100644 ---- a/api/units/timestamp.h -+++ b/api/units/timestamp.h -@@ -60,10 +60,6 @@ class Timestamp final : public rtc_units_impl::UnitBase<Timestamp> { - constexpr T us() const { - return ToValue<T>(); - } -- template <typename T = int64_t> -- constexpr T ns() const { -- return ToMultiple<1000, T>(); -- } - - constexpr int64_t seconds_or(int64_t fallback_value) const { - return ToFractionOr<1000000>(fallback_value); -diff --git a/api/units/timestamp_unittest.cc b/api/units/timestamp_unittest.cc -index c9254c25f0..1b88cb7f42 100644 ---- a/api/units/timestamp_unittest.cc -+++ b/api/units/timestamp_unittest.cc -@@ -37,7 +37,6 @@ TEST(TimestampTest, ConstExpr) { - EXPECT_EQ(kTimestampSeconds.seconds(), kValue); - EXPECT_EQ(kTimestampMs.ms(), kValue); - EXPECT_EQ(kTimestampUs.us(), kValue); -- EXPECT_EQ(kTimestampUs.ns(), kValue * 1000); - } - - TEST(TimestampTest, GetBackSameValues) { -diff --git a/audio/channel_receive.cc b/audio/channel_receive.cc -index 90d3c70aa0..eda5824569 100644 ---- a/audio/channel_receive.cc -+++ b/audio/channel_receive.cc -@@ -78,6 +78,7 @@ - #include "rtc_base/synchronization/mutex.h" - #include "rtc_base/system/no_unique_address.h" - #include "rtc_base/thread_annotations.h" -+#include "rtc_base/time_utils.h" - #include "rtc_base/trace_event.h" - #include "system_wrappers/include/metrics.h" - #include "system_wrappers/include/ntp_time.h" -@@ -657,7 +658,7 @@ void ChannelReceive::SetReceiveCodecs( - - void ChannelReceive::OnRtpPacket(const RtpPacketReceived& packet) { - RTC_DCHECK_RUN_ON(&worker_thread_checker_); -- Timestamp now = env_.clock().CurrentTime(); -+ Timestamp now = Timestamp::Millis(TimeMillis()); - - last_received_rtp_timestamp_ = packet.Timestamp(); - last_received_rtp_system_time_ = now; -@@ -754,7 +755,7 @@ void ChannelReceive::ReceivedRTCPPacket(const uint8_t* data, size_t length) { - RTC_DCHECK_RUN_ON(&worker_thread_checker_); - - // Store playout timestamp for the received RTCP packet -- UpdatePlayoutTimestamp(true, env_.clock().CurrentTime()); -+ UpdatePlayoutTimestamp(true, Timestamp::Millis(TimeMillis())); - - // Deliver RTCP packet to RTP/RTCP module for parsing - rtp_rtcp_->IncomingRtcpPacket(MakeArrayView(data, length)); -diff --git a/audio/voip/voip_core.cc b/audio/voip/voip_core.cc -index d3ce340ac9..7676811698 100644 ---- a/audio/voip/voip_core.cc -+++ b/audio/voip/voip_core.cc -@@ -40,6 +40,7 @@ - #include "rtc_base/logging.h" - #include "rtc_base/random.h" - #include "rtc_base/synchronization/mutex.h" -+#include "rtc_base/time_utils.h" - - namespace webrtc { - -@@ -151,7 +152,7 @@ ChannelId VoipCore::CreateChannel(Transport* transport, - - // Set local ssrc to random if not set by caller. - if (!local_ssrc) { -- Random random(env_.clock().TimeInMicroseconds()); -+ Random random(TimeMicros()); - local_ssrc = random.Rand<uint32_t>(); - } - -diff --git a/modules/audio_device/test_audio_device_impl.cc b/modules/audio_device/test_audio_device_impl.cc -index 80402d3ea3..fe3d10dcf3 100644 ---- a/modules/audio_device/test_audio_device_impl.cc -+++ b/modules/audio_device/test_audio_device_impl.cc -@@ -25,6 +25,7 @@ - #include "rtc_base/checks.h" - #include "rtc_base/synchronization/mutex.h" - #include "rtc_base/task_utils/repeating_task.h" -+#include "rtc_base/time_utils.h" - - namespace webrtc { - namespace { -@@ -174,7 +175,7 @@ void TestAudioDevice::ProcessAudio() { - audio_buffer_->SetRecordedBuffer( - recording_buffer_.data(), - recording_buffer_.size() / capturer_->NumChannels(), -- std::make_optional(env_.clock().CurrentTime().ns())); -+ std::make_optional(TimeNanos())); - audio_buffer_->DeliverRecordedData(); +diff --git a/pc/sdp_munging_detector.cc b/pc/sdp_munging_detector.cc +index 04f0d53fd0..88f38da30d 100644 +--- a/pc/sdp_munging_detector.cc ++++ b/pc/sdp_munging_detector.cc +@@ -427,6 +427,12 @@ SdpMungingType DetermineSdpMungingType( } - if (!keep_capturing) { -diff --git a/p2p/base/port.cc b/p2p/base/port.cc -index 033e3f6dd2..5a43cc7c70 100644 ---- a/p2p/base/port.cc -+++ b/p2p/base/port.cc -@@ -53,6 +53,7 @@ - #include "rtc_base/string_encode.h" - #include "rtc_base/string_utils.h" - #include "rtc_base/strings/string_builder.h" -+#include "rtc_base/time_utils.h" - #include "rtc_base/trace_event.h" - #include "rtc_base/weak_ptr.h" - -@@ -829,8 +830,7 @@ void Port::DestroyIfDead() { - bool dead = - (state_ == State::INIT || state_ == State::PRUNED) && - connections_.empty() && -- env_.clock().TimeInMilliseconds() - last_time_all_connections_removed_ >= -- timeout_delay_; -+ TimeMillis() - last_time_all_connections_removed_ >= timeout_delay_; - if (dead) { - Destroy(); - } -@@ -899,7 +899,7 @@ bool Port::OnConnectionDestroyed(Connection* conn) { - // fails and is removed before kPortTimeoutDelay, then this message will - // not cause the Port to be destroyed. - if (connections_.empty()) { -- last_time_all_connections_removed_ = env_.clock().TimeInMilliseconds(); -+ last_time_all_connections_removed_ = TimeMillis(); - PostDestroyIfDead(/*delayed=*/true); - } - -diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc -index ce0954a7b3..be90539f93 100644 ---- a/pc/rtc_stats_collector.cc -+++ b/pc/rtc_stats_collector.cc -@@ -1207,7 +1207,7 @@ void RTCStatsCollector::GetStatsReportInternal( - requests_.push_back(std::move(request)); - - // "Now" using a monotonically increasing timer. -- int64_t cache_now_us = env_.clock().TimeInMicroseconds(); -+ int64_t cache_now_us = TimeMicros(); - if (cached_report_ && - cache_now_us - cache_timestamp_us_ <= cache_lifetime_us_) { - // We have a fresh cached report to deliver. Deliver asynchronously, since -diff --git a/video/adaptation/overuse_frame_detector.cc b/video/adaptation/overuse_frame_detector.cc -index 827b0a5dd9..959dbb0418 100644 ---- a/video/adaptation/overuse_frame_detector.cc -+++ b/video/adaptation/overuse_frame_detector.cc -@@ -600,7 +600,7 @@ void OveruseFrameDetector::CheckForOveruse( - !encode_usage_percent_) - return; - -- int64_t now_ms = env_.clock().TimeInMilliseconds(); -+ int64_t now_ms = TimeMillis(); - const char* action = "NoAction"; - - if (IsOverusing(*encode_usage_percent_)) { -diff --git a/video/encoder_bitrate_adjuster.cc b/video/encoder_bitrate_adjuster.cc -index 1d17e10b87..d9d64e4f0c 100644 ---- a/video/encoder_bitrate_adjuster.cc -+++ b/video/encoder_bitrate_adjuster.cc -@@ -31,6 +31,7 @@ - #include "rtc_base/checks.h" - #include "rtc_base/experiments/rate_control_settings.h" - #include "rtc_base/logging.h" -+#include "rtc_base/time_utils.h" - #include "system_wrappers/include/clock.h" - #include "video/encoder_overshoot_detector.h" - #include "video/rate_utilization_tracker.h" -@@ -385,7 +386,7 @@ void EncoderBitrateAdjuster::OnEncodedFrame(DataSize size, - // Detectors may not exist, for instance if ScreenshareLayers is used. - auto& detector = overshoot_detectors_[stream_index][temporal_index]; - if (detector) { -- detector->OnEncodedFrame(size.bytes(), clock_.TimeInMilliseconds()); -+ detector->OnEncodedFrame(size.bytes(), TimeMillis()); - } - if (media_rate_trackers_[stream_index]) { - media_rate_trackers_[stream_index]->OnDataProduced(size, -diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc -index eccec79bb3..4dff35605c 100644 ---- a/video/video_receive_stream2.cc -+++ b/video/video_receive_stream2.cc -@@ -81,6 +81,7 @@ - #include "rtc_base/strings/string_builder.h" - #include "rtc_base/synchronization/mutex.h" - #include "rtc_base/system/file_wrapper.h" -+#include "rtc_base/time_utils.h" - #include "rtc_base/trace_event.h" - #include "system_wrappers/include/clock.h" - #include "system_wrappers/include/ntp_time.h" -@@ -586,7 +587,7 @@ void VideoReceiveStream2::CreateAndRegisterExternalDecoder( - char filename_buffer[256]; - SimpleStringBuilder ssb(filename_buffer); - ssb << decoded_output_file << "/webrtc_receive_stream_" << remote_ssrc() -- << "-" << env_.clock().TimeInMicroseconds() << ".ivf"; -+ << "-" << TimeMicros() << ".ivf"; - video_decoder = CreateFrameDumpingDecoderWrapper( - std::move(video_decoder), FileWrapper::OpenWriteOnly(ssb.str())); - } + // Validate video and audio contents. + MediaType media_type = last_created_media_description->type(); ++ bool is_rtp = ++ media_type == MediaType::AUDIO || media_type == MediaType::VIDEO; ++ if (!is_rtp) { ++ // The checks that follow only apply for RTP-based contents. ++ continue; ++ } + if (media_type == MediaType::VIDEO) { + type = DetermineVideoSdpMungingType(last_created_media_description, + media_description_to_set); diff --git a/third_party/libwebrtc/moz-patch-stack/p0002.patch b/third_party/libwebrtc/moz-patch-stack/p0002.patch @@ -1,44 +1,109 @@ -From: Philipp Hancke <phancke@meta.com> -Date: Sat, 16 Aug 2025 12:15:50 -0700 -Subject: (cherry-pick-branch-heads/7339) [M140] sdp munging: do not misdetect - rtp attributes on datachannel +From: Jonas Oreland <jonaso@webrtc.org> +Date: Tue, 26 Aug 2025 15:57:29 +0200 +Subject: (cherry-pick-branch-heads/7339) [M140] DTLS1.3: Fix missing + retransmission due to failure to set timer. -rtcp-mux and rtcp-rsize are unconditionally set for datachannel -but since they are not serialized in the SDP they are not parsed. -This leads the munging detector to misclassify this. +DTLS 1.3 considers itself connected earlier than DTLS 1.2 did - when +second flight reaches the client. This CL fixes a bug that when +client is connected (state_ != SSL_CONNECTING), it would not +continue retransmitting. Continuous retransmission is needed +when the third flight is lost multiple times. Or really anytime that DTLS request it :) -a unit test is added as a separate CL for easier backmerging. +This fixes the TODO in dtls_ice_integrationtest.cc in which dtls1.3 +spuriously failed with certain (packet loss intensive) configurations. -(cherry picked from commit 602b06b1125ea4d107fbfbda7d314b4157c4c74b) +CREDITS: sergeysu@ that found and fixed the problem! -Bug: webrtc:414284082,chromium:40567530 -Fixed: chromium:439807581 -Change-Id: I4ebb2ad5062ea42fc47a314ed929de42f91bbea7 -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404740 -Commit-Queue: Philipp Hancke <phancke@meta.com> +(cherry picked from commit 4221e1bc2fc360448c1663f0bbae058ff9f65a48) + +No-Try: true +Bug: chromium:441245658, chromium:441486101 +Change-Id: I3302f6f384d7e4cda090184094a6fadaf7e4f129 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/406320 +Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> -Cr-Original-Commit-Position: refs/heads/main@{#45357} -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/405281 -Cr-Commit-Position: refs/branch-heads/7339@{#1} +Commit-Queue: Jonas Oreland <jonaso@webrtc.org> +Cr-Original-Commit-Position: refs/heads/main@{#45439} +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407780 +Commit-Queue: Guido Urdaneta <guidou@webrtc.org> +Cr-Commit-Position: refs/branch-heads/7339@{#2} Cr-Branched-From: 9bd64751d9b3b35a820cb72c9029993e218146a1-refs/heads/main@{#45270} --- - pc/sdp_munging_detector.cc | 6 ++++++ - 1 file changed, 6 insertions(+) + p2p/dtls/dtls_ice_integrationtest.cc | 6 +----- + rtc_base/openssl_stream_adapter.cc | 15 ++++++++++++--- + rtc_base/openssl_stream_adapter.h | 2 ++ + 3 files changed, 15 insertions(+), 8 deletions(-) -diff --git a/pc/sdp_munging_detector.cc b/pc/sdp_munging_detector.cc -index 04f0d53fd0..88f38da30d 100644 ---- a/pc/sdp_munging_detector.cc -+++ b/pc/sdp_munging_detector.cc -@@ -427,6 +427,12 @@ SdpMungingType DetermineSdpMungingType( +diff --git a/p2p/dtls/dtls_ice_integrationtest.cc b/p2p/dtls/dtls_ice_integrationtest.cc +index 339238d664..1610f0002a 100644 +--- a/p2p/dtls/dtls_ice_integrationtest.cc ++++ b/p2p/dtls/dtls_ice_integrationtest.cc +@@ -127,11 +127,7 @@ class DtlsIceIntegrationTest : public ::testing::TestWithParam<std::tuple< + + BuiltInNetworkBehaviorConfig networkBehavior; + networkBehavior.link_capacity = DataRate::KilobitsPerSec(220); +- // TODO (webrtc:383141571) : Investigate why this testcase fails for +- // DTLS 1.3 delay if networkBehavior.queue_delay_ms = 100ms. +- // - unless both peers support dtls in stun, in which case it passes. +- // - note: only for dtls1.3, it works for dtls1.2! +- networkBehavior.queue_delay_ms = 50; ++ networkBehavior.queue_delay_ms = 100; + networkBehavior.queue_length_packets = 30; + networkBehavior.loss_percent = 50; + +diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc +index 50be6b5c26..8c952cd3a2 100644 +--- a/rtc_base/openssl_stream_adapter.cc ++++ b/rtc_base/openssl_stream_adapter.cc +@@ -852,10 +852,15 @@ void OpenSSLStreamAdapter::SetTimeout(int delay_ms) { + // We check the timer even after SSL_CONNECTED, + // but ContinueSSL() is only needed when SSL_CONNECTING + if (state_ == SSL_CONNECTING) { ++ // Note: timeout is set inside ContinueSSL() + ContinueSSL(); ++ } else if (state_ == SSL_CONNECTED) { ++ MaybeSetTimeout(); ++ } else { ++ RTC_DCHECK_NOTREACHED() << "state_: " << state_; + } + } else { +- RTC_DCHECK_NOTREACHED(); ++ RTC_DCHECK_NOTREACHED() << "flag->alive() == false"; + } + // This callback will never run again (stopped above). + return TimeDelta::PlusInfinity(); +@@ -970,6 +975,12 @@ int OpenSSLStreamAdapter::ContinueSSL() { + } + } + ++ MaybeSetTimeout(); ++ ++ return 0; ++} ++ ++void OpenSSLStreamAdapter::MaybeSetTimeout() { + if (ssl_ != nullptr) { + struct timeval timeout; + if (DTLSv1_get_timeout(ssl_, &timeout)) { +@@ -977,8 +988,6 @@ int OpenSSLStreamAdapter::ContinueSSL() { + SetTimeout(delay); } - // Validate video and audio contents. - MediaType media_type = last_created_media_description->type(); -+ bool is_rtp = -+ media_type == MediaType::AUDIO || media_type == MediaType::VIDEO; -+ if (!is_rtp) { -+ // The checks that follow only apply for RTP-based contents. -+ continue; -+ } - if (media_type == MediaType::VIDEO) { - type = DetermineVideoSdpMungingType(last_created_media_description, - media_description_to_set); + } +- +- return 0; + } + + void OpenSSLStreamAdapter::Error(absl::string_view context, +diff --git a/rtc_base/openssl_stream_adapter.h b/rtc_base/openssl_stream_adapter.h +index 856d37c156..c10e93e3d4 100644 +--- a/rtc_base/openssl_stream_adapter.h ++++ b/rtc_base/openssl_stream_adapter.h +@@ -210,6 +210,8 @@ class OpenSSLStreamAdapter final : public SSLStreamAdapter { + !peer_certificate_digest_value_.empty(); + } + ++ void MaybeSetTimeout(); ++ + const std::unique_ptr<StreamInterface> stream_; + absl::AnyInvocable<void(SSLHandshakeError)> handshake_error_; + diff --git a/third_party/libwebrtc/moz-patch-stack/p0003.patch b/third_party/libwebrtc/moz-patch-stack/p0003.patch @@ -1,109 +0,0 @@ -From: Jonas Oreland <jonaso@webrtc.org> -Date: Tue, 26 Aug 2025 15:57:29 +0200 -Subject: (cherry-pick-branch-heads/7339) [M140] DTLS1.3: Fix missing - retransmission due to failure to set timer. - -DTLS 1.3 considers itself connected earlier than DTLS 1.2 did - when -second flight reaches the client. This CL fixes a bug that when -client is connected (state_ != SSL_CONNECTING), it would not -continue retransmitting. Continuous retransmission is needed -when the third flight is lost multiple times. Or really anytime that DTLS request it :) - -This fixes the TODO in dtls_ice_integrationtest.cc in which dtls1.3 -spuriously failed with certain (packet loss intensive) configurations. - -CREDITS: sergeysu@ that found and fixed the problem! - -(cherry picked from commit 4221e1bc2fc360448c1663f0bbae058ff9f65a48) - -No-Try: true -Bug: chromium:441245658, chromium:441486101 -Change-Id: I3302f6f384d7e4cda090184094a6fadaf7e4f129 -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/406320 -Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> -Reviewed-by: Harald Alvestrand <hta@webrtc.org> -Commit-Queue: Jonas Oreland <jonaso@webrtc.org> -Cr-Original-Commit-Position: refs/heads/main@{#45439} -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407780 -Commit-Queue: Guido Urdaneta <guidou@webrtc.org> -Cr-Commit-Position: refs/branch-heads/7339@{#2} -Cr-Branched-From: 9bd64751d9b3b35a820cb72c9029993e218146a1-refs/heads/main@{#45270} ---- - p2p/dtls/dtls_ice_integrationtest.cc | 6 +----- - rtc_base/openssl_stream_adapter.cc | 15 ++++++++++++--- - rtc_base/openssl_stream_adapter.h | 2 ++ - 3 files changed, 15 insertions(+), 8 deletions(-) - -diff --git a/p2p/dtls/dtls_ice_integrationtest.cc b/p2p/dtls/dtls_ice_integrationtest.cc -index 339238d664..1610f0002a 100644 ---- a/p2p/dtls/dtls_ice_integrationtest.cc -+++ b/p2p/dtls/dtls_ice_integrationtest.cc -@@ -127,11 +127,7 @@ class DtlsIceIntegrationTest : public ::testing::TestWithParam<std::tuple< - - BuiltInNetworkBehaviorConfig networkBehavior; - networkBehavior.link_capacity = DataRate::KilobitsPerSec(220); -- // TODO (webrtc:383141571) : Investigate why this testcase fails for -- // DTLS 1.3 delay if networkBehavior.queue_delay_ms = 100ms. -- // - unless both peers support dtls in stun, in which case it passes. -- // - note: only for dtls1.3, it works for dtls1.2! -- networkBehavior.queue_delay_ms = 50; -+ networkBehavior.queue_delay_ms = 100; - networkBehavior.queue_length_packets = 30; - networkBehavior.loss_percent = 50; - -diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc -index 50be6b5c26..8c952cd3a2 100644 ---- a/rtc_base/openssl_stream_adapter.cc -+++ b/rtc_base/openssl_stream_adapter.cc -@@ -852,10 +852,15 @@ void OpenSSLStreamAdapter::SetTimeout(int delay_ms) { - // We check the timer even after SSL_CONNECTED, - // but ContinueSSL() is only needed when SSL_CONNECTING - if (state_ == SSL_CONNECTING) { -+ // Note: timeout is set inside ContinueSSL() - ContinueSSL(); -+ } else if (state_ == SSL_CONNECTED) { -+ MaybeSetTimeout(); -+ } else { -+ RTC_DCHECK_NOTREACHED() << "state_: " << state_; - } - } else { -- RTC_DCHECK_NOTREACHED(); -+ RTC_DCHECK_NOTREACHED() << "flag->alive() == false"; - } - // This callback will never run again (stopped above). - return TimeDelta::PlusInfinity(); -@@ -970,6 +975,12 @@ int OpenSSLStreamAdapter::ContinueSSL() { - } - } - -+ MaybeSetTimeout(); -+ -+ return 0; -+} -+ -+void OpenSSLStreamAdapter::MaybeSetTimeout() { - if (ssl_ != nullptr) { - struct timeval timeout; - if (DTLSv1_get_timeout(ssl_, &timeout)) { -@@ -977,8 +988,6 @@ int OpenSSLStreamAdapter::ContinueSSL() { - SetTimeout(delay); - } - } -- -- return 0; - } - - void OpenSSLStreamAdapter::Error(absl::string_view context, -diff --git a/rtc_base/openssl_stream_adapter.h b/rtc_base/openssl_stream_adapter.h -index 856d37c156..c10e93e3d4 100644 ---- a/rtc_base/openssl_stream_adapter.h -+++ b/rtc_base/openssl_stream_adapter.h -@@ -210,6 +210,8 @@ class OpenSSLStreamAdapter final : public SSLStreamAdapter { - !peer_certificate_digest_value_.empty(); - } - -+ void MaybeSetTimeout(); -+ - const std::unique_ptr<StreamInterface> stream_; - absl::AnyInvocable<void(SSLHandshakeError)> handshake_error_; -