1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:17:35 +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:
Shannon Booth 2023-12-04 21:40:33 +13:00 committed by Andreas Kling
parent 5c0cd0f484
commit 6e6f3a9a8f
11 changed files with 45 additions and 17 deletions

View file

@ -14,11 +14,11 @@
namespace WebWorker {
class PageHost final : public Web::PageClient {
AK_MAKE_NONCOPYABLE(PageHost);
AK_MAKE_NONMOVABLE(PageHost);
JS_CELL(PageHost, Web::PageClient);
public:
static NonnullOwnPtr<PageHost> create(ConnectionFromClient& client) { return adopt_own(*new PageHost(client)); }
static JS::NonnullGCPtr<PageHost> create(JS::VM& vm, ConnectionFromClient& client);
virtual ~PageHost();
virtual Web::Page& page() override;