mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 927740 (part 1) - Fix observation of GC and CC requests by child processes. r=khuey.
--HG-- extra : rebase_source : 97e44a40d98ad71152dd24a8ea6ff0098aab1df4
This commit is contained in:
parent
3144952b0e
commit
c20ea4de69
@ -1311,6 +1311,11 @@ ContentChild::RecvActivateA11y()
|
||||
bool
|
||||
ContentChild::RecvGarbageCollect()
|
||||
{
|
||||
// Rebroadcast the "child-gc-request" so that workers will GC.
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
if (obs) {
|
||||
obs->NotifyObservers(nullptr, "child-gc-request", nullptr);
|
||||
}
|
||||
nsJSContext::GarbageCollectNow(JS::gcreason::DOM_IPC);
|
||||
return true;
|
||||
}
|
||||
@ -1318,7 +1323,11 @@ ContentChild::RecvGarbageCollect()
|
||||
bool
|
||||
ContentChild::RecvCycleCollect()
|
||||
{
|
||||
nsJSContext::GarbageCollectNow(JS::gcreason::DOM_IPC);
|
||||
// Rebroadcast the "child-cc-request" so that workers will CC.
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
if (obs) {
|
||||
obs->NotifyObservers(nullptr, "child-cc-request", nullptr);
|
||||
}
|
||||
nsJSContext::CycleCollectNow();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user