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());