mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 11:55:08 +00:00
LibWeb+WebContent: Add abstraction layer for event loop and timers
Instead of using Core::EventLoop and Core::Timer directly, LibWeb now goes through a Web::Platform abstraction layer instead. This will allow us to plug in Qt's event loop (and QTimer) over in Ladybird, to avoid having to deal with multiple event loops.
This commit is contained in:
parent
7e5a8bd4b0
commit
9567e211e7
28 changed files with 365 additions and 42 deletions
|
@ -4,14 +4,14 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibWeb/HTML/HTMLBlinkElement.h>
|
||||
#include <LibWeb/Platform/Timer.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
HTMLBlinkElement::HTMLBlinkElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||
: HTMLElement(document, move(qualified_name))
|
||||
, m_timer(Core::Timer::construct())
|
||||
, m_timer(Platform::Timer::create())
|
||||
{
|
||||
m_timer->set_interval(500);
|
||||
m_timer->on_timeout = [this] { blink(); };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue