mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
30 lines
565 B
C++
30 lines
565 B
C++
|
|
/*
|
||
|
|
* Copyright (c) 2026, Tim Flynn <trflynn89@ladybird.org>
|
||
|
|
*
|
||
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include <LibHTTP/Cache/DiskCacheSettings.h>
|
||
|
|
#include <LibIPC/Decoder.h>
|
||
|
|
#include <LibIPC/Encoder.h>
|
||
|
|
|
||
|
|
namespace IPC {
|
||
|
|
|
||
|
|
template<>
|
||
|
|
ErrorOr<void> encode(Encoder& encoder, HTTP::DiskCacheSettings const& sizes)
|
||
|
|
{
|
||
|
|
TRY(encoder.encode(sizes.maximum_size));
|
||
|
|
|
||
|
|
return {};
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
ErrorOr<HTTP::DiskCacheSettings> decode(Decoder& decoder)
|
||
|
|
{
|
||
|
|
auto maximum_size = TRY(decoder.decode<u64>());
|
||
|
|
|
||
|
|
return HTTP::DiskCacheSettings { maximum_size };
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|