mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 784040 - Add an intent to simulate an increase in memory pressure. r=mfinkle
This commit is contained in:
parent
d67b48a3bd
commit
b6587a159f
@ -34,6 +34,7 @@ import android.util.Log;
|
||||
class MemoryMonitor extends BroadcastReceiver {
|
||||
private static final String LOGTAG = "GeckoMemoryMonitor";
|
||||
private static final String ACTION_MEMORY_DUMP = "org.mozilla.gecko.MEMORY_DUMP";
|
||||
private static final String ACTION_FORCE_PRESSURE = "org.mozilla.gecko.FORCE_MEMORY_PRESSURE";
|
||||
|
||||
private static final int MEMORY_PRESSURE_NONE = 0;
|
||||
private static final int MEMORY_PRESSURE_CLEANUP = 1;
|
||||
@ -62,6 +63,7 @@ class MemoryMonitor extends BroadcastReceiver {
|
||||
filter.addAction(Intent.ACTION_DEVICE_STORAGE_LOW);
|
||||
filter.addAction(Intent.ACTION_DEVICE_STORAGE_OK);
|
||||
filter.addAction(ACTION_MEMORY_DUMP);
|
||||
filter.addAction(ACTION_FORCE_PRESSURE);
|
||||
context.getApplicationContext().registerReceiver(this, filter);
|
||||
}
|
||||
|
||||
@ -115,6 +117,8 @@ class MemoryMonitor extends BroadcastReceiver {
|
||||
label = "default";
|
||||
}
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Memory:Dump", label));
|
||||
} else if (ACTION_FORCE_PRESSURE.equals(intent.getAction())) {
|
||||
increaseMemoryPressure(MEMORY_PRESSURE_HIGH);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user