mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +00:00
LibWeb: Port Cookie from DeprecatedString to String
This commit is contained in:
parent
e3bc8610a9
commit
e28fb5c64c
4 changed files with 51 additions and 51 deletions
|
@ -12,24 +12,24 @@
|
|||
|
||||
namespace Web::Cookie {
|
||||
|
||||
static DeprecatedString time_to_string(UnixDateTime const& time)
|
||||
static String time_to_string(UnixDateTime const& time)
|
||||
{
|
||||
// FIXME: This roundabout formatting should not be necessary; it also loses precision.
|
||||
auto local_time = Core::DateTime::from_timestamp(time.seconds_since_epoch());
|
||||
return local_time.to_deprecated_string("%Y-%m-%d %H:%M:%S %Z"sv);
|
||||
return MUST(local_time.to_string("%Y-%m-%d %H:%M:%S %Z"sv));
|
||||
}
|
||||
|
||||
DeprecatedString Cookie::creation_time_to_string() const
|
||||
String Cookie::creation_time_to_string() const
|
||||
{
|
||||
return time_to_string(creation_time);
|
||||
}
|
||||
|
||||
DeprecatedString Cookie::last_access_time_to_string() const
|
||||
String Cookie::last_access_time_to_string() const
|
||||
{
|
||||
return time_to_string(last_access_time);
|
||||
}
|
||||
|
||||
DeprecatedString Cookie::expiry_time_to_string() const
|
||||
String Cookie::expiry_time_to_string() const
|
||||
{
|
||||
return time_to_string(expiry_time);
|
||||
}
|
||||
|
@ -84,10 +84,10 @@ ErrorOr<void> IPC::encode(Encoder& encoder, Web::Cookie::Cookie const& cookie)
|
|||
template<>
|
||||
ErrorOr<Web::Cookie::Cookie> IPC::decode(Decoder& decoder)
|
||||
{
|
||||
auto name = TRY(decoder.decode<DeprecatedString>());
|
||||
auto value = TRY(decoder.decode<DeprecatedString>());
|
||||
auto domain = TRY(decoder.decode<DeprecatedString>());
|
||||
auto path = TRY(decoder.decode<DeprecatedString>());
|
||||
auto name = TRY(decoder.decode<String>());
|
||||
auto value = TRY(decoder.decode<String>());
|
||||
auto domain = TRY(decoder.decode<String>());
|
||||
auto path = TRY(decoder.decode<String>());
|
||||
auto creation_time = TRY(decoder.decode<UnixDateTime>());
|
||||
auto expiry_time = TRY(decoder.decode<UnixDateTime>());
|
||||
auto host_only = TRY(decoder.decode<bool>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue