Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Implement transfer for Resizable/ArrayBuffer #2547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zetslief
Copy link

@zetslief zetslief commented Nov 24, 2024

Implement transfer logic for ArrayBuffer and ResizableArrayBuffer.

Change TransferDataHolder data type to Vector to reuse existing
serialization infrastructure.

Fix 5 WPT tests in safe-passing-of-structured-data/window-postmessage.window.html
that are related to transport, as well as LibWeb/Text/input/Worker/Worker-postMessage-transfer.html.
The latter is currently ignored due to flakiness in CI, so 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.

@ladybird-bot
Copy link
Collaborator

Hello!

One or more of the commit messages in this PR do not match the Ladybird code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@zetslief zetslief changed the title LibWeb: Implement transfer for Resizable/ArrayBuffer. LibWeb: Implement transfer for Resizable/ArrayBuffer Nov 24, 2024
@zetslief zetslief force-pushed the array_buffer_transfer branch 3 times, most recently from 66d82c1 to 134090f Compare November 24, 2024 14:56
@zetslief zetslief marked this pull request as draft November 24, 2024 16:57
@zetslief zetslief marked this pull request as ready for review November 24, 2024 17:41
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants