mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 01:08:21 +00:00
Bug 1554785 - Part 1: Support dynamic remote types for GetMaxProcessCount, r=farre
This allows the # of processes to be specified for remote types like "webIsolated", used by fission windows. Differential Revision: https://phabricator.services.mozilla.com/D32762 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
7065ccef8c
commit
703600bfc8
@ -703,12 +703,22 @@ uint32_t ContentParent::GetPoolSize(const nsAString& aContentProcessType) {
|
||||
/*static*/
|
||||
uint32_t ContentParent::GetMaxProcessCount(
|
||||
const nsAString& aContentProcessType) {
|
||||
if (aContentProcessType.EqualsLiteral("web")) {
|
||||
// The suffix after a `=` in a remoteType is dynamic, and used to control the
|
||||
// process pool to use. Max process count is based only on the prefix.
|
||||
int32_t equalIdx = aContentProcessType.FindChar(L'=');
|
||||
if (equalIdx == kNotFound) {
|
||||
equalIdx = aContentProcessType.Length();
|
||||
}
|
||||
const nsDependentSubstring processTypePrefix =
|
||||
StringHead(aContentProcessType, equalIdx);
|
||||
|
||||
// Check for the default remote type of "web", as it uses different prefs.
|
||||
if (processTypePrefix.EqualsLiteral("web")) {
|
||||
return GetMaxWebProcessCount();
|
||||
}
|
||||
|
||||
nsAutoCString processCountPref("dom.ipc.processCount.");
|
||||
processCountPref.Append(NS_ConvertUTF16toUTF8(aContentProcessType));
|
||||
AppendUTF16toUTF8(processTypePrefix, processCountPref);
|
||||
|
||||
int32_t maxContentParents;
|
||||
if (NS_FAILED(
|
||||
|
@ -3309,6 +3309,9 @@ pref("dom.ipc.processCount.privilegedabout", 1);
|
||||
// to avoid multiple of these content processes
|
||||
pref("dom.ipc.processCount.privilegedmozilla", 1);
|
||||
|
||||
// Isolated content processes are always one-per-origin.
|
||||
pref("dom.ipc.processCount.webIsolated", 1);
|
||||
|
||||
// Keep a single privileged about process alive for performance reasons.
|
||||
// e.g. we do not want to throw content processes out every time we navigate
|
||||
// away from about:newtab.
|
||||
|
Loading…
x
Reference in New Issue
Block a user