Bug 1348547 - ReleaseCachedProcesses() between aboutdebugging tests; r=gabor
authorGeoff Brown <gbrown@mozilla.com>
Tue, 04 Apr 2017 09:45:20 -0600
changeset 351135 8d8379d9a5453651481f15cc673b98707976a272
parent 351134 4511c6164316fb20d773a25e6180652f0dbfc659
child 351136 b77f56c43941eae37180305e45e07726ede49748
push id88802
push usergbrown@mozilla.com
push dateTue, 04 Apr 2017 15:45:31 +0000
treeherdermozilla-inbound@8d8379d9a545 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgabor
bugs1348547
milestone55.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 1348547 - ReleaseCachedProcesses() between aboutdebugging tests; r=gabor
devtools/client/aboutdebugging/test/head.js
dom/ipc/ContentParent.cpp
--- a/devtools/client/aboutdebugging/test/head.js
+++ b/devtools/client/aboutdebugging/test/head.js
@@ -428,10 +428,11 @@ function enableServiceWorkerDebugging() 
       // Enable service workers.
       ["dom.serviceWorkers.enabled", true],
       // Accept workers from mochitest's http.
       ["dom.serviceWorkers.testing.enabled", true],
       // Force single content process.
       ["dom.ipc.processCount", 1],
     ]};
     SpecialPowers.pushPrefEnv(options, done);
+    Services.ppmm.releaseCachedProcesses();
   });
 }
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -741,16 +741,20 @@ ContentParent::GetMaxProcessCount(const 
 ContentParent::IsMaxProcessCountReached(const nsAString& aContentProcessType)
 {
   return GetPoolSize(aContentProcessType) >= GetMaxProcessCount(aContentProcessType);
 }
 
 /*static*/ void
 ContentParent::ReleaseCachedProcesses()
 {
+  if (!GetPoolSize(NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE))) {
+    return;
+  }
+
   // We might want to extend this for other process types as well in the future...
   nsTArray<ContentParent*>& contentParents = GetOrCreatePool(NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE));
   ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
   nsTArray<ContentParent*> toRelease;
 
   // Shuting down these processes will change the array so let's use another array for the removal.
   for (auto* cp : contentParents) {
     nsTArray<TabId> tabIds = cpm->GetTabParentsByProcessId(cp->mChildID);