Bug 827976 - Don't create the hidden window in nsCCUncollectableMarker.cpp if it doesn't exist. r=mccr8
☠☠ backed out by bf3cbcc82527 ☠ ☠
authorFelipe Gomes <felipc@gmail.com>
Fri, 01 Mar 2019 21:06:45 +0000
changeset 462013 69d0378e0c098473f288d02557b7871f0eb685ff
parent 462012 9203871a5c6f9bbb69c425ae2ec0b1cc805a061d
child 462014 3b64368cff52c1393816a40e7ccb9cc545f08e7a
push id35634
push userrmaries@mozilla.com
push dateSat, 02 Mar 2019 09:26:10 +0000
treeherdermozilla-central@4166cae81546 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs827976
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/base/nsCCUncollectableMarker.cpp
--- a/dom/base/nsCCUncollectableMarker.cpp
+++ b/dom/base/nsCCUncollectableMarker.cpp
@@ -344,26 +344,29 @@ nsresult nsCCUncollectableMarker::Observ
     NS_ENSURE_SUCCESS(rv, rv);
 
     MarkWindowList(windowList, cleanupJS);
   }
 
   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);
     }
     bool hasHiddenPrivateWindow = false;
     appShell->GetHasHiddenPrivateWindow(&hasHiddenPrivateWindow);
     if (hasHiddenPrivateWindow) {
+      nsCOMPtr<nsIXULWindow> hw;
       appShell->GetHiddenPrivateWindow(getter_AddRefs(hw));
       if (hw) {
         nsCOMPtr<nsIDocShell> shell;
         hw->GetDocShell(getter_AddRefs(shell));
         MarkDocShell(shell, cleanupJS);
       }
     }
   }