LibJS+LibWeb: Make Console, ConsoleClient & subclasses GC-allocated

These objects had confusing ownership semantics. Let's just throw them
all on the GC heap and stop worrying about it.
This commit is contained in:
Andreas Kling 2024-04-20 21:19:51 +02:00
commit 4db1712f90
Notes: sideshowbarker 2024-07-17 06:20:50 +09:00
13 changed files with 95 additions and 34 deletions

View file

@ -55,7 +55,7 @@ void DedicatedWorkerHost::run(JS::NonnullGCPtr<Web::Page> page, Web::HTML::Trans
auto inner_settings = Web::HTML::WorkerEnvironmentSettingsObject::setup(page, move(realm_execution_context));
auto& console_object = *inner_settings->realm().intrinsics().console_object();
m_console = adopt_ref(*new Web::HTML::WorkerDebugConsoleClient(console_object.console()));
m_console = console_object.heap().allocate_without_realm<Web::HTML::WorkerDebugConsoleClient>(console_object.console());
VERIFY(m_console);
console_object.console().set_client(*m_console);