From f7202ace626339dbe5c130d9873c084064db2011 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Mon, 7 Jan 2013 09:44:22 +0100 Subject: [PATCH] Bug 827217 - Fix null-pointer crash with webgl.can-lose-context-in-foreground=false. --- dom/ipc/ProcessPriorityManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/ipc/ProcessPriorityManager.cpp b/dom/ipc/ProcessPriorityManager.cpp index f4e8bb266f8..5e31b0452ed 100644 --- a/dom/ipc/ProcessPriorityManager.cpp +++ b/dom/ipc/ProcessPriorityManager.cpp @@ -430,6 +430,12 @@ InitProcessPriorityManager() 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; }