Bug 1348547 - ReleaseCachedProcesses() between aboutdebugging tests; r=gabor

This commit is contained in:
Geoff Brown 2017-04-04 09:45:20 -06:00
parent 7cc08b99a6
commit 181892f671
2 changed files with 5 additions and 0 deletions

View File

@ -433,5 +433,6 @@ function enableServiceWorkerDebugging() {
["dom.ipc.processCount", 1],
]};
SpecialPowers.pushPrefEnv(options, done);
Services.ppmm.releaseCachedProcesses();
});
}

View File

@ -746,6 +746,10 @@ ContentParent::IsMaxProcessCountReached(const nsAString& 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();