mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 16:44:57 +00:00

This includes a bug fix for the event loop processing steps which has not been merged yet: https://github.com/whatwg/html/pull/7768
34 lines
768 B
C++
34 lines
768 B
C++
/*
|
|
* Copyright (c) 2021, 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/Wrappable.h>
|
|
|
|
namespace Web::RequestIdleCallback {
|
|
|
|
class IdleDeadline final
|
|
: public RefCounted<IdleDeadline>
|
|
, public Bindings::Wrappable {
|
|
public:
|
|
using WrapperType = Bindings::IdleDeadlineWrapper;
|
|
using AllowOwnPtr = TrueType;
|
|
|
|
static NonnullRefPtr<IdleDeadline> create(bool did_timeout = false);
|
|
virtual ~IdleDeadline() override;
|
|
|
|
double time_remaining() const;
|
|
bool did_timeout() const { return m_did_timeout; }
|
|
|
|
private:
|
|
IdleDeadline(bool did_timeout);
|
|
|
|
bool m_did_timeout { false };
|
|
};
|
|
|
|
}
|