mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-10 21:22:53 +00:00
Use a LocalSocket to represent the connection between two message ports. The concept of the port message queue is still missing, however. When that concept is implemented, the "steps" in step 7 of the message port transfer steps will need to send the serialized data over the connected socketpair and run in the event loop of the process that holds onto the other side of the message port. Doing this should allow centralizing the behavior of postMessage for Window, MessagePorts and Workers.
19 lines
616 B
Text
19 lines
616 B
Text
#import <DOM/EventTarget.idl>
|
|
#import <DOM/EventHandler.idl>
|
|
|
|
// https://html.spec.whatwg.org/multipage/web-messaging.html#messageport
|
|
[Exposed=(Window,Worker,AudioWorklet), Transferable]
|
|
interface MessagePort : EventTarget {
|
|
undefined postMessage(any message, sequence<object> transfer);
|
|
undefined postMessage(any message, optional StructuredSerializeOptions options = {});
|
|
undefined start();
|
|
undefined close();
|
|
|
|
// event handlers
|
|
attribute EventHandler onmessage;
|
|
attribute EventHandler onmessageerror;
|
|
};
|
|
|
|
dictionary StructuredSerializeOptions {
|
|
sequence<object> transfer = [];
|
|
};
|