mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-13 06:32:54 +00:00
LibWeb: Visit the MessagePort's associated Worker target
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.
This commit is contained in:
parent
ba1b26cdc2
commit
eeee6ba3f5
Notes:
github-actions[bot]
2024-10-17 20:35:33 +00:00
Author: https://github.com/trflynn89
Commit: eeee6ba3f5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1835
Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 1 additions and 4 deletions
|
@ -68,10 +68,7 @@ void MessagePort::visit_edges(Cell::Visitor& visitor)
|
|||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_remote_port);
|
||||
|
||||
// FIXME: This is incorrect!! We *should* be visiting the worker event target,
|
||||
// but CI hangs if we do: https://github.com/SerenityOS/serenity/issues/23899
|
||||
visitor.ignore(m_worker_event_target);
|
||||
visitor.visit(m_worker_event_target);
|
||||
}
|
||||
|
||||
void MessagePort::set_worker_event_target(JS::NonnullGCPtr<DOM::EventTarget> target)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue