mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
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:
committed by
Jelle Raaijmakers
parent
972438c4d7
commit
cc8eedd8c5
Notes:
github-actions[bot]
2026-02-06 10:53:00 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/cc8eedd8c54 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7693 Reviewed-by: https://github.com/gmta ✅
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user