LibWeb: Implement MessagePort.postMessage closer to the spec

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.
This commit is contained in:
Andrew Kaster 2023-12-18 17:24:31 -07:00 committed by Andreas Kling
commit f68c67bf3f
Notes: sideshowbarker 2024-07-17 02:22:23 +09:00
7 changed files with 142 additions and 33 deletions

View file

@ -51,6 +51,6 @@ WebIDL::ExceptionOr<SerializationRecord> structured_serialize_internal(JS::VM& v
WebIDL::ExceptionOr<JS::Value> structured_deserialize(JS::VM& vm, SerializationRecord const& serialized, JS::Realm& target_realm, Optional<DeserializationMemory>);
WebIDL::ExceptionOr<SerializedTransferRecord> structured_serialize_with_transfer(JS::VM& vm, JS::Value value, Vector<JS::Handle<JS::Object>> const& transfer_list);
WebIDL::ExceptionOr<DeserializedTransferRecord> structured_deserialize_with_transfer(JS::VM& vm, SerializedTransferRecord const&);
WebIDL::ExceptionOr<DeserializedTransferRecord> structured_deserialize_with_transfer(JS::VM& vm, SerializedTransferRecord&);
}