mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 18:02:20 +00:00
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:
parent
ce23efc5f6
commit
f87041bf3a
Notes:
github-actions[bot]
2024-11-15 13:50:17 +00:00
Author: https://github.com/shannonbooth
Commit: f87041bf3a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2345
1722 changed files with 9939 additions and 9906 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLActiveInfo);
|
||||
GC_DEFINE_ALLOCATOR(WebGLActiveInfo);
|
||||
|
||||
WebGLActiveInfo::WebGLActiveInfo(JS::Realm& realm)
|
||||
: Bindings::PlatformObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLActiveInfo : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLActiveInfo, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLActiveInfo);
|
||||
GC_DECLARE_ALLOCATOR(WebGLActiveInfo);
|
||||
|
||||
public:
|
||||
virtual ~WebGLActiveInfo();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLBuffer);
|
||||
GC_DEFINE_ALLOCATOR(WebGLBuffer);
|
||||
|
||||
WebGLBuffer::WebGLBuffer(JS::Realm& realm)
|
||||
: WebGLObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLBuffer final : public WebGLObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLBuffer, WebGLObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLBuffer);
|
||||
GC_DECLARE_ALLOCATOR(WebGLBuffer);
|
||||
|
||||
public:
|
||||
virtual ~WebGLBuffer();
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLContextEvent);
|
||||
GC_DEFINE_ALLOCATOR(WebGLContextEvent);
|
||||
|
||||
JS::NonnullGCPtr<WebGLContextEvent> WebGLContextEvent::create(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init)
|
||||
GC::Ref<WebGLContextEvent> WebGLContextEvent::create(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init)
|
||||
{
|
||||
return realm.create<WebGLContextEvent>(realm, event_name, event_init);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebGLContextEvent>> WebGLContextEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init)
|
||||
WebIDL::ExceptionOr<GC::Ref<WebGLContextEvent>> WebGLContextEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, WebGLContextEventInit const& event_init)
|
||||
{
|
||||
return create(realm, event_name, event_init);
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ struct WebGLContextEventInit final : public DOM::EventInit {
|
|||
|
||||
class WebGLContextEvent final : public DOM::Event {
|
||||
WEB_PLATFORM_OBJECT(WebGLContextEvent, DOM::Event);
|
||||
JS_DECLARE_ALLOCATOR(WebGLContextEvent);
|
||||
GC_DECLARE_ALLOCATOR(WebGLContextEvent);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<WebGLContextEvent> create(JS::Realm&, FlyString const& type, WebGLContextEventInit const&);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<WebGLContextEvent>> construct_impl(JS::Realm&, FlyString const& type, WebGLContextEventInit const&);
|
||||
[[nodiscard]] static GC::Ref<WebGLContextEvent> create(JS::Realm&, FlyString const& type, WebGLContextEventInit const&);
|
||||
static WebIDL::ExceptionOr<GC::Ref<WebGLContextEvent>> construct_impl(JS::Realm&, FlyString const& type, WebGLContextEventInit const&);
|
||||
|
||||
virtual ~WebGLContextEvent() override;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLFramebuffer);
|
||||
GC_DEFINE_ALLOCATOR(WebGLFramebuffer);
|
||||
|
||||
WebGLFramebuffer::WebGLFramebuffer(JS::Realm& realm)
|
||||
: WebGLObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLFramebuffer final : public WebGLObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLFramebuffer, WebGLObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLFramebuffer);
|
||||
GC_DECLARE_ALLOCATOR(WebGLFramebuffer);
|
||||
|
||||
public:
|
||||
virtual ~WebGLFramebuffer();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLProgram);
|
||||
GC_DEFINE_ALLOCATOR(WebGLProgram);
|
||||
|
||||
WebGLProgram::WebGLProgram(JS::Realm& realm)
|
||||
: WebGLObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLProgram final : public WebGLObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLProgram, WebGLObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLProgram);
|
||||
GC_DECLARE_ALLOCATOR(WebGLProgram);
|
||||
|
||||
public:
|
||||
virtual ~WebGLProgram();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLRenderbuffer);
|
||||
GC_DEFINE_ALLOCATOR(WebGLRenderbuffer);
|
||||
|
||||
WebGLRenderbuffer::WebGLRenderbuffer(JS::Realm& realm)
|
||||
: WebGLObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLRenderbuffer final : public WebGLObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLRenderbuffer, WebGLObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLRenderbuffer);
|
||||
GC_DECLARE_ALLOCATOR(WebGLRenderbuffer);
|
||||
|
||||
public:
|
||||
virtual ~WebGLRenderbuffer();
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLRenderingContext);
|
||||
GC_DEFINE_ALLOCATOR(WebGLRenderingContext);
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#fire-a-webgl-context-event
|
||||
static void fire_webgl_context_event(HTML::HTMLCanvasElement& canvas_element, FlyString const& type)
|
||||
|
@ -34,7 +34,7 @@ static void fire_webgl_context_creation_error(HTML::HTMLCanvasElement& canvas_el
|
|||
fire_webgl_context_event(canvas_element, EventNames::webglcontextcreationerror);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<JS::GCPtr<WebGLRenderingContext>> WebGLRenderingContext::create(JS::Realm& realm, HTML::HTMLCanvasElement& canvas_element, JS::Value options)
|
||||
JS::ThrowCompletionOr<GC::Ptr<WebGLRenderingContext>> WebGLRenderingContext::create(JS::Realm& realm, HTML::HTMLCanvasElement& canvas_element, JS::Value options)
|
||||
{
|
||||
// We should be coming here from getContext being called on a wrapped <canvas> element.
|
||||
auto context_attributes = TRY(convert_value_to_context_attributes_dictionary(canvas_element.vm(), options));
|
||||
|
@ -42,7 +42,7 @@ JS::ThrowCompletionOr<JS::GCPtr<WebGLRenderingContext>> WebGLRenderingContext::c
|
|||
bool created_surface = canvas_element.allocate_painting_surface(/* minimum_width= */ 1, /* minimum_height= */ 1);
|
||||
if (!created_surface) {
|
||||
fire_webgl_context_creation_error(canvas_element);
|
||||
return JS::GCPtr<WebGLRenderingContext> { nullptr };
|
||||
return GC::Ptr<WebGLRenderingContext> { nullptr };
|
||||
}
|
||||
|
||||
VERIFY(canvas_element.surface());
|
||||
|
@ -50,7 +50,7 @@ JS::ThrowCompletionOr<JS::GCPtr<WebGLRenderingContext>> WebGLRenderingContext::c
|
|||
|
||||
if (!context) {
|
||||
fire_webgl_context_creation_error(canvas_element);
|
||||
return JS::GCPtr<WebGLRenderingContext> { nullptr };
|
||||
return GC::Ptr<WebGLRenderingContext> { nullptr };
|
||||
}
|
||||
|
||||
return realm.create<WebGLRenderingContext>(realm, canvas_element, context.release_nonnull(), context_attributes, context_attributes);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <LibJS/Heap/GCPtr.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/WebGL/WebGLRenderingContextBase.h>
|
||||
|
||||
|
@ -16,10 +16,10 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLRenderingContext final : public WebGLRenderingContextBase {
|
||||
WEB_PLATFORM_OBJECT(WebGLRenderingContext, WebGLRenderingContextBase);
|
||||
JS_DECLARE_ALLOCATOR(WebGLRenderingContext);
|
||||
GC_DECLARE_ALLOCATOR(WebGLRenderingContext);
|
||||
|
||||
public:
|
||||
static JS::ThrowCompletionOr<JS::GCPtr<WebGLRenderingContext>> create(JS::Realm&, HTML::HTMLCanvasElement& canvas_element, JS::Value options);
|
||||
static JS::ThrowCompletionOr<GC::Ptr<WebGLRenderingContext>> create(JS::Realm&, HTML::HTMLCanvasElement& canvas_element, JS::Value options);
|
||||
|
||||
virtual ~WebGLRenderingContext() override;
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ HTML::HTMLCanvasElement const& WebGLRenderingContextBase::canvas_element() const
|
|||
return *m_canvas_element;
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<HTML::HTMLCanvasElement> WebGLRenderingContextBase::canvas_for_binding() const
|
||||
GC::Ref<HTML::HTMLCanvasElement> WebGLRenderingContextBase::canvas_for_binding() const
|
||||
{
|
||||
return *m_canvas_element;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <LibJS/Heap/GCPtr.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/WebGL/OpenGLContext.h>
|
||||
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
void present();
|
||||
|
||||
JS::NonnullGCPtr<HTML::HTMLCanvasElement> canvas_for_binding() const;
|
||||
GC::Ref<HTML::HTMLCanvasElement> canvas_for_binding() const;
|
||||
|
||||
bool is_context_lost() const;
|
||||
|
||||
|
@ -71,7 +71,7 @@ protected:
|
|||
private:
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::NonnullGCPtr<HTML::HTMLCanvasElement> m_canvas_element;
|
||||
GC::Ref<HTML::HTMLCanvasElement> m_canvas_element;
|
||||
|
||||
NonnullOwnPtr<OpenGLContext> m_context;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLShader);
|
||||
GC_DEFINE_ALLOCATOR(WebGLShader);
|
||||
|
||||
WebGLShader::WebGLShader(JS::Realm& realm)
|
||||
: WebGLObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLShader final : public WebGLObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLShader, WebGLObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLShader);
|
||||
GC_DECLARE_ALLOCATOR(WebGLShader);
|
||||
|
||||
public:
|
||||
virtual ~WebGLShader();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLShaderPrecisionFormat);
|
||||
GC_DEFINE_ALLOCATOR(WebGLShaderPrecisionFormat);
|
||||
|
||||
WebGLShaderPrecisionFormat::WebGLShaderPrecisionFormat(JS::Realm& realm)
|
||||
: WebGLObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLShaderPrecisionFormat final : public WebGLObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLShaderPrecisionFormat, WebGLObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLShaderPrecisionFormat);
|
||||
GC_DECLARE_ALLOCATOR(WebGLShaderPrecisionFormat);
|
||||
|
||||
public:
|
||||
virtual ~WebGLShaderPrecisionFormat();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLTexture);
|
||||
GC_DEFINE_ALLOCATOR(WebGLTexture);
|
||||
|
||||
WebGLTexture::WebGLTexture(JS::Realm& realm)
|
||||
: WebGLObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLTexture final : public WebGLObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLTexture, WebGLObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLTexture);
|
||||
GC_DECLARE_ALLOCATOR(WebGLTexture);
|
||||
|
||||
public:
|
||||
virtual ~WebGLTexture();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Web::WebGL {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(WebGLUniformLocation);
|
||||
GC_DEFINE_ALLOCATOR(WebGLUniformLocation);
|
||||
|
||||
WebGLUniformLocation::WebGLUniformLocation(JS::Realm& realm)
|
||||
: WebGLObject(realm)
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Web::WebGL {
|
|||
|
||||
class WebGLUniformLocation final : public WebGLObject {
|
||||
WEB_PLATFORM_OBJECT(WebGLUniformLocation, WebGLObject);
|
||||
JS_DECLARE_ALLOCATOR(WebGLUniformLocation);
|
||||
GC_DECLARE_ALLOCATOR(WebGLUniformLocation);
|
||||
|
||||
public:
|
||||
virtual ~WebGLUniformLocation();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue