mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-12 02:30:30 +09:00
LibWeb: Extract serialization logic for primitives and object primitives
To avoid differing logic for serializing similar types, move the logic into separate helpers.
This commit is contained in:
parent
98e272ce15
commit
c384f22d67
Notes:
sideshowbarker
2024-07-17 23:02:37 +09:00
Author: https://github.com/kennethmyhra
Commit: c384f22d67
Pull-request: https://github.com/SerenityOS/serenity/pull/23438
Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 100 additions and 24 deletions
|
@ -51,6 +51,17 @@ WebIDL::ExceptionOr<SerializationRecord> structured_serialize_internal(JS::VM& v
|
|||
|
||||
WebIDL::ExceptionOr<JS::Value> structured_deserialize(JS::VM& vm, SerializationRecord const& serialized, JS::Realm& target_realm, Optional<DeserializationMemory>);
|
||||
|
||||
void serialize_boolean_primitive(SerializationRecord& serialized, JS::Value& value);
|
||||
void serialize_number_primitive(SerializationRecord& serialized, JS::Value& value);
|
||||
WebIDL::ExceptionOr<void> serialize_big_int_primitive(JS::VM& vm, SerializationRecord& serialized, JS::Value& value);
|
||||
WebIDL::ExceptionOr<void> serialize_string_primitive(JS::VM& vm, SerializationRecord& serialized, JS::Value& value);
|
||||
void serialize_boolean_object(SerializationRecord& serialized, JS::Value& value);
|
||||
void serialize_number_object(SerializationRecord& serialized, JS::Value& value);
|
||||
WebIDL::ExceptionOr<void> serialize_big_int_object(JS::VM& vm, SerializationRecord& serialized, JS::Value& value);
|
||||
WebIDL::ExceptionOr<void> serialize_string_object(JS::VM& vm, SerializationRecord& serialized, JS::Value& value);
|
||||
void serialize_date_object(SerializationRecord& serialized, JS::Value& value);
|
||||
WebIDL::ExceptionOr<void> serialize_reg_exp_object(JS::VM& vm, SerializationRecord& serialized, JS::Value& value);
|
||||
|
||||
WebIDL::ExceptionOr<void> serialize_bytes(JS::VM& vm, Vector<u32>& vector, ReadonlyBytes bytes);
|
||||
WebIDL::ExceptionOr<void> serialize_string(JS::VM& vm, Vector<u32>& vector, DeprecatedFlyString const& string);
|
||||
WebIDL::ExceptionOr<void> serialize_string(JS::VM& vm, Vector<u32>& vector, String const& string);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue