LibGC+Everywhere: Factor out a LibGC from LibJS

Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
This commit is contained in:
Shannon Booth 2024-11-15 04:01:23 +13:00 committed by Andreas Kling
parent ce23efc5f6
commit f87041bf3a
Notes: github-actions[bot] 2024-11-15 13:50:17 +00:00
1722 changed files with 9939 additions and 9906 deletions

View file

@ -26,10 +26,10 @@ namespace Web::HTML {
class MessagePort final : public DOM::EventTarget
, public Bindings::Transferable {
WEB_PLATFORM_OBJECT(MessagePort, DOM::EventTarget);
JS_DECLARE_ALLOCATOR(MessagePort);
GC_DECLARE_ALLOCATOR(MessagePort);
public:
[[nodiscard]] static JS::NonnullGCPtr<MessagePort> create(JS::Realm&);
[[nodiscard]] static GC::Ref<MessagePort> create(JS::Realm&);
static void for_each_message_port(Function<void(MessagePort&)>);
@ -41,7 +41,7 @@ public:
void disentangle();
// https://html.spec.whatwg.org/multipage/web-messaging.html#dom-messageport-postmessage
WebIDL::ExceptionOr<void> post_message(JS::Value message, Vector<JS::Handle<JS::Object>> const& transfer);
WebIDL::ExceptionOr<void> post_message(JS::Value message, Vector<GC::Root<JS::Object>> const& transfer);
// https://html.spec.whatwg.org/multipage/web-messaging.html#dom-messageport-postmessage-options
WebIDL::ExceptionOr<void> post_message(JS::Value message, StructuredSerializeOptions const& options);
@ -62,7 +62,7 @@ public:
virtual WebIDL::ExceptionOr<void> transfer_receiving_steps(HTML::TransferDataHolder&) override;
virtual HTML::TransferType primary_interface() const override { return HTML::TransferType::MessagePort; }
void set_worker_event_target(JS::NonnullGCPtr<DOM::EventTarget>);
void set_worker_event_target(GC::Ref<DOM::EventTarget>);
private:
explicit MessagePort(JS::Realm&);
@ -72,7 +72,7 @@ private:
bool is_entangled() const;
WebIDL::ExceptionOr<void> message_port_post_message_steps(JS::GCPtr<MessagePort> target_port, JS::Value message, StructuredSerializeOptions const& options);
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&);
@ -85,7 +85,7 @@ private:
ErrorOr<ParseDecision> parse_message();
// The HTML spec implies(!) that this is MessagePort.[[RemotePort]]
JS::GCPtr<MessagePort> m_remote_port;
GC::Ptr<MessagePort> m_remote_port;
// https://html.spec.whatwg.org/multipage/web-messaging.html#has-been-shipped
bool m_has_been_shipped { false };
@ -101,7 +101,7 @@ private:
Queue<IPC::File> m_unprocessed_fds;
Vector<u8> m_buffered_data;
JS::GCPtr<DOM::EventTarget> m_worker_event_target;
GC::Ptr<DOM::EventTarget> m_worker_event_target;
};
}