Bug 630595. Backing out f05874a6bac5. r=blassey. a=blocking-fennec
authorDoug Turner <dougt@dougt.org>
Tue, 01 Feb 2011 22:30:09 -0800
changeset 61772 9dad67994e828eafb3813a4443d6dce3d0b57bec
parent 61771 1c2d53a2dcfb5c347564c51fc021fb656f1f95f8
child 61773 99af9d6485bb634aea32bfed429c064d8257d3c2
push idunknown
push userunknown
push dateunknown
reviewersblassey, blocking-fennec
bugs630595
milestone2.0b11pre
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 630595. Backing out f05874a6bac5. r=blassey. a=blocking-fennec
widget/src/android/nsMemoryWatcher.cpp
--- a/widget/src/android/nsMemoryWatcher.cpp
+++ b/widget/src/android/nsMemoryWatcher.cpp
@@ -35,19 +35,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsMemoryWatcher.h"
 #include "nsComponentManagerUtils.h"
 #include "android/log.h"
 #include "nsString.h"
 #include "nsAppShell.h"
-#include "nsIPropertyBag2.h"
-#include "nsIServiceManager.h"
-#include "nsXULAppAPI.h"
 
 NS_IMPL_ISUPPORTS1(nsMemoryWatcher, nsITimerCallback)
 
 // These numbers were determined by inspecting the /proc/meminfo
 // MemFree values on the Nexus S before there was a system failure.
 // Seting these numbers lower we'd see no time to recover (by killing
 // the child process).  Setting these numbers hight resulted in not
 // being able to load pages on phones with lots of services/apps
@@ -71,37 +68,17 @@ nsMemoryWatcher::~nsMemoryWatcher()
     StopWatching();
 }
 
 void
 nsMemoryWatcher::StartWatching()
 {
   if (mTimer)
     return;
-
-  // Prevent this from running in the child process
-  if (XRE_GetProcessType() != GeckoProcessType_Default)
-      return;
-
-  // Prevent this from running anything but the devices that need it
-  nsCOMPtr<nsIPropertyBag2> sysInfo = do_GetService("@mozilla.org/system-info;1");
-  if (sysInfo) {
-      nsCString deviceType;
-      nsresult rv = sysInfo->GetPropertyAsACString(NS_LITERAL_STRING("device"),
-                                                       deviceType);
-      if (NS_SUCCEEDED(rv)) {
-          if (! deviceType.EqualsLiteral("Nexus S"))
-              return;
-      }
-  }
-
-  __android_log_print(ANDROID_LOG_WARN, "Gecko",
-                      "!!!!!!!!! Watching Memory....");
-
-
+  
   mMemInfoFile = fopen("/proc/meminfo", "r");
   NS_ASSERTION(mMemInfoFile, "Could not open /proc/meminfo for reading.");
 
   mTimer = do_CreateInstance("@mozilla.org/timer;1");
   NS_ASSERTION(mTimer, "Creating of a timer failed.");
 
   mTimer->InitWithCallback(this, DEFAULT_TIMER_INTERVAL, nsITimer::TYPE_REPEATING_SLACK);
 }