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:
Nicholas Nethercote 2013-12-02 20:07:02 -08:00
parent 3144952b0e
commit c20ea4de69

View File

@ -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;
}