ladybird/Userland/Libraries/LibWeb/Platform/EventLoopPlugin.cpp
Andreas Kling 9567e211e7 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.
2022-09-07 20:30:31 +02:00

29 lines
469 B
C++

/*
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Function.h>
#include <LibWeb/Platform/EventLoopPlugin.h>
namespace Web::Platform {
EventLoopPlugin* s_the;
EventLoopPlugin& EventLoopPlugin::the()
{
VERIFY(s_the);
return *s_the;
}
void EventLoopPlugin::install(EventLoopPlugin& plugin)
{
VERIFY(!s_the);
s_the = &plugin;
}
EventLoopPlugin::~EventLoopPlugin() = default;
}