From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/rtc_base/thread_unittest.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'third_party/libwebrtc/rtc_base/thread_unittest.cc') diff --git a/third_party/libwebrtc/rtc_base/thread_unittest.cc b/third_party/libwebrtc/rtc_base/thread_unittest.cc index cd733db2cd..11ee2abc9f 100644 --- a/third_party/libwebrtc/rtc_base/thread_unittest.cc +++ b/third_party/libwebrtc/rtc_base/thread_unittest.cc @@ -22,6 +22,7 @@ #include "rtc_base/fake_clock.h" #include "rtc_base/gunit.h" #include "rtc_base/internal/default_socket_server.h" +#include "rtc_base/network/received_packet.h" #include "rtc_base/null_socket_server.h" #include "rtc_base/physical_socket_server.h" #include "rtc_base/ref_counted_object.h" @@ -84,20 +85,20 @@ class SocketClient : public TestGenerator, public sigslot::has_slots<> { : socket_(AsyncUDPSocket::Create(socket, addr)), post_thread_(post_thread), post_handler_(phandler) { - socket_->SignalReadPacket.connect(this, &SocketClient::OnPacket); + socket_->RegisterReceivedPacketCallback( + [&](rtc::AsyncPacketSocket* socket, const rtc::ReceivedPacket& packet) { + OnPacket(socket, packet); + }); } ~SocketClient() override { delete socket_; } SocketAddress address() const { return socket_->GetLocalAddress(); } - void OnPacket(AsyncPacketSocket* socket, - const char* buf, - size_t size, - const SocketAddress& remote_addr, - const int64_t& packet_time_us) { - EXPECT_EQ(size, sizeof(uint32_t)); - uint32_t prev = reinterpret_cast(buf)[0]; + void OnPacket(AsyncPacketSocket* socket, const rtc::ReceivedPacket& packet) { + EXPECT_EQ(packet.payload().size(), sizeof(uint32_t)); + uint32_t prev = + reinterpret_cast(packet.payload().data())[0]; uint32_t result = Next(prev); post_thread_->PostDelayedTask([post_handler_ = post_handler_, -- cgit v1.2.3