зеркало из https://github.com/mozilla/gecko-dev.git
Bug 999341 - Null check the observer service in nsDocument::OnPageHide; r=smaug
This commit is contained in:
Родитель
64dcad7bee
Коммит
7062b539f3
|
@ -8877,12 +8877,14 @@ nsDocument::OnPageHide(bool aPersisted,
|
|||
|
||||
// Dispatch observer notification to notify observers page is hidden.
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
nsIPrincipal *principal = GetPrincipal();
|
||||
os->NotifyObservers(static_cast<nsIDocument*>(this),
|
||||
nsContentUtils::IsSystemPrincipal(principal) ?
|
||||
"chrome-page-hidden" :
|
||||
"content-page-hidden",
|
||||
nullptr);
|
||||
if (os) {
|
||||
nsIPrincipal* principal = GetPrincipal();
|
||||
os->NotifyObservers(static_cast<nsIDocument*>(this),
|
||||
nsContentUtils::IsSystemPrincipal(principal) ?
|
||||
"chrome-page-hidden" :
|
||||
"content-page-hidden",
|
||||
nullptr);
|
||||
}
|
||||
|
||||
DispatchPageTransition(target, NS_LITERAL_STRING("pagehide"), aPersisted);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче