mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-23 01:23:19 +00:00
29 lines
598 B
C
29 lines
598 B
C
![]() |
/*
|
||
|
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||
|
*
|
||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||
|
*/
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <AK/RefCounted.h>
|
||
|
|
||
|
namespace Web::Fetch::Fetching {
|
||
|
|
||
|
/// A ref-counted boolean flag.
|
||
|
/// This is used to share flags between multiple callback closures.
|
||
|
class RefCountedFlag : public RefCounted<RefCountedFlag> {
|
||
|
public:
|
||
|
static NonnullRefPtr<RefCountedFlag> create(bool);
|
||
|
|
||
|
[[nodiscard]] bool value() const { return m_value; }
|
||
|
void set_value(bool value) { m_value = value; }
|
||
|
|
||
|
private:
|
||
|
explicit RefCountedFlag(bool);
|
||
|
|
||
|
bool m_value { false };
|
||
|
};
|
||
|
|
||
|
}
|