mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibWeb: Make Web::Page GC-allocated
This is a first step towards removing the various Page& and Page* we have littering the engine with "trust me bro" safety guarantees. Co-Authored-By: Andreas Kling <kling@serenityos.org>
This commit is contained in:
parent
6e6f3a9a8f
commit
0ae5c070c7
Notes:
sideshowbarker
2024-07-17 02:29:45 +09:00
Author: https://github.com/shannonbooth
Commit: 0ae5c070c7
Pull-request: https://github.com/SerenityOS/serenity/pull/22142
Issue: https://github.com/SerenityOS/serenity/issues/22091
8 changed files with 65 additions and 30 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <LibJS/Runtime/VM.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <WebWorker/ConnectionFromClient.h>
|
||||
#include <WebWorker/PageHost.h>
|
||||
|
||||
|
@ -75,9 +76,15 @@ void PageHost::request_file(Web::FileRequest request)
|
|||
|
||||
PageHost::PageHost(ConnectionFromClient& client)
|
||||
: m_client(client)
|
||||
, m_page(make<Web::Page>(*this))
|
||||
, m_page(Web::Page::create(Web::Bindings::main_thread_vm(), *this))
|
||||
{
|
||||
setup_palette();
|
||||
}
|
||||
|
||||
void PageHost::visit_edges(JS::Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_page);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue