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

@ -14,21 +14,21 @@
namespace Web::HTML {
struct DragEventInit : public UIEvents::MouseEventInit {
JS::GCPtr<DataTransfer> data_transfer;
GC::Ptr<DataTransfer> data_transfer;
};
// https://html.spec.whatwg.org/multipage/dnd.html#the-dragevent-interface
class DragEvent : public UIEvents::MouseEvent {
WEB_PLATFORM_OBJECT(DragEvent, UIEvents::MouseEvent);
JS_DECLARE_ALLOCATOR(DragEvent);
GC_DECLARE_ALLOCATOR(DragEvent);
public:
[[nodiscard]] static JS::NonnullGCPtr<DragEvent> create(JS::Realm&, FlyString const& event_name, DragEventInit const& event_init = {}, double page_x = 0, double page_y = 0, double offset_x = 0, double offset_y = 0);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<DragEvent>> construct_impl(JS::Realm&, FlyString const& event_name, DragEventInit const& event_init);
[[nodiscard]] static GC::Ref<DragEvent> create(JS::Realm&, FlyString const& event_name, DragEventInit const& event_init = {}, double page_x = 0, double page_y = 0, double offset_x = 0, double offset_y = 0);
static WebIDL::ExceptionOr<GC::Ref<DragEvent>> construct_impl(JS::Realm&, FlyString const& event_name, DragEventInit const& event_init);
virtual ~DragEvent() override;
JS::GCPtr<DataTransfer> data_transfer() { return m_data_transfer; }
GC::Ptr<DataTransfer> data_transfer() { return m_data_transfer; }
private:
DragEvent(JS::Realm&, FlyString const& event_name, DragEventInit const& event_init, double page_x, double page_y, double offset_x, double offset_y);
@ -36,7 +36,7 @@ private:
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(JS::Cell::Visitor&) override;
JS::GCPtr<DataTransfer> m_data_transfer;
GC::Ptr<DataTransfer> m_data_transfer;
};
}