mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
committed by
Andrew Kaster
parent
73697058b0
commit
84ac6a454f
Notes:
sideshowbarker
2024-07-17 06:28:38 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/84ac6a454f Pull-request: https://github.com/SerenityOS/serenity/pull/22269 Reviewed-by: https://github.com/Lubrsi
@@ -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&);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user