/* * Copyright (c) 2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include namespace Web::HTML { class Timer final : public JS::Cell { JS_CELL(Timer, JS::Cell); public: static JS::NonnullGCPtr create(Window&, i32 milliseconds, Function callback, i32 id); virtual ~Timer() override; void start(); private: Timer(Window& window, i32 milliseconds, Function callback, i32 id); virtual void visit_edges(Cell::Visitor&) override; RefPtr m_timer; JS::NonnullGCPtr m_window; Function m_callback; i32 m_id { 0 }; }; }