mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Implement transfer for Resizable/ArrayBuffer
Implement transfer logic for ArrayBuffer and ResizableArrayBuffer. Change TransferDataHolder data type to Vector<u32> to reuse existing serialization infrastructure. Fix 5 WPT tests in `window-postmessage.window.html` that relates to transport. Fix `LibWeb/Text/input/Worker/Worker-postMessage-transfer.html`. The latter is currently ignored due to flakiness, no rebaseline is needed. During serialization with transfer, initialize memory with known index and initialize Serializer at position that dependent on the memory. This is mandatory to make ArrayBuffer transport to work. It also happens to fix 4 WPT tests, that are related to curcular references during serialization.
This commit is contained in:
parent
163b8a69e3
commit
9dad8f55a4
Notes:
github-actions[bot]
2024-12-03 21:32:51 +00:00
Author: https://github.com/zetslief
Commit: 9dad8f55a4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2547
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/tcl3
5 changed files with 98 additions and 35 deletions
|
@ -25,7 +25,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
struct TransferDataHolder {
|
||||
Vector<u8> data;
|
||||
Vector<u32> data;
|
||||
Vector<IPC::File> fds;
|
||||
};
|
||||
|
||||
|
@ -46,6 +46,8 @@ struct DeserializedRecord {
|
|||
|
||||
enum class TransferType : u8 {
|
||||
MessagePort,
|
||||
ArrayBuffer,
|
||||
ResizableArrayBuffer,
|
||||
};
|
||||
|
||||
WebIDL::ExceptionOr<SerializationRecord> structured_serialize(JS::VM& vm, JS::Value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue