mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
88ccaae11e
Now that all the classes for Ladybird are in the Ladybird namespace, we don't need them named as Ladybird::FooBarLadybird. For the Qt-specific classes, we can tack on a Qt at the end for clarity, but FontPlugin and ImageCodecPlugin no longer have anything to do with Qt.
34 lines
1 KiB
C++
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(AK::URL const& url, DeprecatedString const& origin, Vector<DeprecatedString> 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);
|
|
}
|
|
|
|
}
|