tor-browser

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

commit 30bd6b779c5471671dbc654b964b813edc347e0b
parent c6a34577634db0923f15b815ab75e1a466c236ec
Author: Dan Baker <dbaker@mozilla.com>
Date:   Wed, 19 Nov 2025 21:20:02 -0700

Bug 2000941 - Vendor libwebrtc from 35d9a8f86a

Upstream commit: https://webrtc.googlesource.com/src/+/35d9a8f86a90ddfebd9c8b5f6ddce14b68a1a879
    Use non-signal APIs to IceTransportInternal signals

    This CL doesn't remove visibility of the signals yet, since Chrome
    has not been updated.

    Bug: webrtc:42222066
    Change-Id: I13cbbed1895e75d9295607f16dfd5ce3c1599b48
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407380
    Commit-Queue: Harald Alvestrand <hta@webrtc.org>
    Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45533}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/p2p/base/p2p_transport_channel.cc | 12++++++------
Mthird_party/libwebrtc/p2p/base/p2p_transport_channel.h | 2+-
Mthird_party/libwebrtc/p2p/base/p2p_transport_channel_unittest.cc | 16++++++++++------
Mthird_party/libwebrtc/p2p/base/regathering_controller.cc | 6++++--
Mthird_party/libwebrtc/p2p/dtls/dtls_ice_integrationtest.cc | 14++++++++++----
Mthird_party/libwebrtc/p2p/test/fake_ice_transport.h | 4++--
Mthird_party/libwebrtc/pc/jsep_transport_controller.cc | 21+++++++++++++++------
Mthird_party/libwebrtc/pc/jsep_transport_controller_unittest.cc | 6+++---
9 files changed, 53 insertions(+), 32 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-20T03:15:26.001708+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-11-20T04:04:31.852655+00:00. # base of lastest vendoring -40f12502fa +35d9a8f86a diff --git a/third_party/libwebrtc/p2p/base/p2p_transport_channel.cc b/third_party/libwebrtc/p2p/base/p2p_transport_channel.cc @@ -916,7 +916,7 @@ void P2PTransportChannel::OnPortReady(PortAllocatorSession* /* session */, port->SubscribePortDestroyed( [this](PortInterface* port) { OnPortDestroyed(port); }); - port->SubscribeRoleConflict([this]() { NotifyRoleConflict(); }); + port->SubscribeRoleConflict([this] { NotifyRoleConflictInternal(); }); // Attempt to create a connection from this new port to all of the remote // candidates that we were given so far. @@ -936,7 +936,7 @@ void P2PTransportChannel::OnCandidatesReady( const std::vector<Candidate>& candidates) { RTC_DCHECK_RUN_ON(network_thread_); for (size_t i = 0; i < candidates.size(); ++i) { - SignalCandidateGathered(this, candidates[i]); + NotifyCandidateGathered(this, candidates[i]); } } @@ -1123,8 +1123,8 @@ void P2PTransportChannel::OnCandidateFilterChanged(uint32_t prev_filter, } } -void P2PTransportChannel::NotifyRoleConflict() { - SignalRoleConflict(this); // STUN ping will be sent when SetRole is called +void P2PTransportChannel::NotifyRoleConflictInternal() { + NotifyRoleConflict(this); // STUN ping will be sent when SetRole is called // from Transport. } @@ -1969,8 +1969,8 @@ void P2PTransportChannel::UpdateTransportState() { standardized_state_ = current_standardized_state; state_ = state; // Unconditionally signal change, no matter what changed. - // TODO: issues.webrtc.org/42234495 - rmeove nonstandard state_ - SignalIceTransportStateChanged(this); + // TODO: issues.webrtc.org/42234495 - remove nonstandard state_ + NotifyIceTransportStateChanged(this); } } diff --git a/third_party/libwebrtc/p2p/base/p2p_transport_channel.h b/third_party/libwebrtc/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 NotifyRoleConflictInternal(); void OnConnectionStateChange(Connection* connection); void OnReadPacket(Connection* connection, const ReceivedIpPacket& packet); diff --git a/third_party/libwebrtc/p2p/base/p2p_transport_channel_unittest.cc b/third_party/libwebrtc/p2p/base/p2p_transport_channel_unittest.cc @@ -490,8 +490,10 @@ class P2PTransportChannelTestBase : public ::testing::Test, std::move(init)); channel->SignalReadyToSend.connect( this, &P2PTransportChannelTestBase::OnReadyToSend); - channel->SignalCandidateGathered.connect( - this, &P2PTransportChannelTestBase::OnCandidateGathered); + channel->SubscribeCandidateGathered( + [this](IceTransportInternal* transport, const Candidate& candidate) { + OnCandidateGathered(transport, candidate); + }); channel->SetCandidatesRemovedCallback( [this](IceTransportInternal* transport, const Candidates& candidates) { OnCandidatesRemoved(transport, candidates); @@ -501,8 +503,8 @@ class P2PTransportChannelTestBase : public ::testing::Test, const ReceivedIpPacket& packet) { OnReadPacket(transport, packet); }); - channel->SignalRoleConflict.connect( - this, &P2PTransportChannelTestBase::OnRoleConflict); + channel->SubscribeRoleConflict( + [this](IceTransportInternal* transport) { OnRoleConflict(transport); }); channel->SignalNetworkRouteChanged.connect( this, &P2PTransportChannelTestBase::OnNetworkRouteChanged); channel->SignalSentPacket.connect( @@ -3585,8 +3587,10 @@ class P2PTransportChannelPingTest : public ::testing::Test, this, &P2PTransportChannelPingTest::OnNetworkRouteChanged); ch->SignalReadyToSend.connect(this, &P2PTransportChannelPingTest::OnReadyToSend); - ch->SignalIceTransportStateChanged.connect( - this, &P2PTransportChannelPingTest::OnChannelStateChanged); + ch->SubscribeIceTransportStateChanged( + [this](IceTransportInternal* transport) { + OnChannelStateChanged(transport); + }); ch->SetCandidatePairChangeCallback( [this](const CandidatePairChangeEvent& event) { OnCandidatePairChanged(event); diff --git a/third_party/libwebrtc/p2p/base/regathering_controller.cc b/third_party/libwebrtc/p2p/base/regathering_controller.cc @@ -27,8 +27,10 @@ BasicRegatheringController::BasicRegatheringController( RTC_DCHECK(thread_); RTC_DCHECK_RUN_ON(thread_); RTC_DCHECK(ice_transport_); - ice_transport_->SignalIceTransportStateChanged.connect( - this, &BasicRegatheringController::OnIceTransportStateChanged); + ice_transport_->SubscribeIceTransportStateChanged( + [this](IceTransportInternal* transport) { + OnIceTransportStateChanged(transport); + }); ice_transport->SignalWritableState.connect( this, &BasicRegatheringController::OnIceTransportWritableState); ice_transport->SignalReceivingState.connect( diff --git a/third_party/libwebrtc/p2p/dtls/dtls_ice_integrationtest.cc b/third_party/libwebrtc/p2p/dtls/dtls_ice_integrationtest.cc @@ -192,11 +192,17 @@ class DtlsIceIntegrationTest : public ::testing::TestWithParam<std::tuple< : ICEROLE_CONTROLLED); } if (client) { - ep.ice->SignalCandidateGathered.connect( - this, &DtlsIceIntegrationTest::CandidateC2S); + ep.ice->SubscribeCandidateGathered( + [this](IceTransportInternal* transport, + const Candidate& candidate) { + CandidateC2S(transport, candidate); + }); } else { - ep.ice->SignalCandidateGathered.connect( - this, &DtlsIceIntegrationTest::CandidateS2C); + ep.ice->SubscribeCandidateGathered( + [this](IceTransportInternal* transport, + const Candidate& candidate) { + CandidateS2C(transport, candidate); + }); } // Setup DTLS. diff --git a/third_party/libwebrtc/p2p/test/fake_ice_transport.h b/third_party/libwebrtc/p2p/test/fake_ice_transport.h @@ -150,7 +150,7 @@ class FakeIceTransport : public IceTransportInternal { RTC_DCHECK_RUN_ON(network_thread_); transport_state_ = state; legacy_transport_state_ = legacy_state; - SignalIceTransportStateChanged(this); + NotifyIceTransportStateChanged(this); } void SetConnectionCount(size_t connection_count) { @@ -163,7 +163,7 @@ class FakeIceTransport : public IceTransportInternal { // In this fake transport channel, `connection_count_` determines the // transport state. if (connection_count_ < old_connection_count) { - SignalIceTransportStateChanged(this); + NotifyIceTransportStateChanged(this); } } diff --git a/third_party/libwebrtc/pc/jsep_transport_controller.cc b/third_party/libwebrtc/pc/jsep_transport_controller.cc @@ -523,8 +523,11 @@ JsepTransportController::CreateDtlsTransport(const ContentInfo& content_info, RTC_DCHECK_RUN_ON(network_thread_); OnTransportGatheringState_n(transport); }); - dtls->ice_transport()->SignalCandidateGathered.connect( - this, &JsepTransportController::OnTransportCandidateGathered_n); + dtls->ice_transport()->SubscribeCandidateGathered( + [this](IceTransportInternal* transport, const Candidate& candidate) { + RTC_DCHECK_RUN_ON(network_thread_); + OnTransportCandidateGathered_n(transport, candidate); + }); dtls->ice_transport()->SetCandidateErrorCallback( [this](IceTransportInternal* transport, const IceCandidateErrorEvent& error) { @@ -536,10 +539,16 @@ JsepTransportController::CreateDtlsTransport(const ContentInfo& content_info, RTC_DCHECK_RUN_ON(network_thread_); OnTransportCandidatesRemoved_n(transport, candidates); }); - dtls->ice_transport()->SignalRoleConflict.connect( - this, &JsepTransportController::OnTransportRoleConflict_n); - dtls->ice_transport()->SignalIceTransportStateChanged.connect( - this, &JsepTransportController::OnTransportStateChanged_n); + dtls->ice_transport()->SubscribeRoleConflict( + [this](IceTransportInternal* transport) { + RTC_DCHECK_RUN_ON(network_thread_); + OnTransportRoleConflict_n(transport); + }); + dtls->ice_transport()->SubscribeIceTransportStateChanged( + [this](IceTransportInternal* transport) { + RTC_DCHECK_RUN_ON(network_thread_); + OnTransportStateChanged_n(transport); + }); dtls->ice_transport()->SetCandidatePairChangeCallback( [this](const CandidatePairChangeEvent& event) { RTC_DCHECK_RUN_ON(network_thread_); diff --git a/third_party/libwebrtc/pc/jsep_transport_controller_unittest.cc b/third_party/libwebrtc/pc/jsep_transport_controller_unittest.cc @@ -306,9 +306,9 @@ class JsepTransportControllerTest : public JsepTransportController::Observer, transport_controller_->GetDtlsTransport(kAudioMid1)); auto fake_video_dtls = static_cast<FakeDtlsTransport*>( transport_controller_->GetDtlsTransport(kVideoMid1)); - fake_audio_dtls->fake_ice_transport()->SignalCandidateGathered( + fake_audio_dtls->fake_ice_transport()->NotifyCandidateGathered( fake_audio_dtls->fake_ice_transport(), CreateCandidate()); - fake_video_dtls->fake_ice_transport()->SignalCandidateGathered( + fake_video_dtls->fake_ice_transport()->NotifyCandidateGathered( fake_video_dtls->fake_ice_transport(), CreateCandidate()); fake_audio_dtls->fake_ice_transport()->SetCandidatesGatheringComplete(); fake_video_dtls->fake_ice_transport()->SetCandidatesGatheringComplete(); @@ -1118,7 +1118,7 @@ TEST_F(JsepTransportControllerTest, SignalCandidatesGathered) { auto fake_audio_dtls = static_cast<FakeDtlsTransport*>( transport_controller_->GetDtlsTransport(kAudioMid1)); - fake_audio_dtls->fake_ice_transport()->SignalCandidateGathered( + fake_audio_dtls->fake_ice_transport()->NotifyCandidateGathered( fake_audio_dtls->fake_ice_transport(), CreateCandidate()); EXPECT_THAT( WaitUntil([&] { return 1; }, ::testing::Eq(candidates_signal_count_),