mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
One process per tab for e10s
This commit is contained in:
parent
c9ae15ae7b
commit
eca96d42e6
3 changed files with 22 additions and 5 deletions
|
|
@ -574,6 +574,7 @@ ContentParent::GetNewOrUsedBrowserProcess(bool aForBrowserElement,
|
|||
{
|
||||
nsTArray<ContentParent*>* contentParents;
|
||||
int32_t maxContentParents;
|
||||
bool preferDedicatedProcess = false;
|
||||
|
||||
// Decide which pool of content parents we are going to be pulling from based
|
||||
// on the aLargeAllocationProcess flag.
|
||||
|
|
@ -591,13 +592,20 @@ ContentParent::GetNewOrUsedBrowserProcess(bool aForBrowserElement,
|
|||
contentParents = sBrowserContentParents;
|
||||
|
||||
maxContentParents = Preferences::GetInt("dom.ipc.processCount", 1);
|
||||
if (maxContentParents == -1) {
|
||||
// Automatic mode: create a dedicated content process per new tab until
|
||||
// a safety ceiling is reached, then reuse existing processes.
|
||||
preferDedicatedProcess = true;
|
||||
maxContentParents = Preferences::GetInt("dom.ipc.processCount.webIsolatedMax", 64);
|
||||
}
|
||||
}
|
||||
|
||||
if (maxContentParents < 1) {
|
||||
maxContentParents = 1;
|
||||
}
|
||||
|
||||
if (contentParents->Length() >= uint32_t(maxContentParents)) {
|
||||
if (!preferDedicatedProcess ||
|
||||
contentParents->Length() >= uint32_t(maxContentParents)) {
|
||||
uint32_t maxSelectable = std::min(static_cast<uint32_t>(contentParents->Length()),
|
||||
static_cast<uint32_t>(maxContentParents));
|
||||
uint32_t startIdx = rand() % maxSelectable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue