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