/* * Copyright (c) 2022, Dex♪ * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Ladybird { class WebSocketLadybird : public Web::WebSockets::WebSocketClientSocket , public Weakable { public: static NonnullRefPtr create(NonnullRefPtr); virtual ~WebSocketLadybird() override; virtual Web::WebSockets::WebSocket::ReadyState ready_state() override; virtual void send(ByteBuffer binary_or_text_message, bool is_text) override; virtual void send(StringView message) override; virtual void close(u16 code, String reason) override; private: explicit WebSocketLadybird(NonnullRefPtr); NonnullRefPtr m_websocket; }; }