1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:18:12 +00:00

Ladybird: Remove Web::Platform plugins for Qt in favor of LibCore

Now that the Core::EventLoop is driven by a QEventLoop in Ladybird,
we don't need to patch LibWeb with Web::Platform plugins.

This patch removes EventLoopPluginQt and TimerQt.

Note that we can't just replace the Web::Platform abstractions with
LibCore stuff immediately, since the Web::Platform APIs use
JS::SafeFunction for callbacks.
This commit is contained in:
Andreas Kling 2023-04-24 18:02:29 +02:00
parent 3494c2382d
commit 1c6c3685c4
8 changed files with 4 additions and 258 deletions

View file

@ -605,27 +605,9 @@ void WebContentView::create_client(WebView::EnableCallgrindProfiling enable_call
auto candidate_web_content_paths = get_paths_for_helper_process("WebContent"sv).release_value_but_fixme_should_propagate_errors();
auto new_client = launch_web_content_process(candidate_web_content_paths, enable_callgrind_profiling).release_value_but_fixme_should_propagate_errors();
m_web_content_notifier.setSocket(new_client->socket().fd().value());
m_web_content_notifier.setEnabled(true);
QObject::connect(&m_web_content_notifier, &QSocketNotifier::activated, [new_client = new_client.ptr()] {
if (auto notifier = new_client->socket().notifier())
notifier->on_activation();
});
struct DeferredInvokerQt final : IPC::DeferredInvoker {
virtual ~DeferredInvokerQt() = default;
virtual void schedule(Function<void()> callback) override
{
QTimer::singleShot(0, std::move(callback));
}
};
new_client->set_deferred_invoker(make<DeferredInvokerQt>());
m_client_state.client = new_client;
m_client_state.client->on_web_content_process_crash = [this] {
QTimer::singleShot(0, [this] {
Core::deferred_invoke([this] {
handle_web_content_process_crash();
});
};