mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
LibWeb: Make Web::PageClient GC-allocated
This is a first step towards simplifying the ownership model of Web::Page. Soon Web::Page will store its WebClient as a NonnullGCPtr to help solve lifetime issues of the client being destroyed before the page.
This commit is contained in:
parent
5c0cd0f484
commit
6e6f3a9a8f
11 changed files with 45 additions and 17 deletions
|
@ -39,6 +39,11 @@ void PageClient::set_use_gpu_painter()
|
|||
s_use_gpu_painter = true;
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<PageClient> PageClient::create(JS::VM& vm, PageHost& page_host, u64 id)
|
||||
{
|
||||
return vm.heap().allocate_without_realm<PageClient>(page_host, id);
|
||||
}
|
||||
|
||||
PageClient::PageClient(PageHost& owner, u64 id)
|
||||
: m_owner(owner)
|
||||
, m_page(make<Web::Page>(*this))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue