1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:15:07 +00:00
serenity/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.h
Linus Groh 4270ede7c4 LibWeb: Remove WRAPPER_HACK() macro
We no longer access Bindings::FooWrapper anywhere for a Foo platform
object, so these can be removed :^)
2022-09-21 21:12:24 +01:00

31 lines
750 B
C++

/*
* Copyright (c) 2021-2022, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/StdLibExtras.h>
#include <LibWeb/Bindings/PlatformObject.h>
namespace Web::RequestIdleCallback {
class IdleDeadline final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(IdleDeadline, Bindings::PlatformObject);
public:
static JS::NonnullGCPtr<IdleDeadline> create(HTML::Window&, bool did_timeout = false);
virtual ~IdleDeadline() override;
double time_remaining() const;
bool did_timeout() const { return m_did_timeout; }
private:
IdleDeadline(HTML::Window&, bool did_timeout);
bool m_did_timeout { false };
};
}