From 2fafcec0c5406526b2a6cae7b92e40f580229f93 Mon Sep 17 00:00:00 2001 From: Per K Date: Thu, 22 Feb 2024 07:42:42 +0100 Subject: [PATCH] Remove unused AsyncPacketSocket::NotifyPacketReceived Bug: webrtc:15368 Change-Id: Icb1d566670442604172fa1c03fc77e75ab9fde1f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340144 Commit-Queue: Per Kjellander Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#41789} --- rtc_base/BUILD.gn | 1 + rtc_base/async_packet_socket.h | 10 ---------- rtc_base/async_packet_socket_unittest.cc | 8 +++----- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index 2cf9c11316..4a0427b332 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -1385,6 +1385,7 @@ if (rtc_include_tests) { deps = [ ":async_packet_socket", ":gunit_helpers", + ":socket_address", "../test:test_support", "network:received_packet", "third_party/sigslot", diff --git a/rtc_base/async_packet_socket.h b/rtc_base/async_packet_socket.h index 740c0bb61f..8523a0b079 100644 --- a/rtc_base/async_packet_socket.h +++ b/rtc_base/async_packet_socket.h @@ -151,16 +151,6 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> { on_close_.Send(this, err); } - // TODO(bugs.webrtc.org:15368): Deprecate and remove. - void NotifyPacketReceived(AsyncPacketSocket*, - const char* data, - size_t size, - const SocketAddress& address, - const int64_t& packet_time_us) { - NotifyPacketReceived( - ReceivedPacket::CreateFromLegacy(data, size, packet_time_us, address)); - } - void NotifyPacketReceived(const rtc::ReceivedPacket& packet); RTC_NO_UNIQUE_ADDRESS webrtc::SequenceChecker network_checker_{ diff --git a/rtc_base/async_packet_socket_unittest.cc b/rtc_base/async_packet_socket_unittest.cc index 1d66821958..ce9f2c3521 100644 --- a/rtc_base/async_packet_socket_unittest.cc +++ b/rtc_base/async_packet_socket_unittest.cc @@ -10,6 +10,7 @@ #include "rtc_base/async_packet_socket.h" +#include "rtc_base/socket_address.h" #include "rtc_base/third_party/sigslot/sigslot.h" #include "test/gmock.h" #include "test/gtest.h" @@ -47,10 +48,7 @@ class MockAsyncPacketSocket : public rtc::AsyncPacketSocket { MOCK_METHOD(int, GetError, (), (const, override)); MOCK_METHOD(void, SetError, (int error), (override)); - void NotifyPacketReceived() { - char data[1] = {'a'}; - AsyncPacketSocket::NotifyPacketReceived(this, data, 1, SocketAddress(), -1); - } + using AsyncPacketSocket::NotifyPacketReceived; }; TEST(AsyncPacketSocket, RegisteredCallbackReceivePacketsFromNotify) { @@ -60,7 +58,7 @@ TEST(AsyncPacketSocket, RegisteredCallbackReceivePacketsFromNotify) { EXPECT_CALL(received_packet, Call); mock_socket.RegisterReceivedPacketCallback(received_packet.AsStdFunction()); - mock_socket.NotifyPacketReceived(); + mock_socket.NotifyPacketReceived(ReceivedPacket({}, SocketAddress())); } } // namespace