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

@ -8,10 +8,10 @@
#include <AK/Badge.h>
#include <AK/HashMap.h>
#include <LibGC/Function.h>
#include <LibGC/Ptr.h>
#include <LibJS/Forward.h>
#include <LibJS/Heap/Cell.h>
#include <LibJS/Heap/GCPtr.h>
#include <LibJS/Heap/HeapFunction.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/Fetch/Infrastructure/FetchTimingInfo.h>
#include <LibWeb/Forward.h>
@ -21,8 +21,8 @@ namespace Web::Fetch::Infrastructure {
// https://fetch.spec.whatwg.org/#fetch-controller
class FetchController : public JS::Cell {
JS_CELL(FetchController, JS::Cell);
JS_DECLARE_ALLOCATOR(FetchController);
GC_CELL(FetchController, JS::Cell);
GC_DECLARE_ALLOCATOR(FetchController);
public:
enum class State {
@ -31,9 +31,9 @@ public:
Aborted,
};
[[nodiscard]] static JS::NonnullGCPtr<FetchController> create(JS::VM&);
[[nodiscard]] static GC::Ref<FetchController> create(JS::VM&);
void set_full_timing_info(JS::NonnullGCPtr<FetchTimingInfo> full_timing_info) { m_full_timing_info = full_timing_info; }
void set_full_timing_info(GC::Ref<FetchTimingInfo> full_timing_info) { m_full_timing_info = full_timing_info; }
void set_report_timing_steps(Function<void(JS::Object const&)> report_timing_steps);
void set_next_manual_redirect_steps(Function<void()> next_manual_redirect_steps);
@ -41,11 +41,11 @@ public:
void report_timing(JS::Object const&) const;
void process_next_manual_redirect() const;
[[nodiscard]] JS::NonnullGCPtr<FetchTimingInfo> extract_full_timing_info() const;
[[nodiscard]] GC::Ref<FetchTimingInfo> extract_full_timing_info() const;
void abort(JS::Realm&, Optional<JS::Value>);
void terminate();
void set_fetch_params(Badge<FetchParams>, JS::NonnullGCPtr<FetchParams> fetch_params) { m_fetch_params = fetch_params; }
void set_fetch_params(Badge<FetchParams>, GC::Ref<FetchParams> fetch_params) { m_fetch_params = fetch_params; }
void stop_fetch();
@ -66,12 +66,12 @@ private:
// https://fetch.spec.whatwg.org/#fetch-controller-full-timing-info
// full timing info (default null)
// Null or a fetch timing info.
JS::GCPtr<FetchTimingInfo> m_full_timing_info;
GC::Ptr<FetchTimingInfo> m_full_timing_info;
// https://fetch.spec.whatwg.org/#fetch-controller-report-timing-steps
// report timing steps (default null)
// Null or an algorithm accepting a global object.
JS::GCPtr<JS::HeapFunction<void(JS::Object const&)>> m_report_timing_steps;
GC::Ptr<GC::Function<void(JS::Object const&)>> m_report_timing_steps;
// https://fetch.spec.whatwg.org/#fetch-controller-report-timing-steps
// FIXME: serialized abort reason (default null)
@ -80,9 +80,9 @@ private:
// https://fetch.spec.whatwg.org/#fetch-controller-next-manual-redirect-steps
// next manual redirect steps (default null)
// Null or an algorithm accepting nothing.
JS::GCPtr<JS::HeapFunction<void()>> m_next_manual_redirect_steps;
GC::Ptr<GC::Function<void()>> m_next_manual_redirect_steps;
JS::GCPtr<FetchParams> m_fetch_params;
GC::Ptr<FetchParams> m_fetch_params;
HashMap<u64, HTML::TaskID> m_ongoing_fetch_tasks;
u64 m_next_fetch_task_id { 0 };