Bug 1858083. Avoid needless addref in Document::GetBrowsingContext. r=smaug

It's a weak pointer but presumably can only die based on main thread actions. The GetBrowsingContext getter is just a plain getter, returning a pointer.

Although small this does show up in the profile in bug 1857094. It's called from some common layout/painting functions.

Differential Revision: https://phabricator.services.mozilla.com/D190559
This commit is contained in:
Timothy Nikkel 2023-10-11 10:30:01 +00:00
Родитель 8dd124f851
Коммит 7addcf497b
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -16696,8 +16696,8 @@ void Document::SetUserHasInteracted() {
}
BrowsingContext* Document::GetBrowsingContext() const {
nsCOMPtr<nsIDocShell> docshell(mDocumentContainer);
return docshell ? docshell->GetBrowsingContext() : nullptr;
return mDocumentContainer ? mDocumentContainer->GetBrowsingContext()
: nullptr;
}
void Document::NotifyUserGestureActivation() {