/* * Copyright (c) 2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::HTML { class TaskQueue { public: explicit TaskQueue(HTML::EventLoop&); ~TaskQueue(); bool is_empty() const { return m_tasks.is_empty(); } void add(NonnullOwnPtr); OwnPtr take_first_runnable() { return m_tasks.dequeue(); } private: HTML::EventLoop& m_event_loop; Queue> m_tasks; }; }