1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:55:09 +00:00

Ladybird: Add subclass of WebSocket::WebSocketImpl using Qt networking

This commit is contained in:
Andreas Kling 2022-11-08 19:17:53 +01:00 committed by Andrew Kaster
parent acd70f44c2
commit 385c12c8b6
4 changed files with 140 additions and 2 deletions

View file

@ -6,6 +6,7 @@
*/
#include "WebSocketClientManagerLadybird.h"
#include "WebSocketImplQt.h"
#include "WebSocketLadybird.h"
namespace Ladybird {
@ -23,8 +24,10 @@ RefPtr<Web::WebSockets::WebSocketClientSocket> WebSocketClientManagerLadybird::c
WebSocket::ConnectionInfo connection_info(url);
connection_info.set_origin(origin);
auto connection = WebSocketLadybird::create(WebSocket::WebSocket::create(move(connection_info)));
return connection;
auto impl = adopt_ref(*new WebSocketImplQt);
auto web_socket = WebSocket::WebSocket::create(move(connection_info), move(impl));
web_socket->start();
return WebSocketLadybird::create(web_socket);
}
}