Bug 827976 - Don't create the hidden window in nsCCUncollectableMarker.cpp if it doesn't exist. r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D21074

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Felipe Gomes 2019-03-04 18:52:47 +00:00
Родитель 673d1934e3
Коммит 2c97103dfc
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -349,9 +349,11 @@ nsresult nsCCUncollectableMarker::Observe(nsISupports* aSubject,
nsCOMPtr<nsIAppShellService> appShell =
do_GetService(NS_APPSHELLSERVICE_CONTRACTID);
if (appShell) {
nsCOMPtr<nsIXULWindow> hw;
appShell->GetHiddenWindow(getter_AddRefs(hw));
if (hw) {
bool hasHiddenWindow = false;
appShell->GetHasHiddenWindow(&hasHiddenWindow);
if (hasHiddenWindow) {
nsCOMPtr<nsIXULWindow> hw;
appShell->GetHiddenWindow(getter_AddRefs(hw));
nsCOMPtr<nsIDocShell> shell;
hw->GetDocShell(getter_AddRefs(shell));
MarkDocShell(shell, cleanupJS);
@ -359,6 +361,7 @@ nsresult nsCCUncollectableMarker::Observe(nsISupports* aSubject,
bool hasHiddenPrivateWindow = false;
appShell->GetHasHiddenPrivateWindow(&hasHiddenPrivateWindow);
if (hasHiddenPrivateWindow) {
nsCOMPtr<nsIXULWindow> hw;
appShell->GetHiddenPrivateWindow(getter_AddRefs(hw));
if (hw) {
nsCOMPtr<nsIDocShell> shell;