1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 19:05:08 +00:00

LibWebView+LibProtocol: Allow app to pass custom WebSocketClients

This commit is contained in:
Andrew Kaster 2023-08-02 18:08:24 -06:00 committed by Andreas Kling
parent a1e5a6ac40
commit dd694215bc
3 changed files with 8 additions and 2 deletions

View file

@ -107,6 +107,11 @@ void WebSocketClientSocketAdapter::close(u16 code, DeprecatedString reason)
m_websocket->close(code, reason);
}
ErrorOr<NonnullRefPtr<WebSocketClientManagerAdapter>> WebSocketClientManagerAdapter::try_create(NonnullRefPtr<Protocol::WebSocketClient> websocket_client)
{
return adopt_nonnull_ref_or_enomem(new (nothrow) WebSocketClientManagerAdapter(move(websocket_client)));
}
ErrorOr<NonnullRefPtr<WebSocketClientManagerAdapter>> WebSocketClientManagerAdapter::try_create()
{
auto websocket_client = TRY(Protocol::WebSocketClient::try_create());