/* * Copyright (c) 2022, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::Fetch::Fetching { /// A ref-counted boolean flag. /// This is used to share flags between multiple callback closures. class RefCountedFlag : public RefCounted { public: static NonnullRefPtr 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 }; }; }