1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:47:44 +00:00

LibWeb: Make IdleDeadline GC-allocated

This commit is contained in:
Andreas Kling 2022-09-04 13:26:36 +02:00
parent 8f2a711132
commit 915a240944
5 changed files with 22 additions and 22 deletions

View file

@ -6,18 +6,21 @@
*/
#include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/RequestIdleCallback/IdleDeadline.h>
namespace Web::RequestIdleCallback {
NonnullRefPtr<IdleDeadline> IdleDeadline::create(bool did_timeout)
JS::NonnullGCPtr<IdleDeadline> IdleDeadline::create(HTML::Window& window, bool did_timeout)
{
return adopt_ref(*new IdleDeadline(did_timeout));
return *window.heap().allocate<IdleDeadline>(window.realm(), window, did_timeout);
}
IdleDeadline::IdleDeadline(bool did_timeout)
: m_did_timeout(did_timeout)
IdleDeadline::IdleDeadline(HTML::Window& window, bool did_timeout)
: PlatformObject(window.realm())
, m_did_timeout(did_timeout)
{
set_prototype(&window.cached_web_prototype("IdleDeadline"));
}
IdleDeadline::~IdleDeadline() = default;