1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:47:34 +00:00

LibWeb/HTML: Store NonnullGCPtr in browsing context group set

These are never supposed to be null.
This commit is contained in:
Linus Groh 2023-04-20 16:45:28 +01:00
parent 4ee72420e8
commit b4f78760f2

View file

@ -11,21 +11,21 @@
namespace Web::HTML { namespace Web::HTML {
// https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-group-set // https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-group-set
static HashTable<BrowsingContextGroup*>& user_agent_browsing_context_group_set() static HashTable<JS::NonnullGCPtr<BrowsingContextGroup>>& user_agent_browsing_context_group_set()
{ {
static HashTable<BrowsingContextGroup*> set; static HashTable<JS::NonnullGCPtr<BrowsingContextGroup>> set;
return set; return set;
} }
BrowsingContextGroup::BrowsingContextGroup(Web::Page& page) BrowsingContextGroup::BrowsingContextGroup(Web::Page& page)
: m_page(page) : m_page(page)
{ {
user_agent_browsing_context_group_set().set(this); user_agent_browsing_context_group_set().set(*this);
} }
BrowsingContextGroup::~BrowsingContextGroup() BrowsingContextGroup::~BrowsingContextGroup()
{ {
user_agent_browsing_context_group_set().remove(this); user_agent_browsing_context_group_set().remove(*this);
} }
void BrowsingContextGroup::visit_edges(Cell::Visitor& visitor) void BrowsingContextGroup::visit_edges(Cell::Visitor& visitor)