mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
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().
28 lines
579 B
C++
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;
|
|
};
|
|
|
|
}
|