1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

LibWebSocket: Make WebSocketImpl an abstract class

The LibCore sockets implementation becomes WebSocketImplSerenity.
This will allow us to create a custom WebSocketImpl subclass for Qt
to use in Ladybird.
This commit is contained in:
Andreas Kling 2022-11-08 18:40:33 +01:00
parent cc78a74c51
commit be5f6aa46e
6 changed files with 144 additions and 81 deletions

View file

@ -8,6 +8,7 @@
#include <AK/Base64.h>
#include <AK/Random.h>
#include <LibCrypto/Hash/HashManager.h>
#include <LibWebSocket/Impl/WebSocketImplSerenity.h>
#include <LibWebSocket/WebSocket.h>
#include <unistd.h>
@ -30,7 +31,7 @@ void WebSocket::start()
{
VERIFY(m_state == WebSocket::InternalState::NotStarted);
VERIFY(!m_impl);
m_impl = WebSocketImpl::construct();
m_impl = adopt_ref(*new WebSocketImplSerenity);
m_impl->on_connection_error = [this] {
dbgln("WebSocket: Connection error (underlying socket)");