Bug 927740 (part 1) - Fix observation of GC and CC requests by child processes. r=khuey.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 02 Dec 2013 20:07:02 -0800
changeset 158662 24e2453b9e53adc0ea352cea65338b8d3ae7259a
parent 158661 e52c27213bb7d7c266ab9b8adf3c6ff07a144bd6
child 158663 14a0fe515c9c5d91d61bdf4cf269d3252405c15e
push id25752
push usercbook@mozilla.com
push dateWed, 04 Dec 2013 08:35:03 +0000
treeherdermozilla-central@8187818246ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs927740
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 927740 (part 1) - Fix observation of GC and CC requests by child processes. r=khuey.
dom/ipc/ContentChild.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1306,24 +1306,33 @@ ContentChild::RecvActivateA11y()
         do_GetService("@mozilla.org/accessibilityService;1");
 #endif
     return true;
 }
 
 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;
 }
 
 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;
 }
 
 #ifdef MOZ_NUWA_PROCESS
 static void
 OnFinishNuwaPreparation ()
 {