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

@ -680,10 +680,10 @@ void PageClient::initialize_js_console(Web::DOM::Document& document)
{
auto& realm = document.realm();
auto console_object = realm.intrinsics().console_object();
auto console_client = make<WebContentConsoleClient>(console_object->console(), document.realm(), *this);
auto console_client = heap().allocate_without_realm<WebContentConsoleClient>(console_object->console(), document.realm(), *this);
console_object->console().set_client(*console_client);
m_console_clients.set(document, move(console_client));
m_console_clients.set(document, console_client);
}
void PageClient::destroy_js_console(Web::DOM::Document& document)