1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 11:14:58 +00:00
serenity/Ladybird/Qt/WebSocketClientManagerQt.cpp
Shannon Booth 9ce8189f21 Everywhere: Use unqualified AK::URL
Now possible in LibWeb now that there is no longer a Web::URL.
2024-02-25 08:54:31 +01:00

34 lines
1 KiB
C++

/*
* Copyright (c) 2022, Dex♪ <dexes.ttp@gmail.com>
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "WebSocketClientManagerQt.h"
#include "WebSocketImplQt.h"
#include "WebSocketQt.h"
namespace Ladybird {
NonnullRefPtr<WebSocketClientManagerQt> WebSocketClientManagerQt::create()
{
return adopt_ref(*new WebSocketClientManagerQt());
}
WebSocketClientManagerQt::WebSocketClientManagerQt() = default;
WebSocketClientManagerQt::~WebSocketClientManagerQt() = default;
RefPtr<Web::WebSockets::WebSocketClientSocket> WebSocketClientManagerQt::connect(URL const& url, ByteString const& origin, Vector<ByteString> const& protocols)
{
WebSocket::ConnectionInfo connection_info(url);
connection_info.set_origin(origin);
connection_info.set_protocols(protocols);
auto impl = adopt_ref(*new WebSocketImplQt);
auto web_socket = WebSocket::WebSocket::create(move(connection_info), move(impl));
web_socket->start();
return WebSocketQt::create(web_socket);
}
}