From cc8eedd8c543e458c999a520690d6a6401e01ae6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 29 Jan 2026 12:50:20 +0100 Subject: [PATCH] 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 member. --- Services/WebContent/PageClient.cpp | 1 + Services/WebContent/PageClient.h | 4 +--- Services/WebContent/WebContentConsoleClient.h | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Services/WebContent/PageClient.cpp b/Services/WebContent/PageClient.cpp index 1c74e087bf..da4d33f44d 100644 --- a/Services/WebContent/PageClient.cpp +++ b/Services/WebContent/PageClient.cpp @@ -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); diff --git a/Services/WebContent/PageClient.h b/Services/WebContent/PageClient.h index 4a9d632962..117227816f 100644 --- a/Services/WebContent/PageClient.h +++ b/Services/WebContent/PageClient.h @@ -214,9 +214,7 @@ private: RefPtr m_webdriver; RefPtr m_web_ui; - WeakPtr m_top_level_document_console_client; - - GC::Root m_console_global_object; + GC::Ptr m_top_level_document_console_client; RefPtr m_paint_refresh_timer; diff --git a/Services/WebContent/WebContentConsoleClient.h b/Services/WebContent/WebContentConsoleClient.h index 09ea03258d..69c54b049b 100644 --- a/Services/WebContent/WebContentConsoleClient.h +++ b/Services/WebContent/WebContentConsoleClient.h @@ -16,8 +16,7 @@ namespace WebContent { -class WebContentConsoleClient : public JS::ConsoleClient - , public Weakable { +class WebContentConsoleClient : public JS::ConsoleClient { GC_CELL(WebContentConsoleClient, JS::ConsoleClient); GC_DECLARE_ALLOCATOR(WebContentConsoleClient);