mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibWeb: Use `Vector<Handle<Object>>
` in transfer variants of serialize
Also trap the invalid object index inserted for transferred values in deserialization. In the future we should avoid inserting that placeholder value in the data stream at all.
This commit is contained in:
parent
73697058b0
commit
84ac6a454f
Notes:
sideshowbarker
2024-07-17 06:28:38 +09:00
Author: https://github.com/ADKaster
Commit: 84ac6a454f
Pull-request: https://github.com/SerenityOS/serenity/pull/22269
Reviewed-by: https://github.com/Lubrsi
2 changed files with 17 additions and 12 deletions
|
@ -37,7 +37,7 @@ struct SerializedTransferRecord {
|
|||
|
||||
struct DeserializedTransferRecord {
|
||||
JS::Value deserialized;
|
||||
JS::MarkedVector<JS::Value> transferred_values;
|
||||
Vector<JS::Handle<JS::Object>> transferred_values;
|
||||
};
|
||||
|
||||
enum class TransferType : u8 {
|
||||
|
@ -50,7 +50,7 @@ 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>);
|
||||
|
||||
WebIDL::ExceptionOr<SerializedTransferRecord> structured_serialize_with_transfer(JS::VM& vm, JS::Value value, JS::MarkedVector<JS::Value> transfer_list);
|
||||
WebIDL::ExceptionOr<SerializedTransferRecord> structured_serialize_with_transfer(JS::VM& vm, JS::Value value, Vector<JS::Handle<JS::Object>> const& transfer_list);
|
||||
WebIDL::ExceptionOr<DeserializedTransferRecord> structured_deserialize_with_transfer(JS::VM& vm, SerializedTransferRecord const&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue