mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Add method to get last added task to an EventLoop
This commit is contained in:
parent
995df8f565
commit
a53486a073
Notes:
sideshowbarker
2024-07-17 18:13:59 +09:00
Author: https://github.com/Lubrsi
Commit: a53486a073
Pull-request: https://github.com/SerenityOS/serenity/pull/19469
2 changed files with 9 additions and 0 deletions
|
@ -71,4 +71,11 @@ ErrorOr<Vector<NonnullOwnPtr<Task>>> TaskQueue::take_tasks_matching(Function<boo
|
|||
return matching_tasks;
|
||||
}
|
||||
|
||||
Task const* TaskQueue::last_added_task() const
|
||||
{
|
||||
if (m_tasks.is_empty())
|
||||
return nullptr;
|
||||
return m_tasks.last();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ public:
|
|||
void remove_tasks_matching(Function<bool(HTML::Task const&)>);
|
||||
ErrorOr<Vector<NonnullOwnPtr<Task>>> take_tasks_matching(Function<bool(HTML::Task const&)>);
|
||||
|
||||
Task const* last_added_task() const;
|
||||
|
||||
private:
|
||||
HTML::EventLoop& m_event_loop;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue