mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Make BrowsingContext GC-allocated
(And BrowsingContextGroup had to come along for the ride as well.) This solves a number of nasty reference cycles between browsing contexts, history items, and their documents.
This commit is contained in:
@@ -32,6 +32,7 @@ EnvironmentSettingsObject::~EnvironmentSettingsObject()
|
||||
void EnvironmentSettingsObject::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(target_browsing_context);
|
||||
for (auto& promise : m_about_to_be_notified_rejected_promises_list)
|
||||
visitor.visit(promise);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ struct Environment {
|
||||
Origin top_level_origin;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-target-browsing-context
|
||||
RefPtr<BrowsingContext> target_browsing_context;
|
||||
JS::GCPtr<BrowsingContext> target_browsing_context;
|
||||
|
||||
// FIXME: An active service worker https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-active-service-worker
|
||||
|
||||
|
||||
Reference in New Issue
Block a user