Bug 630595 - Followup. Do not need a dash before the option. Removing unused memory watcher. r=blassey, a=blocking-fennec

This commit is contained in:
Doug Turner 2011-02-02 01:00:34 -08:00
Родитель e709ae99f4
Коммит dadda286c4
7 изменённых файлов: 2 добавлений и 46 удалений

Просмотреть файл

@ -367,20 +367,7 @@ ContentParent::Observe(nsISupports* aSubject,
// listening for memory pressure event
if (!strcmp(aTopic, "memory-pressure")) {
NS_ConvertUTF16toUTF8 dataStr(aData);
const char *deathPending = dataStr.get();
if (!strcmp(deathPending, "oom-kill")) {
#ifdef MOZ_CRASHREPORTER
nsCOMPtr<nsICrashReporter> cr = do_GetService("@mozilla.org/toolkit/crash-reporter;1");
if (cr) {
cr->AnnotateCrashReport(NS_LITERAL_CSTRING("oom"), NS_LITERAL_CSTRING("true"));
}
#endif
KillProcess(OtherProcess(), 0, false);
}
else
SendFlushMemory(nsDependentString(aData));
SendFlushMemory(nsDependentString(aData));
}
// listening for remotePrefs...
else if (!strcmp(aTopic, "nsPref:changed")) {

Просмотреть файл

@ -70,7 +70,6 @@ abstract public class GeckoApp
public static GeckoApp mAppContext;
public static boolean mFullscreen = false;
static Thread mLibLoadThread = null;
private static MemoryWatcher mMemoryWatcher = null;
enum LaunchState {PreLaunch, Launching, WaitButton,
Launched, GeckoRunning, GeckoExiting};
@ -214,8 +213,6 @@ abstract public class GeckoApp
surfaceView.mSplashStatusMsg =
getResources().getString(R.string.splash_screen_label);
mLibLoadThread.start();
mMemoryWatcher = new MemoryWatcher(this);
}
@Override
@ -275,8 +272,6 @@ abstract public class GeckoApp
// onPause will be followed by either onResume or onStop.
super.onPause();
mMemoryWatcher.StopMemoryWatcher();
}
@Override
@ -293,8 +288,6 @@ abstract public class GeckoApp
if (checkLaunchState(LaunchState.PreLaunch) ||
checkLaunchState(LaunchState.Launching))
onNewIntent(getIntent());
mMemoryWatcher.StartMemoryWatcher();
}
@Override
@ -353,8 +346,6 @@ abstract public class GeckoApp
@Override
public void onLowMemory()
{
// if you change this handler, please take a look at
// MemoryWatcher too.
Log.e("GeckoApp", "low memory");
if (checkLaunchState(LaunchState.GeckoRunning))
GeckoAppShell.onLowMemory();

Просмотреть файл

@ -97,7 +97,6 @@ class GeckoAppShell
public static native void putenv(String map);
public static native void onResume();
public static native void onLowMemory();
public static native void onCriticalOOM();
public static native void callObserver(String observerKey, String topic, String data);
public static native void removeObserver(String observerKey);
public static native void loadLibs(String apkName, boolean shouldExtract);
@ -137,7 +136,7 @@ class GeckoAppShell
// On some device, we do not want to ever over-allocate.
if (android.os.Build.MODEL.equals("Nexus S") == true)
GeckoAppShell.putenv("MALLOC_OPTIONS=-o");
GeckoAppShell.putenv("MALLOC_OPTIONS=o");
File f = new File("/data/data/" +
GeckoApp.mAppContext.getPackageName() + "/tmp");

Просмотреть файл

@ -53,7 +53,6 @@ JAVAFILES = \
GeckoSurfaceView.java \
GeckoInputConnection.java \
AlertNotification.java \
MemoryWatcher.java \
$(NULL)
PROCESSEDJAVAFILES = \

Просмотреть файл

@ -236,7 +236,6 @@ SHELL_WRAPPER1(notifyGeckoOfEvent, jobject)
SHELL_WRAPPER1(setSurfaceView, jobject)
SHELL_WRAPPER0(onResume)
SHELL_WRAPPER0(onLowMemory)
SHELL_WRAPPER0(onCriticalOOM)
SHELL_WRAPPER3(callObserver, jstring, jstring, jstring)
SHELL_WRAPPER1(removeObserver, jstring)
SHELL_WRAPPER1(onChangeNetworkLinkStatus, jstring)
@ -667,7 +666,6 @@ loadLibs(const char *apkName)
GETFUNC(setSurfaceView);
GETFUNC(onResume);
GETFUNC(onLowMemory);
GETFUNC(onCriticalOOM);
GETFUNC(callObserver);
GETFUNC(removeObserver);
GETFUNC(onChangeNetworkLinkStatus);

Просмотреть файл

@ -66,7 +66,6 @@ extern "C" {
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobject sv);
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onResume(JNIEnv *, jclass);
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *, jclass);
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onCriticalOOM(JNIEnv *, jclass);
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_callObserver(JNIEnv *, jclass, jstring observerKey, jstring topic, jstring data);
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_removeObserver(JNIEnv *jenv, jclass, jstring jObserverKey);
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onChangeNetworkLinkStatus(JNIEnv *, jclass, jstring status);
@ -107,17 +106,6 @@ Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *jenv, jclass jc)
}
}
NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_onCriticalOOM(JNIEnv *jenv, jclass jc)
{
__android_log_print(ANDROID_LOG_ERROR, "GeckoAppShell", "Critical OOM reached!");
if (nsAppShell::gAppShell) {
nsAppShell::gAppShell->NotifyObservers(nsnull,
"memory-pressure",
NS_LITERAL_STRING("oom-kill").get());
}
}
NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_onResume(JNIEnv *jenv, jclass jc)
{

Просмотреть файл

@ -67,12 +67,6 @@
* This will be passed as the extra data when the pressure
* observer has been asked to flush because a malloc() or
* realloc() has failed.
*
* "oom-kill"
* This will be passed as the extra data when the pressure
* observer notices that the application will crash or the
* system will hang if immediate steps are not taken to
* free as much as possible.
*/
[scriptable, uuid(59e7e77a-38e4-11d4-8cf5-0060b0fc14a3)]