tor-browser

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

commit 168b2307c0931454bfe5ff18fba2f2ec5e3bd136
parent fcce9e82102b0cc4f3af4dad68cdca0b0e8a8ba5
Author: Dan Baker <dbaker@mozilla.com>
Date:   Thu, 20 Nov 2025 13:18:28 -0700

Bug 2000941 - Vendor libwebrtc from 43026fc7c8

Upstream commit: https://webrtc.googlesource.com/src/+/43026fc7c8858160b291760ce771d8f5be8fd8d3
    Add tagged subscribe/unsubscribe to SignalTrampoline

    Also use that for the Connect signal of AsyncPacketSocket.

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

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0001.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0027.patch | 18+++++++++---------
Mthird_party/libwebrtc/moz-patch-stack/s0053.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0091.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0094.patch | 6+++---
Mthird_party/libwebrtc/moz-patch-stack/s0102.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0107.patch | 8++++----
Mthird_party/libwebrtc/p2p/base/port_unittest.cc | 2+-
Mthird_party/libwebrtc/p2p/base/tcp_port.cc | 5+++--
Mthird_party/libwebrtc/p2p/base/turn_port.cc | 3++-
Mthird_party/libwebrtc/rtc_base/BUILD.gn | 1+
Mthird_party/libwebrtc/rtc_base/async_packet_socket.h | 14+++++++++++++-
Mthird_party/libwebrtc/rtc_base/async_tcp_socket.cc | 2+-
Mthird_party/libwebrtc/rtc_base/sigslot_trampoline.h | 4++++
15 files changed, 48 insertions(+), 29 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-20T20:14:58.471032+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-11-20T20:18:14.849190+00:00. # base of lastest vendoring -7042a3b097 +43026fc7c8 diff --git a/third_party/libwebrtc/moz-patch-stack/s0001.patch b/third_party/libwebrtc/moz-patch-stack/s0001.patch @@ -1383,7 +1383,7 @@ index 5ccc3d7d38..cd957416bc 100644 const bool enable_svc_for_simulcast_; std::optional<SimulcastToSvcConverter> simulcast_to_svc_converter_; diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 27cf292d16..8f22065957 100644 +index 2060770660..00af8c72fc 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -449,6 +449,12 @@ rtc_library("logging") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0027.patch b/third_party/libwebrtc/moz-patch-stack/s0027.patch @@ -1008,7 +1008,7 @@ index 39aa39a41c..b26e30e8bb 100644 "/config/external/nspr", "/nsprpub/lib/ds", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 8f22065957..447feb99f8 100644 +index 00af8c72fc..e9ba704d5c 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -326,6 +326,7 @@ rtc_library("sample_counter") { @@ -1120,7 +1120,7 @@ index 8f22065957..447feb99f8 100644 visibility = [ "*" ] sources = [ "async_packet_socket.cc", -@@ -1367,6 +1384,7 @@ rtc_library("async_packet_socket") { +@@ -1368,6 +1385,7 @@ rtc_library("async_packet_socket") { "//third_party/abseil-cpp/absl/functional:any_invocable", ] } @@ -1128,7 +1128,7 @@ index 8f22065957..447feb99f8 100644 if (rtc_include_tests) { rtc_library("async_packet_socket_unittest") { -@@ -1452,6 +1470,7 @@ rtc_library("data_rate_limiter") { +@@ -1453,6 +1471,7 @@ rtc_library("data_rate_limiter") { } rtc_library("unique_id_generator") { @@ -1136,7 +1136,7 @@ index 8f22065957..447feb99f8 100644 sources = [ "unique_id_generator.cc", "unique_id_generator.h", -@@ -1469,6 +1488,7 @@ rtc_library("unique_id_generator") { +@@ -1470,6 +1489,7 @@ rtc_library("unique_id_generator") { "//third_party/abseil-cpp/absl/strings:string_view", ] } @@ -1144,7 +1144,7 @@ index 8f22065957..447feb99f8 100644 rtc_library("crc32") { sources = [ -@@ -1500,6 +1520,7 @@ rtc_library("stream") { +@@ -1501,6 +1521,7 @@ rtc_library("stream") { } rtc_library("rtc_certificate_generator") { @@ -1152,7 +1152,7 @@ index 8f22065957..447feb99f8 100644 visibility = [ "*" ] sources = [ "rtc_certificate_generator.cc", -@@ -1514,6 +1535,7 @@ rtc_library("rtc_certificate_generator") { +@@ -1515,6 +1536,7 @@ rtc_library("rtc_certificate_generator") { "//third_party/abseil-cpp/absl/functional:any_invocable", ] } @@ -1160,7 +1160,7 @@ index 8f22065957..447feb99f8 100644 rtc_source_set("ssl_header") { visibility = [ "*" ] -@@ -1570,6 +1592,7 @@ rtc_library("crypto_random") { +@@ -1571,6 +1593,7 @@ rtc_library("crypto_random") { } rtc_library("ssl") { @@ -1168,7 +1168,7 @@ index 8f22065957..447feb99f8 100644 visibility = [ "*" ] sources = [ "openssl_key_pair.cc", -@@ -1642,6 +1665,7 @@ rtc_library("ssl") { +@@ -1643,6 +1666,7 @@ rtc_library("ssl") { deps += [ ":win32" ] } } @@ -1176,7 +1176,7 @@ index 8f22065957..447feb99f8 100644 rtc_library("ssl_adapter") { visibility = [ "*" ] -@@ -2366,7 +2390,7 @@ if (rtc_include_tests) { +@@ -2367,7 +2391,7 @@ if (rtc_include_tests) { } } diff --git a/third_party/libwebrtc/moz-patch-stack/s0053.patch b/third_party/libwebrtc/moz-patch-stack/s0053.patch @@ -29,7 +29,7 @@ index 7db75d5fd3..d0feb5007c 100644 rtc_library("task_queue_test") { visibility = [ "*" ] diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 447feb99f8..48d7a173fe 100644 +index e9ba704d5c..18107688b2 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -664,10 +664,14 @@ if (is_mac || is_ios) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0091.patch b/third_party/libwebrtc/moz-patch-stack/s0091.patch @@ -13,7 +13,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/4e7b3c485e549e7e3 1 file changed, 6 insertions(+) diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 48d7a173fe..37c41c2c68 100644 +index 18107688b2..394508e540 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -992,6 +992,12 @@ rtc_library("threading") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0094.patch b/third_party/libwebrtc/moz-patch-stack/s0094.patch @@ -9,10 +9,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/ee2f06666bcc6d22c 1 file changed, 2 insertions(+) diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 37c41c2c68..ec8f58e606 100644 +index 394508e540..407b23107b 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn -@@ -1678,6 +1678,7 @@ if (!build_with_mozilla) { +@@ -1679,6 +1679,7 @@ if (!build_with_mozilla) { } rtc_library("ssl_adapter") { @@ -20,7 +20,7 @@ index 37c41c2c68..ec8f58e606 100644 visibility = [ "*" ] sources = [ "openssl_adapter.cc", -@@ -1726,6 +1727,7 @@ rtc_library("ssl_adapter") { +@@ -1727,6 +1728,7 @@ rtc_library("ssl_adapter") { configs += [ "..:external_ssl_library" ] } } diff --git a/third_party/libwebrtc/moz-patch-stack/s0102.patch b/third_party/libwebrtc/moz-patch-stack/s0102.patch @@ -616,7 +616,7 @@ index 696829d6ca..81bd2a6215 100644 if (rtc_build_libsrtp) { diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index ec8f58e606..aa626933d5 100644 +index 407b23107b..ed7dfdc027 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -9,8 +9,8 @@ @@ -630,7 +630,7 @@ index ec8f58e606..aa626933d5 100644 } rtc_source_set("protobuf_utils") { -@@ -1919,8 +1919,8 @@ if (!rtc_rusty_base64) { +@@ -1920,8 +1920,8 @@ if (!rtc_rusty_base64) { ] } } else { diff --git a/third_party/libwebrtc/moz-patch-stack/s0107.patch b/third_party/libwebrtc/moz-patch-stack/s0107.patch @@ -116,10 +116,10 @@ index ecbb7eae7e..a13fe19324 100644 public_configs = [] if (!build_with_chromium) { diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index aa626933d5..ad1ce1383a 100644 +index ed7dfdc027..72ec909095 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn -@@ -1557,6 +1557,7 @@ rtc_source_set("ssl_header") { +@@ -1558,6 +1558,7 @@ rtc_source_set("ssl_header") { } rtc_library("digest") { @@ -127,7 +127,7 @@ index aa626933d5..ad1ce1383a 100644 visibility = [ "*" ] sources = [ "message_digest.cc", -@@ -1578,8 +1579,10 @@ rtc_library("digest") { +@@ -1579,8 +1580,10 @@ rtc_library("digest") { configs += [ "..:external_ssl_library" ] } } @@ -138,7 +138,7 @@ index aa626933d5..ad1ce1383a 100644 visibility = [ "*" ] sources = [ "crypto_random.cc", -@@ -1600,6 +1603,7 @@ rtc_library("crypto_random") { +@@ -1601,6 +1604,7 @@ rtc_library("crypto_random") { configs += [ "..:external_ssl_library" ] } } diff --git a/third_party/libwebrtc/p2p/base/port_unittest.cc b/third_party/libwebrtc/p2p/base/port_unittest.cc @@ -1811,7 +1811,7 @@ TEST_F(PortTest, TestDisableInterfaceOfTcpPort) { Connection* lconn = lport->CreateConnection(rport->Candidates()[0], Port::ORIGIN_MESSAGE); ASSERT_NE(lconn, nullptr); - socket->SignalConnect(socket); + socket->NotifyConnect(socket); lconn->Ping(0); // Now disconnect the client socket... diff --git a/third_party/libwebrtc/p2p/base/tcp_port.cc b/third_party/libwebrtc/p2p/base/tcp_port.cc @@ -626,7 +626,8 @@ void TCPConnection::ConnectSocketSignals(AsyncPacketSocket* socket) { // Incoming connections register SignalSentPacket and SignalReadyToSend // directly on the port in TCPPort::OnNewConnection. if (outgoing_) { - socket->SignalConnect.connect(this, &TCPConnection::OnConnect); + socket->SubscribeConnect( + this, [this](AsyncPacketSocket* socket) { OnConnect(socket); }); socket->SignalSentPacket.connect(this, &TCPConnection::OnSentPacket); socket->SignalReadyToSend.connect(this, &TCPConnection::OnReadyToSend); } @@ -647,7 +648,7 @@ void TCPConnection::ConnectSocketSignals(AsyncPacketSocket* socket) { void TCPConnection::DisconnectSocketSignals(AsyncPacketSocket* socket) { if (outgoing_) { // Incoming connections do not register these signals in TCPConnection. - socket->SignalConnect.disconnect(this); + socket->UnsubscribeConnect(this); socket->SignalReadyToSend.disconnect(this); socket->SignalSentPacket.disconnect(this); } diff --git a/third_party/libwebrtc/p2p/base/turn_port.cc b/third_party/libwebrtc/p2p/base/turn_port.cc @@ -490,7 +490,8 @@ bool TurnPort::CreateTurnClientSocket() { // while UDP port is ready to do so once the socket is created. if (server_address_.proto == PROTO_TCP || server_address_.proto == PROTO_TLS) { - socket_->SignalConnect.connect(this, &TurnPort::OnSocketConnect); + socket_->SubscribeConnect( + [this](AsyncPacketSocket* socket) { OnSocketConnect(socket); }); socket_->SubscribeCloseEvent( this, [this](AsyncPacketSocket* s, int err) { OnSocketClose(s, err); }); } else { diff --git a/third_party/libwebrtc/rtc_base/BUILD.gn b/third_party/libwebrtc/rtc_base/BUILD.gn @@ -1382,6 +1382,7 @@ if (!build_with_mozilla) { ":checks", ":dscp", ":macromagic", + ":sigslot_trampoline", ":socket", ":socket_address", ":timeutils", diff --git a/third_party/libwebrtc/rtc_base/async_packet_socket.h b/third_party/libwebrtc/rtc_base/async_packet_socket.h @@ -23,6 +23,7 @@ #include "rtc_base/dscp.h" #include "rtc_base/network/received_packet.h" #include "rtc_base/network/sent_packet.h" +#include "rtc_base/sigslot_trampoline.h" #include "rtc_base/socket.h" #include "rtc_base/socket_address.h" #include "rtc_base/system/no_unique_address.h" @@ -87,7 +88,7 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> { STATE_CONNECTED }; - AsyncPacketSocket() = default; + AsyncPacketSocket() : connect_trampoline_(this) {} ~AsyncPacketSocket() override; AsyncPacketSocket(const AsyncPacketSocket&) = delete; @@ -149,6 +150,15 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> { // Emitted for client TCP sockets when state is changed from // CONNECTING to CONNECTED. sigslot::signal1<AsyncPacketSocket*> SignalConnect; + void NotifyConnect(AsyncPacketSocket* socket) { SignalConnect(socket); } + void SubscribeConnect(absl::AnyInvocable<void(AsyncPacketSocket*)> callback) { + connect_trampoline_.Subscribe(std::move(callback)); + } + void SubscribeConnect(void* tag, + absl::AnyInvocable<void(AsyncPacketSocket*)> callback) { + connect_trampoline_.Subscribe(tag, std::move(callback)); + } + void UnsubscribeConnect(void* tag) { connect_trampoline_.Unsubscribe(tag); } void NotifyClosedForTest(int err) { NotifyClosed(err); } @@ -174,6 +184,8 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> { RTC_GUARDED_BY(&network_checker_); absl::AnyInvocable<void(AsyncPacketSocket*, const ReceivedIpPacket&)> received_packet_callback_ RTC_GUARDED_BY(&network_checker_); + SignalTrampoline<AsyncPacketSocket, &AsyncPacketSocket::SignalConnect> + connect_trampoline_; }; // Listen socket, producing an AsyncPacketSocket when a peer connects. diff --git a/third_party/libwebrtc/rtc_base/async_tcp_socket.cc b/third_party/libwebrtc/rtc_base/async_tcp_socket.cc @@ -179,7 +179,7 @@ void AsyncTCPSocketBase::AppendToOutBuffer(const void* pv, size_t cb) { } void AsyncTCPSocketBase::OnConnectEvent(Socket* socket) { - SignalConnect(this); + NotifyConnect(this); } void AsyncTCPSocketBase::OnReadEvent(Socket* socket) { diff --git a/third_party/libwebrtc/rtc_base/sigslot_trampoline.h b/third_party/libwebrtc/rtc_base/sigslot_trampoline.h @@ -71,6 +71,10 @@ class SignalTrampolineBase<sigslot::signal<Args...>> void Subscribe(absl::AnyInvocable<void(Args...)> callback) { callbacks_.AddReceiver(std::move(callback)); } + void Subscribe(const void* tag, absl::AnyInvocable<void(Args...)> callback) { + callbacks_.AddReceiver(tag, std::move(callback)); + } + void Unsubscribe(const void* tag) { callbacks_.RemoveReceivers(tag); } void Notify(Args... args) { callbacks_.Send(args...); } private: