WebContent: Replace WeakPtr/Weakable with GC::Ptr for console client

WebContentConsoleClient is a GC::Cell, so PageClient (also a Cell)
should use GC::Ptr instead of WeakPtr to reference it. Visit it in
visit_edges instead.

Also remove unused GC::Root<JS::GlobalObject> member.
This commit is contained in:
Andreas Kling
2026-01-29 12:50:20 +01:00
committed by Jelle Raaijmakers
parent 972438c4d7
commit cc8eedd8c5
Notes: github-actions[bot] 2026-02-06 10:53:00 +00:00
3 changed files with 3 additions and 5 deletions

View File

@@ -87,6 +87,7 @@ void PageClient::visit_edges(JS::Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_page);
visitor.visit(m_top_level_document_console_client);
if (m_webdriver)
m_webdriver->visit_edges(visitor);

View File

@@ -214,9 +214,7 @@ private:
RefPtr<WebDriverConnection> m_webdriver;
RefPtr<WebUIConnection> m_web_ui;
WeakPtr<WebContentConsoleClient> m_top_level_document_console_client;
GC::Root<JS::GlobalObject> m_console_global_object;
GC::Ptr<WebContentConsoleClient> m_top_level_document_console_client;
RefPtr<Core::Timer> m_paint_refresh_timer;

View File

@@ -16,8 +16,7 @@
namespace WebContent {
class WebContentConsoleClient : public JS::ConsoleClient
, public Weakable<WebContentConsoleClient> {
class WebContentConsoleClient : public JS::ConsoleClient {
GC_CELL(WebContentConsoleClient, JS::ConsoleClient);
GC_DECLARE_ALLOCATOR(WebContentConsoleClient);