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

@ -10,9 +10,9 @@
namespace Web::MediaSourceExtensions {
JS_DEFINE_ALLOCATOR(BufferedChangeEvent);
GC_DEFINE_ALLOCATOR(BufferedChangeEvent);
WebIDL::ExceptionOr<JS::NonnullGCPtr<BufferedChangeEvent>> BufferedChangeEvent::construct_impl(JS::Realm& realm, AK::FlyString const& type, BufferedChangeEventInit const& event_init)
WebIDL::ExceptionOr<GC::Ref<BufferedChangeEvent>> BufferedChangeEvent::construct_impl(JS::Realm& realm, AK::FlyString const& type, BufferedChangeEventInit const& event_init)
{
return realm.create<BufferedChangeEvent>(realm, type, event_init);
}

View file

@ -12,17 +12,17 @@
namespace Web::MediaSourceExtensions {
struct BufferedChangeEventInit : public DOM::EventInit {
JS::GCPtr<HTML::TimeRanges> added_ranges;
JS::GCPtr<HTML::TimeRanges> removed_ranges;
GC::Ptr<HTML::TimeRanges> added_ranges;
GC::Ptr<HTML::TimeRanges> removed_ranges;
};
// https://w3c.github.io/media-source/#bufferedchangeevent-interface
class BufferedChangeEvent : public DOM::Event {
WEB_PLATFORM_OBJECT(BufferedChangeEvent, DOM::Event);
JS_DECLARE_ALLOCATOR(BufferedChangeEvent);
GC_DECLARE_ALLOCATOR(BufferedChangeEvent);
public:
[[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<BufferedChangeEvent>> construct_impl(JS::Realm&, FlyString const& type, BufferedChangeEventInit const& = {});
[[nodiscard]] static WebIDL::ExceptionOr<GC::Ref<BufferedChangeEvent>> construct_impl(JS::Realm&, FlyString const& type, BufferedChangeEventInit const& = {});
private:
BufferedChangeEvent(JS::Realm&, FlyString const& type, BufferedChangeEventInit const& event_init);

View file

@ -10,9 +10,9 @@
namespace Web::MediaSourceExtensions {
JS_DEFINE_ALLOCATOR(ManagedMediaSource);
GC_DEFINE_ALLOCATOR(ManagedMediaSource);
WebIDL::ExceptionOr<JS::NonnullGCPtr<ManagedMediaSource>> ManagedMediaSource::construct_impl(JS::Realm& realm)
WebIDL::ExceptionOr<GC::Ref<ManagedMediaSource>> ManagedMediaSource::construct_impl(JS::Realm& realm)
{
return realm.create<ManagedMediaSource>(realm);
}

View file

@ -13,10 +13,10 @@ namespace Web::MediaSourceExtensions {
// https://w3c.github.io/media-source/#managedmediasource-interface
class ManagedMediaSource : public MediaSource {
WEB_PLATFORM_OBJECT(ManagedMediaSource, MediaSource);
JS_DECLARE_ALLOCATOR(ManagedMediaSource);
GC_DECLARE_ALLOCATOR(ManagedMediaSource);
public:
[[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<ManagedMediaSource>> construct_impl(JS::Realm&);
[[nodiscard]] static WebIDL::ExceptionOr<GC::Ref<ManagedMediaSource>> construct_impl(JS::Realm&);
private:
ManagedMediaSource(JS::Realm&);

View file

@ -10,7 +10,7 @@
namespace Web::MediaSourceExtensions {
JS_DEFINE_ALLOCATOR(ManagedSourceBuffer);
GC_DEFINE_ALLOCATOR(ManagedSourceBuffer);
ManagedSourceBuffer::ManagedSourceBuffer(JS::Realm& realm)
: SourceBuffer(realm)

View file

@ -13,7 +13,7 @@ namespace Web::MediaSourceExtensions {
// https://w3c.github.io/media-source/#managedsourcebuffer-interface
class ManagedSourceBuffer : public SourceBuffer {
WEB_PLATFORM_OBJECT(ManagedSourceBuffer, SourceBuffer);
JS_DECLARE_ALLOCATOR(ManagedSourceBuffer);
GC_DECLARE_ALLOCATOR(ManagedSourceBuffer);
public:
private:

View file

@ -10,9 +10,9 @@
namespace Web::MediaSourceExtensions {
JS_DEFINE_ALLOCATOR(MediaSource);
GC_DEFINE_ALLOCATOR(MediaSource);
WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaSource>> MediaSource::construct_impl(JS::Realm& realm)
WebIDL::ExceptionOr<GC::Ref<MediaSource>> MediaSource::construct_impl(JS::Realm& realm)
{
return realm.create<MediaSource>(realm);
}

View file

@ -13,10 +13,10 @@ namespace Web::MediaSourceExtensions {
// https://w3c.github.io/media-source/#dom-mediasource
class MediaSource : public DOM::EventTarget {
WEB_PLATFORM_OBJECT(MediaSource, DOM::EventTarget);
JS_DECLARE_ALLOCATOR(MediaSource);
GC_DECLARE_ALLOCATOR(MediaSource);
public:
[[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaSource>> construct_impl(JS::Realm&);
[[nodiscard]] static WebIDL::ExceptionOr<GC::Ref<MediaSource>> construct_impl(JS::Realm&);
// https://w3c.github.io/media-source/#dom-mediasource-canconstructindedicatedworker
static bool can_construct_in_dedicated_worker(JS::VM&) { return true; }

View file

@ -10,7 +10,7 @@
namespace Web::MediaSourceExtensions {
JS_DEFINE_ALLOCATOR(MediaSourceHandle);
GC_DEFINE_ALLOCATOR(MediaSourceHandle);
MediaSourceHandle::MediaSourceHandle(JS::Realm& realm)
: Bindings::PlatformObject(realm)

View file

@ -14,7 +14,7 @@ namespace Web::MediaSourceExtensions {
// https://w3c.github.io/media-source/#dom-mediasourcehandle
class MediaSourceHandle : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(MediaSourceHandle, Bindings::PlatformObject);
JS_DECLARE_ALLOCATOR(MediaSourceHandle);
GC_DECLARE_ALLOCATOR(MediaSourceHandle);
public:
private:

View file

@ -10,7 +10,7 @@
namespace Web::MediaSourceExtensions {
JS_DEFINE_ALLOCATOR(SourceBuffer);
GC_DEFINE_ALLOCATOR(SourceBuffer);
SourceBuffer::SourceBuffer(JS::Realm& realm)
: DOM::EventTarget(realm)

View file

@ -13,7 +13,7 @@ namespace Web::MediaSourceExtensions {
// https://w3c.github.io/media-source/#dom-sourcebuffer
class SourceBuffer : public DOM::EventTarget {
WEB_PLATFORM_OBJECT(SourceBuffer, DOM::EventTarget);
JS_DECLARE_ALLOCATOR(SourceBuffer);
GC_DECLARE_ALLOCATOR(SourceBuffer);
protected:
SourceBuffer(JS::Realm&);

View file

@ -10,7 +10,7 @@
namespace Web::MediaSourceExtensions {
JS_DEFINE_ALLOCATOR(SourceBufferList);
GC_DEFINE_ALLOCATOR(SourceBufferList);
SourceBufferList::SourceBufferList(JS::Realm& realm)
: DOM::EventTarget(realm)

View file

@ -13,7 +13,7 @@ namespace Web::MediaSourceExtensions {
// https://w3c.github.io/media-source/#dom-sourcebufferlist
class SourceBufferList : public DOM::EventTarget {
WEB_PLATFORM_OBJECT(SourceBufferList, DOM::EventTarget);
JS_DECLARE_ALLOCATOR(SourceBufferList);
GC_DECLARE_ALLOCATOR(SourceBufferList);
private:
SourceBufferList(JS::Realm&);