tor-browser

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

commit 99ab3684ff82fe5a2d0d226818a489f500288d4c
parent f79b2938ded3e2a655e948970ff06af1ff168a32
Author: Dan Baker <dbaker@mozilla.com>
Date:   Fri, 24 Oct 2025 12:27:42 -0600

Bug 1995393 - Vendor libwebrtc from 39dc944355

Upstream commit: https://webrtc.googlesource.com/src/+/39dc944355b78ac951deaf9e07f827242c8a9fcf
    replace sigslot signal candidate error with callbacklist

    Bug: webrtc:42222066
    Change-Id: I55961074151750c4510db353ed5b81204f0730e4
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/405300
    Commit-Queue: Harald Alvestrand <hta@webrtc.org>
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45390}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/p2p/base/port.cc | 11++++++++++-
Mthird_party/libwebrtc/p2p/base/port.h | 6+++++-
Mthird_party/libwebrtc/p2p/base/stun_port.cc | 7+++----
Mthird_party/libwebrtc/p2p/base/stun_port_unittest.cc | 6++++--
Mthird_party/libwebrtc/p2p/base/turn_port.cc | 3+--
Mthird_party/libwebrtc/p2p/base/turn_port_unittest.cc | 7+++++--
Mthird_party/libwebrtc/p2p/client/basic_port_allocator.cc | 6++++--
8 files changed, 34 insertions(+), 16 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-24T18:25:25.274920+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-24T18:27:33.031750+00:00. # base of lastest vendoring -802c38c304 +39dc944355 diff --git a/third_party/libwebrtc/p2p/base/port.cc b/third_party/libwebrtc/p2p/base/port.cc @@ -309,6 +309,15 @@ void Port::PostAddAddress(bool is_final) { } } +void Port::SubscribeCandidateError( + std::function<void(Port*, const IceCandidateErrorEvent&)> callback) { + candidate_error_callback_list_.AddReceiver(std::move(callback)); +} + +void Port::SendCandidateError(const IceCandidateErrorEvent& event) { + candidate_error_callback_list_.Send(this, event); +} + void Port::AddOrReplaceConnection(Connection* conn) { auto ret = connections_.insert( std::make_pair(conn->remote_candidate().address(), conn)); @@ -838,7 +847,7 @@ void Port::DestroyIfDead() { void Port::SubscribePortDestroyed( std::function<void(PortInterface*)> callback) { - port_destroyed_callback_list_.AddReceiver(callback); + port_destroyed_callback_list_.AddReceiver(std::move(callback)); } void Port::SendPortDestroyed(Port* port) { diff --git a/third_party/libwebrtc/p2p/base/port.h b/third_party/libwebrtc/p2p/base/port.h @@ -257,7 +257,9 @@ class RTC_EXPORT Port : public PortInterface, public sigslot::has_slots<> { // Provides all of the above information in one handy object. const std::vector<Candidate>& Candidates() const override; // Fired when candidate discovery failed using certain server. - sigslot::signal2<Port*, const IceCandidateErrorEvent&> SignalCandidateError; + void SubscribeCandidateError( + std::function<void(Port*, const IceCandidateErrorEvent&)> callback); + void SendCandidateError(const IceCandidateErrorEvent& candidate_error_event); // SignalPortComplete is sent when port completes the task of candidates // allocation. @@ -517,6 +519,8 @@ class RTC_EXPORT Port : public PortInterface, public sigslot::has_slots<> { permission_queries_; CallbackList<PortInterface*> port_destroyed_callback_list_; + CallbackList<Port*, const IceCandidateErrorEvent&> + candidate_error_callback_list_; // Keep as the last member variable. WeakPtrFactory<Port> weak_factory_; diff --git a/third_party/libwebrtc/p2p/base/stun_port.cc b/third_party/libwebrtc/p2p/base/stun_port.cc @@ -574,10 +574,9 @@ void UDPPort::OnStunBindingOrResolveRequestFailed( if (error_code != STUN_ERROR_NOT_AN_ERROR) { StringBuilder url; url << "stun:" << stun_server_addr.ToString(); - SignalCandidateError( - this, IceCandidateErrorEvent( - GetLocalAddress().HostAsSensitiveURIString(), - GetLocalAddress().port(), url.str(), error_code, reason)); + SendCandidateError(IceCandidateErrorEvent( + GetLocalAddress().HostAsSensitiveURIString(), GetLocalAddress().port(), + url.str(), error_code, reason)); } if (bind_request_failed_servers_.find(stun_server_addr) != bind_request_failed_servers_.end()) { diff --git a/third_party/libwebrtc/p2p/base/stun_port_unittest.cc b/third_party/libwebrtc/p2p/base/stun_port_unittest.cc @@ -218,8 +218,10 @@ class StunPortTestBase : public ::testing::Test, public sigslot::has_slots<> { stun_port_->SignalPortComplete.connect(this, &StunPortTestBase::OnPortComplete); stun_port_->SignalPortError.connect(this, &StunPortTestBase::OnPortError); - stun_port_->SignalCandidateError.connect( - this, &StunPortTestBase::OnCandidateError); + stun_port_->SubscribeCandidateError( + [this](Port* port, const IceCandidateErrorEvent& event) { + OnCandidateError(port, event); + }); } void CreateSharedUdpPort( diff --git a/third_party/libwebrtc/p2p/base/turn_port.cc b/third_party/libwebrtc/p2p/base/turn_port.cc @@ -940,8 +940,7 @@ void TurnPort::OnAllocateError(int error_code, absl::string_view reason) { port = 0; } if (error_code != STUN_ERROR_NOT_AN_ERROR) { - SignalCandidateError( - this, + SendCandidateError( IceCandidateErrorEvent(address, port, server_url_, error_code, reason)); } } diff --git a/third_party/libwebrtc/p2p/base/turn_port_unittest.cc b/third_party/libwebrtc/p2p/base/turn_port_unittest.cc @@ -367,8 +367,11 @@ class TurnPortTest : public ::testing::Test, turn_port_->SignalPortComplete.connect(this, &TurnPortTest::OnTurnPortComplete); turn_port_->SignalPortError.connect(this, &TurnPortTest::OnTurnPortError); - turn_port_->SignalCandidateError.connect(this, - &TurnPortTest::OnCandidateError); + turn_port_->SubscribeCandidateError( + [this](Port* port, const IceCandidateErrorEvent& event) { + OnCandidateError(port, event); + }); + turn_port_->SignalUnknownAddress.connect( this, &TurnPortTest::OnTurnUnknownAddress); turn_port_->SubscribePortDestroyed( diff --git a/third_party/libwebrtc/p2p/client/basic_port_allocator.cc b/third_party/libwebrtc/p2p/client/basic_port_allocator.cc @@ -922,8 +922,10 @@ void BasicPortAllocatorSession::AddAllocatedPort(Port* port, port->SignalCandidateReady.connect( this, &BasicPortAllocatorSession::OnCandidateReady); - port->SignalCandidateError.connect( - this, &BasicPortAllocatorSession::OnCandidateError); + port->SubscribeCandidateError( + [this](Port* port, const IceCandidateErrorEvent& event) { + OnCandidateError(port, event); + }); port->SignalPortComplete.connect(this, &BasicPortAllocatorSession::OnPortComplete); port->SubscribePortDestroyed(