ladybird/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.h
Andreas Kling ecb72f3b57 LibWeb: Add a bare-bones HTML event loop with a task queue
This patch attaches a HTML::EventLoop to the main thread JS::VM used
for JavaScript bindings in the web engine.

The goal here is to model the various task scheduling mechanisms of the
HTML specification.
2021-09-09 02:18:31 +02:00

28 lines
482 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Function.h>
#include <LibWeb/HTML/EventLoop/TaskQueue.h>
namespace Web::HTML {
class EventLoop {
public:
EventLoop();
~EventLoop();
TaskQueue& task_queue() { return m_task_queue; }
TaskQueue const& task_queue() const { return m_task_queue; }
private:
TaskQueue m_task_queue;
};
EventLoop& main_thread_event_loop();
}