Bug 1828998 - SessionStoreChangeListener::HandleEvent could be a bit less virtual-call heavy, r=farre

Differential Revision: https://phabricator.services.mozilla.com/D175949
This commit is contained in:
Olli Pettay 2023-04-20 09:16:49 +00:00
parent f8f1de6603
commit 58bcaf9a55

View File

@ -95,8 +95,12 @@ SessionStoreChangeListener::HandleEvent(dom::Event* aEvent) {
return NS_OK;
}
nsCOMPtr<nsPIDOMWindowInner> inner =
do_QueryInterface(target->GetOwnerGlobal());
nsIGlobalObject* global = target->GetOwnerGlobal();
if (!global) {
return NS_OK;
}
nsPIDOMWindowInner* inner = global->AsInnerWindow();
if (!inner) {
return NS_OK;
}
@ -106,7 +110,7 @@ SessionStoreChangeListener::HandleEvent(dom::Event* aEvent) {
return NS_OK;
}
RefPtr<BrowsingContext> browsingContext = windowContext->GetBrowsingContext();
BrowsingContext* browsingContext = windowContext->GetBrowsingContext();
if (!browsingContext) {
return NS_OK;
}