LibWebRTCSocketClient.h [plain text]
#pragma once
#if USE(LIBWEBRTC)
#include "NetworkRTCProvider.h"
#include <webrtc/rtc_base/async_packet_socket.h>
namespace rtc {
class AsyncPacketSocket;
struct SentPacket;
typedef int64_t PacketTime;
}
namespace WebKit {
class LibWebRTCSocketClient final : public NetworkRTCProvider::Socket, public sigslot::has_slots<> {
WTF_MAKE_FAST_ALLOCATED;
public:
LibWebRTCSocketClient(WebCore::LibWebRTCSocketIdentifier, NetworkRTCProvider&, std::unique_ptr<rtc::AsyncPacketSocket>&&, Type, Ref<IPC::Connection>&&);
private:
WebCore::LibWebRTCSocketIdentifier identifier() const final { return m_identifier; }
Type type() const final { return m_type; }
void close() final;
void setOption(int option, int value) final;
void sendTo(const uint8_t*, size_t, const rtc::SocketAddress&, const rtc::PacketOptions&) final;
void signalReadPacket(rtc::AsyncPacketSocket*, const char*, size_t, const rtc::SocketAddress&, const rtc::PacketTime&);
void signalSentPacket(rtc::AsyncPacketSocket*, const rtc::SentPacket&);
void signalAddressReady(rtc::AsyncPacketSocket*, const rtc::SocketAddress&);
void signalConnect(rtc::AsyncPacketSocket*);
void signalClose(rtc::AsyncPacketSocket*, int);
void signalNewConnection(rtc::AsyncPacketSocket* socket, rtc::AsyncPacketSocket* newSocket);
void signalAddressReady();
WebCore::LibWebRTCSocketIdentifier m_identifier;
Type m_type;
NetworkRTCProvider& m_rtcProvider;
std::unique_ptr<rtc::AsyncPacketSocket> m_socket;
Ref<IPC::Connection> m_connection;
int m_sendError { 0 };
};
}
#endif // USE(LIBWEBRTC)