mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +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
|
@ -10,32 +10,32 @@
|
|||
#include <AK/Function.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Forward.h>
|
||||
#include <LibGC/Function.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Heap/GCPtr.h>
|
||||
#include <LibJS/Heap/HeapFunction.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
class Timer final : public JS::Cell {
|
||||
JS_CELL(Timer, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(Timer);
|
||||
GC_CELL(Timer, JS::Cell);
|
||||
GC_DECLARE_ALLOCATOR(Timer);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<Timer> create(JS::Object&, i32 milliseconds, Function<void()> callback, i32 id);
|
||||
static GC::Ref<Timer> create(JS::Object&, i32 milliseconds, Function<void()> callback, i32 id);
|
||||
virtual ~Timer() override;
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
private:
|
||||
Timer(JS::Object& window, i32 milliseconds, JS::NonnullGCPtr<JS::HeapFunction<void()>> callback, i32 id);
|
||||
Timer(JS::Object& window, i32 milliseconds, GC::Ref<GC::Function<void()>> callback, i32 id);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
RefPtr<Core::Timer> m_timer;
|
||||
JS::NonnullGCPtr<JS::Object> m_window_or_worker_global_scope;
|
||||
JS::NonnullGCPtr<JS::HeapFunction<void()>> m_callback;
|
||||
GC::Ref<JS::Object> m_window_or_worker_global_scope;
|
||||
GC::Ref<GC::Function<void()>> m_callback;
|
||||
i32 m_id { 0 };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue