diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/rtc_base/virtual_socket_unittest.cc | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/rtc_base/virtual_socket_unittest.cc')
-rw-r--r-- | third_party/libwebrtc/rtc_base/virtual_socket_unittest.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/third_party/libwebrtc/rtc_base/virtual_socket_unittest.cc b/third_party/libwebrtc/rtc_base/virtual_socket_unittest.cc index 67585b1fcd..8efc9d8223 100644 --- a/third_party/libwebrtc/rtc_base/virtual_socket_unittest.cc +++ b/third_party/libwebrtc/rtc_base/virtual_socket_unittest.cc @@ -13,6 +13,8 @@ #include <stdlib.h> #include <string.h> #include <time.h> + +#include "rtc_base/network/received_packet.h" #if defined(WEBRTC_POSIX) #include <netinet/in.h> #endif @@ -101,7 +103,10 @@ struct Receiver : public sigslot::has_slots<> { sum(0), sum_sq(0), samples(0) { - socket->SignalReadPacket.connect(this, &Receiver::OnReadPacket); + socket->RegisterReceivedPacketCallback( + [&](rtc::AsyncPacketSocket* socket, const rtc::ReceivedPacket& packet) { + OnReadPacket(socket, packet); + }); periodic = RepeatingTaskHandle::DelayedStart( thread, TimeDelta::Seconds(1), [this] { // It is always possible for us to receive more than expected because @@ -116,18 +121,15 @@ struct Receiver : public sigslot::has_slots<> { ~Receiver() override { periodic.Stop(); } - void OnReadPacket(AsyncPacketSocket* s, - const char* data, - size_t size, - const SocketAddress& remote_addr, - const int64_t& /* packet_time_us */) { + void OnReadPacket(AsyncPacketSocket* s, const rtc::ReceivedPacket& packet) { ASSERT_EQ(socket.get(), s); - ASSERT_GE(size, 4U); + ASSERT_GE(packet.payload().size(), 4U); - count += size; - sec_count += size; + count += packet.payload().size(); + sec_count += packet.payload().size(); - uint32_t send_time = *reinterpret_cast<const uint32_t*>(data); + uint32_t send_time = + *reinterpret_cast<const uint32_t*>(packet.payload().data()); uint32_t recv_time = rtc::TimeMillis(); uint32_t delay = recv_time - send_time; sum += delay; |