mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +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
|
@ -7,7 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <LibJS/Heap/Handle.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/FunctionObject.h>
|
||||
#include <LibJS/Runtime/VM.h>
|
||||
|
@ -16,15 +16,15 @@ namespace JS {
|
|||
|
||||
// 9.5.1 JobCallback Records, https://tc39.es/ecma262/#sec-jobcallback-records
|
||||
class JobCallback : public JS::Cell {
|
||||
JS_CELL(JobCallback, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(JobCallback);
|
||||
GC_CELL(JobCallback, JS::Cell);
|
||||
GC_DECLARE_ALLOCATOR(JobCallback);
|
||||
|
||||
public:
|
||||
struct CustomData {
|
||||
virtual ~CustomData() = default;
|
||||
};
|
||||
|
||||
[[nodiscard]] static JS::NonnullGCPtr<JobCallback> create(JS::VM& vm, FunctionObject& callback, OwnPtr<CustomData> custom_data);
|
||||
[[nodiscard]] static GC::Ref<JobCallback> create(JS::VM& vm, FunctionObject& callback, OwnPtr<CustomData> custom_data);
|
||||
|
||||
JobCallback(FunctionObject& callback, OwnPtr<CustomData> custom_data)
|
||||
: m_callback(callback)
|
||||
|
@ -38,11 +38,11 @@ public:
|
|||
CustomData* custom_data() { return m_custom_data; }
|
||||
|
||||
private:
|
||||
JS::NonnullGCPtr<FunctionObject> m_callback;
|
||||
GC::Ref<FunctionObject> m_callback;
|
||||
OwnPtr<CustomData> m_custom_data { nullptr };
|
||||
};
|
||||
|
||||
JS::NonnullGCPtr<JobCallback> make_job_callback(FunctionObject& callback);
|
||||
ThrowCompletionOr<Value> call_job_callback(VM&, JS::NonnullGCPtr<JobCallback>, Value this_value, ReadonlySpan<Value> arguments_list);
|
||||
GC::Ref<JobCallback> make_job_callback(FunctionObject& callback);
|
||||
ThrowCompletionOr<Value> call_job_callback(VM&, GC::Ref<JobCallback>, Value this_value, ReadonlySpan<Value> arguments_list);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue