LibWeb: Use as to cast global object to WindowOrWorkerGlobalScopeMixin

No functional changes.
This commit is contained in:
Tim Ledbetter 2025-02-02 15:42:57 +00:00 committed by Jelle Raaijmakers
commit 6d7b7e7822
Notes: github-actions[bot] 2025-02-02 16:19:57 +00:00
10 changed files with 30 additions and 44 deletions

View file

@ -123,9 +123,8 @@ ErrorOr<void> WebSocket::establish_web_socket_connection(URL::URL& url_record, V
{
// FIXME: Integrate properly with FETCH as per https://fetch.spec.whatwg.org/#websocket-opening-handshake
auto* window_or_worker = dynamic_cast<HTML::WindowOrWorkerGlobalScopeMixin*>(&client.global_object());
VERIFY(window_or_worker);
auto origin_string = window_or_worker->origin().to_byte_string();
auto& window_or_worker = as<HTML::WindowOrWorkerGlobalScopeMixin>(client.global_object());
auto origin_string = window_or_worker.origin().to_byte_string();
Vector<ByteString> protcol_byte_strings;
for (auto const& protocol : protocols)