Bug 942040 - Remove a process from BackgroundProcessLRUPool in ParticularProcessPriorityManager only if it is indeed a background process. r=khuey
authorAlan Huang <ahuang@mozilla.com>
Fri, 22 Nov 2013 17:10:30 +0800
changeset 158465 695c337d555f6c1c1c8a6b75c2bca2fb3d701294
parent 158464 9fe6e122fe5774f5d2fceb07509a02b463e945e3
child 158466 ed9645b3d6eca189e60310a85c1194dfe0e5790c
push idunknown
push userunknown
push dateunknown
reviewerskhuey
bugs942040
milestone28.0a1
Bug 942040 - Remove a process from BackgroundProcessLRUPool in ParticularProcessPriorityManager only if it is indeed a background process. r=khuey
dom/ipc/ProcessPriorityManager.cpp
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -1040,17 +1040,19 @@ ParticularProcessPriorityManager::ShutDo
 
   UnregisterWakeLockObserver(this);
 
   if (mResetPriorityTimer) {
     mResetPriorityTimer->Cancel();
     mResetPriorityTimer = nullptr;
   }
 
-  ProcessPriorityManager::RemoveFromBackgroundLRUPool(mContentParent);
+  if (mPriority == PROCESS_PRIORITY_BACKGROUND && !IsPreallocated()) {
+    ProcessPriorityManager::RemoveFromBackgroundLRUPool(mContentParent);
+  }
 
   mContentParent = nullptr;
 }
 
 void
 ProcessPriorityManagerImpl::FireTestOnlyObserverNotification(
   const char* aTopic,
   const nsACString& aData /* = EmptyCString() */)