1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

LibWeb: Make Frame point weakly to Page

This patch makes Page weakable and allows page-less frames to exist.

Page is single-owner, and Frame is multiple-owner, so it's not sound
for Frame to assume its containing Page will stick around for its own
entire lifetime.

Fixes #3976.
This commit is contained in:
Andreas Kling 2020-11-12 18:23:05 +01:00
parent e445ff670d
commit 81add73955
12 changed files with 87 additions and 56 deletions

View file

@ -61,9 +61,8 @@ void Window::set_wrapper(Badge<Bindings::WindowObject>, Bindings::WindowObject&
void Window::alert(const String& message)
{
if (!m_document.frame())
return;
m_document.frame()->page().client().page_did_request_alert(message);
if (auto* page = m_document.page())
page->client().page_did_request_alert(message);
}
bool Window::confirm(const String& message)