LibWeb: Remove ability to override MessagePort's primary interface
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This hack no longer has any users.
This commit is contained in:
Timothy Flynn 2025-07-17 09:52:25 -04:00 committed by Tim Flynn
commit f6f31fe215
Notes: github-actions[bot] 2025-07-18 14:10:23 +00:00
2 changed files with 6 additions and 9 deletions

View file

@ -38,14 +38,13 @@ static HashTable<GC::RawPtr<MessagePort>>& all_message_ports()
return ports;
}
GC::Ref<MessagePort> MessagePort::create(JS::Realm& realm, HTML::TransferType primary_interface)
GC::Ref<MessagePort> MessagePort::create(JS::Realm& realm)
{
return realm.create<MessagePort>(realm, primary_interface);
return realm.create<MessagePort>(realm);
}
MessagePort::MessagePort(JS::Realm& realm, HTML::TransferType primary_interface)
MessagePort::MessagePort(JS::Realm& realm)
: DOM::EventTarget(realm)
, m_primary_interface(primary_interface)
{
all_message_ports().set(this);
}

View file

@ -27,7 +27,7 @@ class MessagePort final
GC_DECLARE_ALLOCATOR(MessagePort);
public:
[[nodiscard]] static GC::Ref<MessagePort> create(JS::Realm&, HTML::TransferType primary_interface = HTML::TransferType::MessagePort);
[[nodiscard]] static GC::Ref<MessagePort> create(JS::Realm&);
static void for_each_message_port(Function<void(MessagePort&)>);
@ -61,14 +61,14 @@ public:
// ^Transferable
virtual WebIDL::ExceptionOr<void> transfer_steps(HTML::TransferDataEncoder&) override;
virtual WebIDL::ExceptionOr<void> transfer_receiving_steps(HTML::TransferDataDecoder&) override;
virtual HTML::TransferType primary_interface() const override { return m_primary_interface; }
virtual HTML::TransferType primary_interface() const override { return HTML::TransferType::MessagePort; }
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&, HTML::TransferType primary_interface);
explicit MessagePort(JS::Realm&);
virtual void initialize(JS::Realm&) override;
virtual void finalize() override;
@ -81,8 +81,6 @@ private:
ErrorOr<void> send_message_on_transport(SerializedTransferRecord const&);
void read_from_transport();
HTML::TransferType m_primary_interface { HTML::TransferType::MessagePort };
// The HTML spec implies(!) that this is MessagePort.[[RemotePort]]
GC::Ptr<MessagePort> m_remote_port;