mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1181518 - Change the reason for memory-pressure fired during priority change. r=gsvelto
This commit is contained in:
parent
0aa4e0e235
commit
f5063cfb8c
@ -1095,7 +1095,7 @@ ParticularProcessPriorityManager::SetPriorityNow(ProcessPriority aPriority,
|
||||
}
|
||||
|
||||
if (aPriority < PROCESS_PRIORITY_FOREGROUND) {
|
||||
unused << mContentParent->SendFlushMemory(NS_LITERAL_STRING("low-memory"));
|
||||
unused << mContentParent->SendFlushMemory(NS_LITERAL_STRING("lowering-priority"));
|
||||
}
|
||||
|
||||
FireTestOnlyObserverNotification("process-priority-set",
|
||||
|
@ -986,7 +986,8 @@ PuppetWidget::MemoryPressureObserver::Observe(nsISupports* aSubject,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (strcmp("memory-pressure", aTopic) == 0) {
|
||||
if (strcmp("memory-pressure", aTopic) == 0 &&
|
||||
!NS_LITERAL_STRING("lowering-priority").Equals(aData)) {
|
||||
if (!mWidget->mVisible && mWidget->mLayerManager &&
|
||||
XRE_IsContentProcess()) {
|
||||
mWidget->mLayerManager->ClearCachedResources();
|
||||
|
@ -18,7 +18,7 @@
|
||||
* example, because the client maintains a large memory cache that
|
||||
* could be released when memory is tight) should register with the
|
||||
* observer service (see nsIObserverService) using the topic
|
||||
* "memory-pressure". There are three specific types of notications
|
||||
* "memory-pressure". There are specific types of notications
|
||||
* that can occur. These types will be passed as the |aData|
|
||||
* parameter of the of the "memory-pressure" notification:
|
||||
*
|
||||
@ -45,6 +45,12 @@
|
||||
* This will be passed as the extra data when the pressure
|
||||
* observer has been asked to flush because a malloc() or
|
||||
* realloc() has failed.
|
||||
*
|
||||
* "lowering-priority"
|
||||
* This will be passed as the extra data when the priority of a child
|
||||
* process is lowered. The pressure observers could take the chance to
|
||||
* clear caches that could be easily regenerated. This type of
|
||||
* notification only appears in child processes.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(1e004834-6d8f-425a-bc9c-a2812ed43bb7)]
|
||||
|
Loading…
Reference in New Issue
Block a user