commit f36daab64ac7c44528170409c153e4c24be0f0fd
parent 2dde56739897cb2931772a01fc663e42fde8ffde
Author: Dan Baker <dbaker@mozilla.com>
Date: Fri, 24 Oct 2025 14:18:48 -0600
Bug 1995393 - Vendor libwebrtc from 1c0ba91c85
Essentially a no-op since we're going to see this change
reverted when we vendor in a275d3e4af.
Upstream commit: https://webrtc.googlesource.com/src/+/1c0ba91c855f26868a6864ff048ca7ebf03ce724
sigslot: make PortInterface::SignalRoleConflict a CallbackLst
Bug: webrtc:42222066
Change-Id: I15dab9209a58fec8c42b4096dc5682e46a844e19
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/403220
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#45406}
Diffstat:
4 files changed, 205 insertions(+), 95 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-24T20:09:10.842564+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-24T20:18:34.819839+00:00.
# base of lastest vendoring
-81d959c673
+1c0ba91c85
diff --git a/third_party/libwebrtc/moz-patch-stack/a275d3e4af.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/a275d3e4af.no-op-cherry-pick-msg
@@ -0,0 +1 @@
+We already cherry-picked this when we vendored 1c0ba91c85.
diff --git a/third_party/libwebrtc/moz-patch-stack/p0001.patch b/third_party/libwebrtc/moz-patch-stack/p0001.patch
@@ -1,109 +1,218 @@
-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.
+From: Daniel Baker <dbaker@mozilla.com>
+Date: Fri, 24 Oct 2025 14:18:02 -0600
+Subject: (tmp-cherry-pick) Revert "sigslot: make
+ PortInterface::SignalRoleConflict a CallbackLst" (a275d3e4af)
-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 reverts commit 1c0ba91c855f26868a6864ff048ca7ebf03ce724.
-This fixes the TODO in dtls_ice_integrationtest.cc in which dtls1.3
-spuriously failed with certain (packet loss intensive) configurations.
+Reason for revert: Break downstream project
-CREDITS: sergeysu@ that found and fixed the problem!
-
-(cherry picked from commit 4221e1bc2fc360448c1663f0bbae058ff9f65a48)
+Bug: webrtc:42222066
+Original change's description:
+> sigslot: make PortInterface::SignalRoleConflict a CallbackLst
+>
+> Bug: webrtc:42222066
+> Change-Id: I15dab9209a58fec8c42b4096dc5682e46a844e19
+> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/403220
+> Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
+> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
+> Commit-Queue: Philipp Hancke <phancke@meta.com>
+> Cr-Commit-Position: refs/heads/main@{#45406}
+Bug: webrtc:42222066
+No-Presubmit: true
+No-Tree-Checks: true
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}
+Change-Id: I51121efd42f49b172fd5f0fd1b562010ec6242af
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/405660
+Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
+Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
+Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
+Cr-Commit-Position: refs/heads/main@{#45410}
---
- 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(-)
+ p2p/BUILD.gn | 1 -
+ p2p/base/connection.cc | 2 +-
+ p2p/base/p2p_transport_channel.cc | 10 +++++-----
+ p2p/base/p2p_transport_channel.h | 2 +-
+ p2p/base/port.cc | 13 ++-----------
+ p2p/base/port.h | 7 -------
+ p2p/base/port_interface.h | 4 +---
+ p2p/base/port_unittest.cc | 8 +++-----
+ 8 files changed, 13 insertions(+), 34 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<
+diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn
+index 8431c4ce1b..f101a540b9 100644
+--- a/p2p/BUILD.gn
++++ b/p2p/BUILD.gn
+@@ -649,7 +649,6 @@ rtc_library("port_interface") {
+ "../rtc_base:socket_address",
+ "../rtc_base/network:sent_packet",
+ "../rtc_base/third_party/sigslot",
+- "//third_party/abseil-cpp/absl/functional:any_invocable",
+ "//third_party/abseil-cpp/absl/strings:string_view",
+ ]
+ }
+diff --git a/p2p/base/connection.cc b/p2p/base/connection.cc
+index 659afe7c26..18288daf47 100644
+--- a/p2p/base/connection.cc
++++ b/p2p/base/connection.cc
+@@ -1611,7 +1611,7 @@ void Connection::OnConnectionRequestErrorResponse(ConnectionRequest* request,
+ error_code == STUN_ERROR_UNAUTHORIZED) {
+ // Recoverable error, retry
+ } else if (error_code == STUN_ERROR_ROLE_CONFLICT) {
+- port_->NotifyRoleConflict();
++ port_->SignalRoleConflict(port_.get());
+ } else if (request->msg()->type() == GOOG_PING_REQUEST) {
+ // Race, retry.
+ } else {
+diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc
+index 6c928bc8a9..323cdd26ab 100644
+--- a/p2p/base/p2p_transport_channel.cc
++++ b/p2p/base/p2p_transport_channel.cc
+@@ -921,15 +921,15 @@ void P2PTransportChannel::OnPortReady(PortAllocatorSession* /* session */,
+ ports_.push_back(port);
+ port->SignalUnknownAddress.connect(this,
+ &P2PTransportChannel::OnUnknownAddress);
+- port->SignalSentPacket.connect(this, &P2PTransportChannel::OnSentPacket);
+-
+ port->SubscribePortDestroyed(
+ [this](PortInterface* port) { OnPortDestroyed(port); });
+- port->SubscribeRoleConflict(
+- [this](PortInterface* /*unused*/) { NotifyRoleConflict(); });
++
++ port->SignalRoleConflict.connect(this, &P2PTransportChannel::OnRoleConflict);
++ port->SignalSentPacket.connect(this, &P2PTransportChannel::OnSentPacket);
- 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;
+ // Attempt to create a connection from this new port to all of the remote
+ // candidates that we were given so far.
++
+ std::vector<RemoteCandidate>::iterator iter;
+ for (iter = remote_candidates_.begin(); iter != remote_candidates_.end();
+ ++iter) {
+@@ -1133,7 +1133,7 @@ void P2PTransportChannel::OnCandidateFilterChanged(uint32_t prev_filter,
+ }
+ }
-diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc
-index 4acbb55890..2b45d37df7 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_;
- }
+-void P2PTransportChannel::NotifyRoleConflict() {
++void P2PTransportChannel::OnRoleConflict(PortInterface* /* port */) {
+ SignalRoleConflict(this); // STUN ping will be sent when SetRole is called
+ // from Transport.
+ }
+diff --git a/p2p/base/p2p_transport_channel.h b/p2p/base/p2p_transport_channel.h
+index 067d2dce52..738e48e26a 100644
+--- a/p2p/base/p2p_transport_channel.h
++++ b/p2p/base/p2p_transport_channel.h
+@@ -364,7 +364,7 @@ class RTC_EXPORT P2PTransportChannel : public IceTransportInternal,
+ // When pruning a port, move it from `ports_` to `pruned_ports_`.
+ // Returns true if the port is found and removed from `ports_`.
+ bool PrunePort(PortInterface* port);
+- void NotifyRoleConflict();
++ void OnRoleConflict(PortInterface* port);
+
+ void OnConnectionStateChange(Connection* connection);
+ void OnReadPacket(Connection* connection, const ReceivedIpPacket& packet);
+diff --git a/p2p/base/port.cc b/p2p/base/port.cc
+index 2bab064184..68fb212bf4 100644
+--- a/p2p/base/port.cc
++++ b/p2p/base/port.cc
+@@ -682,7 +682,7 @@ bool Port::MaybeIceRoleConflict(const SocketAddress& addr,
+ case ICEROLE_CONTROLLING:
+ if (ICEROLE_CONTROLLING == remote_ice_role) {
+ if (remote_tiebreaker >= tiebreaker_) {
+- NotifyRoleConflict();
++ SignalRoleConflict(this);
} 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() {
- }
- }
+ // Send Role Conflict (487) error response.
+ SendBindingErrorResponse(stun_msg, addr, STUN_ERROR_ROLE_CONFLICT,
+@@ -694,7 +694,7 @@ bool Port::MaybeIceRoleConflict(const SocketAddress& addr,
+ case ICEROLE_CONTROLLED:
+ if (ICEROLE_CONTROLLED == remote_ice_role) {
+ if (remote_tiebreaker < tiebreaker_) {
+- NotifyRoleConflict();
++ SignalRoleConflict(this);
+ } else {
+ // Send Role Conflict (487) error response.
+ SendBindingErrorResponse(stun_msg, addr, STUN_ERROR_ROLE_CONFLICT,
+@@ -1021,13 +1021,4 @@ void Port::OnRequestLocalNetworkAccessPermission(
+ std::move(callback)(status);
+ }
-+ 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);
- }
- }
+-void Port::SubscribeRoleConflict(
+- std::function<void(PortInterface* /*unused*/)> callback) {
+- role_conflict_callback_list_.AddReceiver(std::move(callback));
+-}
-
-- return 0;
- }
+-void Port::NotifyRoleConflict() {
+- role_conflict_callback_list_.Send(this);
+-}
+-
+ } // namespace webrtc
+diff --git a/p2p/base/port.h b/p2p/base/port.h
+index 5ceddb477c..e25ec527a4 100644
+--- a/p2p/base/port.h
++++ b/p2p/base/port.h
+@@ -383,11 +383,6 @@ class RTC_EXPORT Port : public PortInterface, public sigslot::has_slots<> {
+
+ void GetStunStats(std::optional<StunStats>* /* stats */) override {}
+
+- // Signals for ICE role conflicts.
+- void SubscribeRoleConflict(
+- std::function<void(PortInterface*)> callback) override;
+- void NotifyRoleConflict() override;
+-
+ protected:
+ void UpdateNetworkCost() override;
- 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();
+@@ -557,8 +552,6 @@ class RTC_EXPORT Port : public PortInterface, public sigslot::has_slots<> {
+ CallbackList<Port*, const IceCandidateErrorEvent&>
+ candidate_error_callback_list_ RTC_GUARDED_BY(thread_);
+
+- CallbackList<PortInterface*> role_conflict_callback_list_;
+-
+ // Keep as the last member variable.
+ WeakPtrFactory<Port> weak_factory_ RTC_GUARDED_BY(thread_);
+ };
+diff --git a/p2p/base/port_interface.h b/p2p/base/port_interface.h
+index a25e6cd5c3..2335fc2434 100644
+--- a/p2p/base/port_interface.h
++++ b/p2p/base/port_interface.h
+@@ -124,9 +124,7 @@ class PortInterface {
+ std::function<void(PortInterface*)> callback) = 0;
+
+ // Signaled when Port discovers ice role conflict with the peer.
+- virtual void SubscribeRoleConflict(
+- std::function<void(PortInterface*)> callback) = 0;
+- virtual void NotifyRoleConflict() = 0;
++ sigslot::signal1<PortInterface*> SignalRoleConflict;
+
+ // Normally, packets arrive through a connection (or they result signaling of
+ // unknown address). Calling this method turns off delivery of packets
+diff --git a/p2p/base/port_unittest.cc b/p2p/base/port_unittest.cc
+index f8cdc6efac..60aa47d0fb 100644
+--- a/p2p/base/port_unittest.cc
++++ b/p2p/base/port_unittest.cc
+@@ -879,8 +879,7 @@ class PortTest : public ::testing::Test, public sigslot::has_slots<> {
+ .ice_username_fragment = username,
+ .ice_password = password};
+ auto port = std::make_unique<TestPort>(args, 0, 0);
+- port->SubscribeRoleConflict(
+- [this](const PortInterface*) { OnRoleConflict(); });
++ port->SignalRoleConflict.connect(this, &PortTest::OnRoleConflict);
+ return port;
+ }
+ std::unique_ptr<TestPort> CreateTestPort(const SocketAddress& addr,
+@@ -904,12 +903,11 @@ class PortTest : public ::testing::Test, public sigslot::has_slots<> {
+ .ice_username_fragment = username,
+ .ice_password = password};
+ auto port = std::make_unique<TestPort>(args, 0, 0);
+- port->SubscribeRoleConflict(
+- [this](const PortInterface*) { OnRoleConflict(); });
++ port->SignalRoleConflict.connect(this, &PortTest::OnRoleConflict);
+ return port;
}
-+ void MaybeSetTimeout();
-+
- const std::unique_ptr<StreamInterface> stream_;
- absl::AnyInvocable<void(SSLHandshakeError)> handshake_error_;
+- void OnRoleConflict() { role_conflict_ = true; }
++ void OnRoleConflict(PortInterface* port) { role_conflict_ = true; }
+ bool role_conflict() const { return role_conflict_; }
+ void ConnectToSignalDestroyed(PortInterface* port) {
diff --git a/third_party/libwebrtc/moz-patch-stack/p0001.patch b/third_party/libwebrtc/moz-patch-stack/p0002.patch