mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
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.
This commit is contained in:
parent
b76456f0ed
commit
ecb72f3b57
Notes:
sideshowbarker
2024-07-18 04:24:45 +09:00
Author: https://github.com/awesomekling
Commit: ecb72f3b57
9 changed files with 180 additions and 1 deletions
26
Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp
Normal file
26
Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibJS/Runtime/VM.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
EventLoop::EventLoop()
|
||||
{
|
||||
}
|
||||
|
||||
EventLoop::~EventLoop()
|
||||
{
|
||||
}
|
||||
|
||||
EventLoop& main_thread_event_loop()
|
||||
{
|
||||
return static_cast<Bindings::WebEngineCustomData*>(Bindings::main_thread_vm().custom_data())->event_loop;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue