1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:07:34 +00:00

Userland: Properly define IPC::encode and IPC::decode specializations

In order to avoid the base encode/decode methods from being used (and
failing a static assertion), we must be sure to declare/define the
custom type implementations as template specializations.

After this, LibIPC is no longer sensitive to include order.
This commit is contained in:
Timothy Flynn 2022-11-15 11:24:59 -05:00 committed by Tim Flynn
parent b1ea418d14
commit 05f41382bb
25 changed files with 75 additions and 2 deletions

View file

@ -38,6 +38,7 @@ SameSite same_site_from_string(StringView same_site_mode)
}
template<>
bool IPC::encode(Encoder& encoder, Web::Cookie::Cookie const& cookie)
{
encoder << cookie.name;
@ -56,6 +57,7 @@ bool IPC::encode(Encoder& encoder, Web::Cookie::Cookie const& cookie)
return true;
}
template<>
ErrorOr<void> IPC::decode(Decoder& decoder, Web::Cookie::Cookie& cookie)
{
TRY(decoder.decode(cookie.name));