1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 02:30:46 +00:00
serenity/Ladybird/EventLoopPluginQt.h
Sam Atkins 6d93e03211 LibWeb+Browser+Ladybird: Use JS::SafeFunction for EventLoop callbacks
This automatically protects captured objects from being GC'd before the
callback runs.
2023-04-21 20:44:47 +01:00

25 lines
604 B
C++

/*
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Platform/EventLoopPlugin.h>
namespace Ladybird {
class EventLoopPluginQt final : public Web::Platform::EventLoopPlugin {
public:
EventLoopPluginQt();
virtual ~EventLoopPluginQt() override;
virtual void spin_until(JS::SafeFunction<bool()> goal_condition) override;
virtual void deferred_invoke(JS::SafeFunction<void()>) override;
virtual NonnullRefPtr<Web::Platform::Timer> create_timer() override;
virtual void quit() override;
};
}