LibWebSocket: Allow library clients to provide their own WebSocketImpl

This commit is contained in:
Andreas Kling 2022-11-08 19:17:29 +01:00
commit 9bbad08546
Notes: sideshowbarker 2024-07-17 04:39:31 +09:00
2 changed files with 9 additions and 7 deletions

View file

@ -25,7 +25,7 @@ enum class ReadyState {
class WebSocket final : public Core::Object {
C_OBJECT(WebSocket)
public:
static NonnullRefPtr<WebSocket> create(ConnectionInfo);
static NonnullRefPtr<WebSocket> create(ConnectionInfo, RefPtr<WebSocketImpl> = nullptr);
virtual ~WebSocket() override = default;
URL const& url() const { return m_connection.url(); }
@ -54,7 +54,7 @@ public:
Function<void(Error)> on_error;
private:
explicit WebSocket(ConnectionInfo);
WebSocket(ConnectionInfo, RefPtr<WebSocketImpl>);
// As defined in section 5.2
enum class OpCode : u8 {