LibWeb+WebWorker: Convert Workers to use MessagePorts for postMessage

This aligns Workers and Window and MessagePorts to all use the same
mechanism for transferring serialized messages across realms.

It also allows transferring more message ports into a worker.

Re-enable the Worker-echo test, as none of the MessagePort tests have
themselves been flaky, and those are now using the same underlying
implementation.
This commit is contained in:
Andrew Kaster 2023-12-20 13:47:01 -07:00 committed by Andreas Kling
commit b10fee00eb
Notes: sideshowbarker 2024-07-17 00:47:29 +09:00
21 changed files with 159 additions and 222 deletions

View file

@ -1,9 +1,10 @@
#include <AK/URL.h>
#include <LibIPC/File.h>
#include <LibWeb/HTML/StructuredSerialize.h>
endpoint WebWorkerServer {
start_dedicated_worker(URL url, String type, String credentials, String name, IPC::File message_port) =|
start_dedicated_worker(URL url, String type, String credentials, String name, Web::HTML::TransferDataHolder message_port) =|
handle_file_return(i32 error, Optional<IPC::File> file, i32 request_id) =|
}