LibURL+LibWeb: Make URL::serialize return a String

Simplifying a bunch of uneeded error handling around the place.
This commit is contained in:
Shannon Booth 2024-12-03 22:31:33 +13:00 committed by Sam Atkins
commit 0fa54c2327
Notes: github-actions[bot] 2024-12-04 16:48:13 +00:00
52 changed files with 88 additions and 103 deletions

View file

@ -292,7 +292,7 @@ void WebSocket::on_message(ByteBuffer message, bool is_text)
auto text_message = ByteString(ReadonlyBytes(message));
HTML::MessageEventInit event_init;
event_init.data = JS::PrimitiveString::create(vm(), text_message);
event_init.origin = url().release_value_but_fixme_should_propagate_errors();
event_init.origin = url();
dispatch_event(HTML::MessageEvent::create(realm(), HTML::EventNames::message, event_init));
return;
}
@ -301,14 +301,14 @@ void WebSocket::on_message(ByteBuffer message, bool is_text)
// type indicates that the data is Binary and binaryType is "blob"
HTML::MessageEventInit event_init;
event_init.data = FileAPI::Blob::create(realm(), message, "text/plain;charset=utf-8"_string);
event_init.origin = url().release_value_but_fixme_should_propagate_errors();
event_init.origin = url();
dispatch_event(HTML::MessageEvent::create(realm(), HTML::EventNames::message, event_init));
return;
} else if (m_binary_type == "arraybuffer") {
// type indicates that the data is Binary and binaryType is "arraybuffer"
HTML::MessageEventInit event_init;
event_init.data = JS::ArrayBuffer::create(realm(), message);
event_init.origin = url().release_value_but_fixme_should_propagate_errors();
event_init.origin = url();
dispatch_event(HTML::MessageEvent::create(realm(), HTML::EventNames::message, event_init));
return;
}