mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
LibWeb/HTML: Store NonnullGCPtr in browsing context set
These are never supposed to be null.
This commit is contained in:
parent
af20b74a83
commit
4ee72420e8
3 changed files with 4 additions and 4 deletions
|
@ -80,7 +80,7 @@ JS::NonnullGCPtr<BrowsingContext> BrowsingContext::create_a_new_top_level_browsi
|
|||
auto group = BrowsingContextGroup::create_a_new_browsing_context_group(page);
|
||||
|
||||
// 2. Return group's browsing context set[0].
|
||||
return *(*group->browsing_context_set().begin());
|
||||
return *group->browsing_context_set().begin();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#creating-a-new-browsing-context
|
||||
|
@ -858,7 +858,7 @@ void BrowsingContext::remove()
|
|||
set_group(nullptr);
|
||||
|
||||
// 4. Remove browsingContext from group's browsing context set.
|
||||
group->browsing_context_set().remove(this);
|
||||
group->browsing_context_set().remove(*this);
|
||||
|
||||
// 5. If group's browsing context set is empty, then remove group from the user agent's browsing context group set.
|
||||
// NOTE: This is done by ~BrowsingContextGroup() when the refcount reaches 0.
|
||||
|
|
|
@ -58,7 +58,7 @@ void BrowsingContextGroup::append(BrowsingContext& browsing_context)
|
|||
VERIFY(browsing_context.is_top_level());
|
||||
|
||||
// 1. Append browsingContext to group's browsing context set.
|
||||
m_browsing_context_set.set(&browsing_context);
|
||||
m_browsing_context_set.set(browsing_context);
|
||||
|
||||
// 2. Set browsingContext's group to group.
|
||||
browsing_context.set_group(this);
|
||||
|
|
|
@ -35,7 +35,7 @@ private:
|
|||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-group-set
|
||||
OrderedHashTable<JS::GCPtr<BrowsingContext>> m_browsing_context_set;
|
||||
OrderedHashTable<JS::NonnullGCPtr<BrowsingContext>> m_browsing_context_set;
|
||||
|
||||
WeakPtr<Page> m_page;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue