diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/libwebrtc/rtc_base/async_packet_socket.h | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/rtc_base/async_packet_socket.h')
-rw-r--r-- | third_party/libwebrtc/rtc_base/async_packet_socket.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/third_party/libwebrtc/rtc_base/async_packet_socket.h b/third_party/libwebrtc/rtc_base/async_packet_socket.h index 0d3ceb94e7..768fcd446b 100644 --- a/third_party/libwebrtc/rtc_base/async_packet_socket.h +++ b/third_party/libwebrtc/rtc_base/async_packet_socket.h @@ -11,11 +11,13 @@ #ifndef RTC_BASE_ASYNC_PACKET_SOCKET_H_ #define RTC_BASE_ASYNC_PACKET_SOCKET_H_ +#include <cstdint> #include <vector> #include "api/sequence_checker.h" #include "rtc_base/callback_list.h" #include "rtc_base/dscp.h" +#include "rtc_base/network/received_packet.h" #include "rtc_base/network/sent_packet.h" #include "rtc_base/socket.h" #include "rtc_base/system/no_unique_address.h" @@ -115,8 +117,14 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> { std::function<void(AsyncPacketSocket*, int)> callback); void UnsubscribeCloseEvent(const void* removal_tag); + void RegisterReceivedPacketCallback( + absl::AnyInvocable<void(AsyncPacketSocket*, const rtc::ReceivedPacket&)> + received_packet_callback); + void DeregisterReceivedPacketCallback(); + // Emitted each time a packet is read. Used only for UDP and // connected TCP sockets. + // TODO(bugs.webrtc.org:15368): Deprecate and remove. sigslot::signal5<AsyncPacketSocket*, const char*, size_t, @@ -155,12 +163,26 @@ 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_{ webrtc::SequenceChecker::kDetached}; private: webrtc::CallbackList<AsyncPacketSocket*, int> on_close_ RTC_GUARDED_BY(&network_checker_); + absl::AnyInvocable<void(AsyncPacketSocket*, const rtc::ReceivedPacket&)> + received_packet_callback_ RTC_GUARDED_BY(&network_checker_); }; // Listen socket, producing an AsyncPacketSocket when a peer connects. |