mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Consolidate serialization of integral and floating point types
This consolidates serialization and deserialization of integral and floating point types into two templated functions.
This commit is contained in:
parent
4205ac778f
commit
57e7d6e989
Notes:
sideshowbarker
2024-07-17 01:53:23 +09:00
Author: https://github.com/kennethmyhra
Commit: 57e7d6e989
Pull-request: https://github.com/SerenityOS/serenity/pull/23538
Reviewed-by: https://github.com/ADKaster
3 changed files with 54 additions and 86 deletions
|
@ -104,7 +104,7 @@ WebIDL::ExceptionOr<void> File::serialization_steps(HTML::SerializationRecord& r
|
|||
TRY(HTML::serialize_string(vm, record, m_name));
|
||||
|
||||
// 4. Set serialized.[[LastModified]] to the value of value’s lastModified attribute.
|
||||
HTML::serialize_i64(record, m_last_modified);
|
||||
HTML::serialize_primitive_type(record, m_last_modified);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ WebIDL::ExceptionOr<void> File::deserialization_steps(ReadonlySpan<u32> const& r
|
|||
m_name = TRY(HTML::deserialize_string(vm, record, position));
|
||||
|
||||
// 4. Initialize the value of value’s lastModified attribute to serialized.[[LastModified]].
|
||||
m_last_modified = HTML::deserialize_i64(record, position);
|
||||
m_last_modified = HTML::deserialize_primitive_type<i64>(record, position);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue