LibWeb/HTML: Pubically expose entangled port and post message steps

These are needed for the implementation of Transferable streams.
This commit is contained in:
Shannon Booth 2024-12-15 23:25:55 +13:00 committed by Tim Flynn
parent 9f0660c8f0
commit bfbc0124c0
Notes: github-actions[bot] 2025-01-20 12:53:40 +00:00

View file

@ -36,6 +36,9 @@ public:
void disentangle();
GC::Ptr<MessagePort> entangled_port() { return m_remote_port; }
GC::Ptr<MessagePort const> entangled_port() const { return m_remote_port; }
// https://html.spec.whatwg.org/multipage/web-messaging.html#dom-messageport-postmessage
WebIDL::ExceptionOr<void> post_message(JS::Value message, Vector<GC::Root<JS::Object>> const& transfer);
@ -59,6 +62,8 @@ public:
void set_worker_event_target(GC::Ref<DOM::EventTarget>);
WebIDL::ExceptionOr<void> message_port_post_message_steps(GC::Ptr<MessagePort> target_port, JS::Value message, StructuredSerializeOptions const& options);
private:
explicit MessagePort(JS::Realm&);
@ -68,7 +73,6 @@ private:
bool is_entangled() const;
WebIDL::ExceptionOr<void> message_port_post_message_steps(GC::Ptr<MessagePort> target_port, JS::Value message, StructuredSerializeOptions const& options);
void post_message_task_steps(SerializedTransferRecord&);
void post_port_message(SerializedTransferRecord);
ErrorOr<void> send_message_on_transport(SerializedTransferRecord const&);