1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

WebContent: Use Web::Platform::Timer instead of Core::Timer

This will allow WebContent to operate without a Core::EventLoop.
This commit is contained in:
Andreas Kling 2022-10-05 19:33:30 +02:00
parent e75645bbf8
commit f877782117
4 changed files with 6 additions and 4 deletions

View file

@ -40,7 +40,7 @@ ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSock
: IPC::ConnectionFromClient<WebContentClientEndpoint, WebContentServerEndpoint>(*this, move(socket), 1)
, m_page_host(PageHost::create(*this))
{
m_paint_flush_timer = Core::Timer::create_single_shot(0, [this] { flush_pending_paint_requests(); });
m_paint_flush_timer = Web::Platform::Timer::create_single_shot(0, [this] { flush_pending_paint_requests(); });
}
void ConnectionFromClient::die()

View file

@ -14,6 +14,7 @@
#include <LibWeb/Cookie/ParsedCookie.h>
#include <LibWeb/Forward.h>
#include <LibWeb/Loader/FileRequest.h>
#include <LibWeb/Platform/Timer.h>
#include <WebContent/Forward.h>
#include <WebContent/WebContentClientEndpoint.h>
#include <WebContent/WebContentConsoleClient.h>
@ -91,7 +92,7 @@ private:
i32 bitmap_id { -1 };
};
Vector<PaintRequest> m_pending_paint_requests;
RefPtr<Core::Timer> m_paint_flush_timer;
RefPtr<Web::Platform::Timer> m_paint_flush_timer;
HashMap<i32, NonnullRefPtr<Gfx::Bitmap>> m_backing_stores;

View file

@ -13,6 +13,7 @@
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Painting/PaintableBox.h>
#include <LibWeb/Platform/Timer.h>
#include <WebContent/WebContentClientEndpoint.h>
namespace WebContent {
@ -22,7 +23,7 @@ PageHost::PageHost(ConnectionFromClient& client)
, m_page(make<Web::Page>(*this))
{
setup_palette();
m_invalidation_coalescing_timer = Core::Timer::create_single_shot(0, [this] {
m_invalidation_coalescing_timer = Web::Platform::Timer::create_single_shot(0, [this] {
m_client.async_did_invalidate_content_rect(m_invalidation_rect);
m_invalidation_rect = {};
});

View file

@ -81,7 +81,7 @@ private:
bool m_should_show_line_box_borders { false };
bool m_has_focus { false };
RefPtr<Core::Timer> m_invalidation_coalescing_timer;
RefPtr<Web::Platform::Timer> m_invalidation_coalescing_timer;
Gfx::IntRect m_invalidation_rect;
Web::CSS::PreferredColorScheme m_preferred_color_scheme { Web::CSS::PreferredColorScheme::Auto };
};