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

Cherry-pick "LibWeb: Visit the MessagePort's associated Worker target" #25443

Merged
merged 6 commits into from
Nov 21, 2024

Conversation

nico
Copy link
Contributor

@nico nico commented Nov 21, 2024

(cherry picked from commit 5ed702e211a3db4055718ac000aea8c26ef79c46)
This largely reduces the number of files needed to be compiled when we
change the MessagePort header.

(cherry picked from commit 32a22c49e3e999e681e2d1de1ebabd092a7f9b47)
This just updates our copied spec steps - new steps are not implemented
here. This is mostly just to highlight new steps we are missing around
MessagePorts.

No behavior change, but this does resolve an outstanding FIXME around
spec step ordering.

(cherry picked from commit 83be2606dba7ac430bab4d61a70e926d12d452ee)
(cherry picked from commit d44dd756b382c5f8966ad98b78020e01a6f31b2a)
(cherry picked from commit ba1b26cdc2f5012e8c9ac705854f621a83eeda4c)
Without this, a worker can be GC'd in a very simple script such as:

    const worker = new Worker("script.js");
    worker.onmessage = () => {};

Where script.js attempts to post a message back to the parent window.

When the Worker is GC'd, the IPC connection from the WebContent process
to the WebWorker process is closed. When this occurs, the WebWorker will
exit() from LibIPC, and any message from the worker to its parent does
not have a chance to run.

(cherry picked from commit eeee6ba3f54bc920e7cd493820faab943b59e0bd)
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 21, 2024
@nico nico merged commit 68e58b5 into SerenityOS:master Nov 21, 2024
12 checks passed
@nico nico deleted the pr_1835 branch November 21, 2024 14:41
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 21, 2024
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.

2 participants