mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00

These instances were detected by searching for files that include AK/StdLibExtras.h, but don't match the regex: \\b(abs|AK_REPLACED_STD_NAMESPACE|array_size|ceil_div|clamp|exchange|for ward|is_constant_evaluated|is_power_of_two|max|min|mix|move|_RawPtr|RawP tr|round_up_to_power_of_two|swap|to_underlying)\\b (Without the linebreaks.) This regex is pessimistic, so there might be more files that don't actually use any "extra stdlib" functions. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
30 lines
715 B
C++
30 lines
715 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 <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(JS::Realm&, bool did_timeout = false);
|
|
virtual ~IdleDeadline() override;
|
|
|
|
double time_remaining() const;
|
|
bool did_timeout() const { return m_did_timeout; }
|
|
|
|
private:
|
|
IdleDeadline(JS::Realm&, bool did_timeout);
|
|
|
|
bool m_did_timeout { false };
|
|
};
|
|
|
|
}
|