Bug 618537 - Android - broadcast memory-pressure from onStop. r=mwu a=blocking-fennec
authorDoug Turner <dougt@dougt.org>
Sat, 11 Dec 2010 14:36:30 -0800
changeset 59123 9c17d46ee458b5e65f08019f6ce1442574a9d29b
parent 59122 716d8622b175de62846e4bd93b302529e57faba6
child 59124 e3a920cbbce922a313f7d4314e53ecc5108a7517
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersmwu, blocking-fennec
bugs618537
milestone2.0b8pre
Bug 618537 - Android - broadcast memory-pressure from onStop. r=mwu a=blocking-fennec
widget/src/android/nsAppShell.cpp
--- a/widget/src/android/nsAppShell.cpp
+++ b/widget/src/android/nsAppShell.cpp
@@ -229,17 +229,21 @@ nsAppShell::ProcessNextNativeEvent(PRBoo
 
         if (curEvent->GeoPosition())
             gLocationCallback->Update(curEvent->GeoPosition());
         else
             NS_WARNING("Received location event without geoposition!");
         break;
 
     case AndroidGeckoEvent::ACTIVITY_STOPPING: {
-        // Do nothing yet.
+        nsCOMPtr<nsIObserverService> obsServ =
+          mozilla::services::GetObserverService();
+        NS_NAMED_LITERAL_STRING(minimize, "heap-minimize");
+        obsServ->NotifyObservers(nsnull, "memory-pressure", minimize.get());
+
         break;
     }
 
     case AndroidGeckoEvent::ACTIVITY_SHUTDOWN: {
         nsCOMPtr<nsIObserverService> obsServ =
           mozilla::services::GetObserverService();
         NS_NAMED_LITERAL_STRING(context, "shutdown-persist");
         obsServ->NotifyObservers(nsnull, "quit-application-granted", nsnull);