mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 800166 - Fire a low-memory notification when a B2G process is backgrounded. r=gwagner,bent
This commit is contained in:
parent
70206b30d9
commit
ed7f6604e2
@ -298,6 +298,13 @@ ProcessPriorityManager::OnGracePeriodTimerFired()
|
||||
|
||||
mGracePeriodTimer = nullptr;
|
||||
hal::SetProcessPriority(getpid(), PROCESS_PRIORITY_BACKGROUND);
|
||||
|
||||
// We're in the background; dump as much memory as we can.
|
||||
nsCOMPtr<nsIMemoryReporterManager> mgr =
|
||||
do_GetService("@mozilla.org/memory-reporter-manager;1");
|
||||
if (mgr) {
|
||||
mgr->MinimizeMemoryUsage(/* callback = */ nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
@ -295,7 +295,8 @@ interface nsIMemoryReporterManager : nsISupports
|
||||
|
||||
/*
|
||||
* Run a series of GC/CC's in an attempt to minimize the application's memory
|
||||
* usage. When we're finished, we invoke the given runnable.
|
||||
* usage. When we're finished, we invoke the given runnable if it's not
|
||||
* null.
|
||||
*/
|
||||
void minimizeMemoryUsage(in nsIRunnable callback);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user