Files
ladybird/Libraries/LibWeb/Platform/EventLoopPlugin.h
Andreas Kling 424a7943f1 LibWeb: Flatten Platform::Timer by merging TimerSerenity
TimerSerenity was the only implementation of the abstract Timer base
class. It simply wrapped a Core::Timer and delegated every method.

Remove the virtual dispatch by making Timer concrete and absorbing
the TimerSerenity implementation directly. Timer::create() now
allocates on the GC heap directly instead of going through
EventLoopPlugin::create_timer().
2026-02-28 15:32:14 +01:00

28 lines
579 B
C++

/*
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Forward.h>
#include <LibGC/Function.h>
#include <LibWeb/Export.h>
namespace Web::Platform {
class WEB_API EventLoopPlugin {
public:
static EventLoopPlugin& the();
static void install(EventLoopPlugin&);
virtual ~EventLoopPlugin();
virtual void spin_until(GC::Root<GC::Function<bool()>> goal_condition) = 0;
virtual void deferred_invoke(ESCAPING GC::Root<GC::Function<void()>>) = 0;
virtual void quit() = 0;
};
}