mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +00:00
LibWeb: Change HTML::Timer to store its owning window as a JS::Object
Rather than being limited to a Window object, it will also need to be ownable by a WorkerGlobalScope.
This commit is contained in:
parent
ea11a84332
commit
b579093ad0
2 changed files with 9 additions and 8 deletions
|
@ -20,18 +20,18 @@ class Timer final : public JS::Cell {
|
|||
JS_CELL(Timer, JS::Cell);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<Timer> create(Window&, i32 milliseconds, Function<void()> callback, i32 id);
|
||||
static JS::NonnullGCPtr<Timer> create(JS::Object&, i32 milliseconds, Function<void()> callback, i32 id);
|
||||
virtual ~Timer() override;
|
||||
|
||||
void start();
|
||||
|
||||
private:
|
||||
Timer(Window& window, i32 milliseconds, Function<void()> callback, i32 id);
|
||||
Timer(JS::Object& window, i32 milliseconds, Function<void()> callback, i32 id);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
RefPtr<Platform::Timer> m_timer;
|
||||
JS::NonnullGCPtr<Window> m_window;
|
||||
JS::NonnullGCPtr<JS::Object> m_window_or_worker_global_scope;
|
||||
Function<void()> m_callback;
|
||||
i32 m_id { 0 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue