Bug 1061969 - Ensure the memory is not flushed when the priority is updated. r=gsvelto
☠☠ backed out by 6ee9fe0af6b8 ☠ ☠
authorVivien Nicolas <vnicolas@mozilla.com>
Mon, 13 Oct 2014 12:37:32 +0200
changeset 210169 b4dd10a940dbc03b448c998bc141a9c1f72bf38b
parent 210168 ab9b28208fc950a2c17b31c578731b8ba6671885
child 210170 e071de5848ce4a046cc80010015486803b3d719a
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersgsvelto
bugs1061969
milestone35.0a1
Bug 1061969 - Ensure the memory is not flushed when the priority is updated. r=gsvelto
dom/ipc/ProcessPriorityManager.cpp
dom/ipc/TabChild.cpp
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -1100,20 +1100,16 @@ ParticularProcessPriorityManager::SetPri
   mPriority = aPriority;
   mCPUPriority = aCPUPriority;
   hal::SetProcessPriority(Pid(), mPriority, mCPUPriority);
 
   if (oldPriority != mPriority) {
     unused << mContentParent->SendNotifyProcessPriorityChanged(mPriority);
   }
 
-  if (aPriority < PROCESS_PRIORITY_FOREGROUND) {
-    unused << mContentParent->SendFlushMemory(NS_LITERAL_STRING("low-memory"));
-  }
-
   FireTestOnlyObserverNotification("process-priority-set",
     ProcessPriorityToString(mPriority, mCPUPriority));
 
   if (oldPriority != mPriority) {
     ProcessPriorityManagerImpl::GetSingleton()->
       NotifyProcessPriorityChanged(this, oldPriority);
   }
 }
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2856,16 +2856,22 @@ TabChild::MakeVisible()
 }
 
 void
 TabChild::MakeHidden()
 {
     if (mWidget) {
         mWidget->Show(false);
     }
+
+    nsCOMPtr<nsIObserverService> os =
+        mozilla::services::GetObserverService();
+    if (os) {
+        os->NotifyObservers(nullptr, "memory-pressure", NS_LITERAL_STRING("heap-minimize").get());
+    }
 }
 
 void
 TabChild::UpdateHitRegion(const nsRegion& aRegion)
 {
     mRemoteFrame->SendUpdateHitRegion(aRegion);
 }