mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibURL: Promote Host to a proper class
This lets us move a few Host-related functions (like serialization and checks for what the Host is) into Host instead of having them dotted around the codebase. For now, the interface is still very Variant-like, to avoid having to change quite so much in one go.
This commit is contained in:
committed by
Andreas Kling
parent
90e763de4c
commit
63688148b9
@@ -60,8 +60,6 @@ WebIDL::ExceptionOr<String> WorkerLocation::host() const
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#dom-workerlocation-hostname
|
||||
WebIDL::ExceptionOr<String> WorkerLocation::hostname() const
|
||||
{
|
||||
auto& vm = realm().vm();
|
||||
|
||||
// The hostname getter steps are:
|
||||
// 1. Let host be this's WorkerGlobalScope object's url's host.
|
||||
auto const& host = m_global_scope->url().host();
|
||||
@@ -71,7 +69,7 @@ WebIDL::ExceptionOr<String> WorkerLocation::hostname() const
|
||||
return String {};
|
||||
|
||||
// 3. Return host, serialized.
|
||||
return TRY_OR_THROW_OOM(vm, URL::Parser::serialize_host(host.value()));
|
||||
return host->serialize();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#dom-workerlocation-port
|
||||
|
||||
Reference in New Issue
Block a user