Bug 1580212, part 2 - Make dom.ipc.keepProcessesAlive.webIsolated work for Fission content processes. r=kmag

Also, enable it for the extensions test directory. Without this pref,
it gets frequent intermittent leaks and shutdown hangs when Fission is
enabled.

Differential Revision: https://phabricator.services.mozilla.com/D51752

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew McCreight 2019-11-06 23:14:27 +00:00
Родитель b5dbc2b2e5
Коммит ec082e7046
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -4,6 +4,10 @@ prefs =
# We don't want to reset this at the end of the test, so that we don't have
# to spawn a new extension child process for each test unit.
dom.ipc.keepProcessesAlive.extension=1
# With Fission enabled, this directory spawns many child processes, which
# somehow results in frequent leaks and shutdown hangs. Reuse the content
# processes to avoid this.
dom.ipc.keepProcessesAlive.webIsolated.perOrigin=1
dom.animations-api.core.enabled=true
dom.animations-api.timelines.enabled=true
plugin.load_flash_only=false

Просмотреть файл

@ -232,6 +232,7 @@
#include "MMPrinter.h"
#include "nsStreamUtils.h"
#include "nsIAsyncInputStream.h"
#include "xpcpublic.h"
#include "mozilla/Sprintf.h"
@ -1809,7 +1810,15 @@ bool ContentParent::ShouldKeepProcessAlive() {
int32_t processesToKeepAlive = 0;
nsAutoCString keepAlivePref("dom.ipc.keepProcessesAlive.");
keepAlivePref.Append(NS_ConvertUTF16toUTF8(mRemoteType));
if (StringBeginsWith(mRemoteType,
NS_LITERAL_STRING(FISSION_WEB_REMOTE_TYPE)) &&
xpc::IsInAutomation()) {
keepAlivePref.Append(FISSION_WEB_REMOTE_TYPE);
keepAlivePref.AppendLiteral(".perOrigin");
} else {
keepAlivePref.Append(NS_ConvertUTF16toUTF8(mRemoteType));
}
if (NS_FAILED(
Preferences::GetInt(keepAlivePref.get(), &processesToKeepAlive))) {
return false;