diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h b/Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h index 49a8e1c061..68e971b334 100644 --- a/Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h +++ b/Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h @@ -21,6 +21,14 @@ public: void add(NonnullOwnPtr<HTML::Task>); OwnPtr<HTML::Task> take_first_runnable() { return m_tasks.dequeue(); } + void enqueue(NonnullOwnPtr<HTML::Task> task) { add(move(task)); } + OwnPtr<HTML::Task> dequeue() + { + if (m_tasks.is_empty()) + return {}; + return m_tasks.dequeue(); + } + private: HTML::EventLoop& m_event_loop; |