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:
Sam Atkins 2024-11-27 15:12:17 +00:00 committed by Andreas Kling
commit 63688148b9
Notes: github-actions[bot] 2024-11-30 11:24:04 +00:00
14 changed files with 212 additions and 134 deletions

View file

@ -111,6 +111,13 @@ ErrorOr<URL::Origin> decode(Decoder& decoder)
return URL::Origin { move(scheme), move(host), port };
}
template<>
ErrorOr<URL::Host> decode(Decoder& decoder)
{
auto value = TRY(decoder.decode<URL::Host::VariantType>());
return URL::Host { move(value) };
}
template<>
ErrorOr<File> decode(Decoder& decoder)
{