Bug 827217 - Fix null-pointer crash with webgl.can-lose-context-in-foreground=false.
authorJustin Lebar <justin.lebar@gmail.com>
Mon, 07 Jan 2013 09:44:22 +0100 (2013-01-07)
changeset 117858 88cee54b26e0609f4296baf88b83334dcc3bbeba
parent 117857 d1905a0ba1ed9e56d737aaef4e62fa6b0b471aea
child 117859 f99d7beaab4a4ada977c9e4dc8777cf80d0f3081
push id20718
push userjlebar@mozilla.com
push dateMon, 07 Jan 2013 08:46:09 +0000 (2013-01-07)
treeherdermozilla-inbound@88cee54b26e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs827217
milestone20.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 827217 - Fix null-pointer crash with webgl.can-lose-context-in-foreground=false.
dom/ipc/ProcessPriorityManager.cpp
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -425,14 +425,20 @@ InitProcessPriorityManager()
   sManager = new ProcessPriorityManager();
   sManager->Init();
   ClearOnShutdown(&sManager);
 }
 
 bool
 CurrentProcessIsForeground()
 {
+  // The process priority manager is the only thing which changes our priority,
+  // so if the manager does not exist, then we must be in the foreground.
+  if (!sManager) {
+    return true;
+  }
+
   return sManager->GetPriority() >= PROCESS_PRIORITY_FOREGROUND;
 }
 
 } // namespace ipc
 } // namespace dom
 } // namespace mozilla