LibURL+LibWeb: Make URL serialization return a String

This can only ever fail from OOM, and will never by string containing
random byte sequences.
This commit is contained in:
Shannon Booth 2024-11-23 20:10:34 +13:00 committed by Andreas Kling
commit 8f6fe1de83
Notes: github-actions[bot] 2024-11-23 15:44:52 +00:00
15 changed files with 24 additions and 30 deletions

View file

@ -22,11 +22,10 @@ WebIDL::ExceptionOr<String> WorkerLocation::href() const
}
// https://html.spec.whatwg.org/multipage/workers.html#dom-workerlocation-origin
WebIDL::ExceptionOr<String> WorkerLocation::origin() const
String WorkerLocation::origin() const
{
auto& vm = realm().vm();
// The origin getter steps are to return the serialization of this's WorkerGlobalScope object's url's origin.
return TRY_OR_THROW_OOM(vm, String::from_byte_string(m_global_scope->url().origin().serialize()));
return m_global_scope->url().origin().serialize();
}
// https://html.spec.whatwg.org/multipage/workers.html#dom-workerlocation-protocol