mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +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
|
|
@ -923,6 +923,11 @@ pref("dom.ipc.shims.enabledWarnings", false);
|
|||
// Start the browser in e10s mode
|
||||
pref("browser.tabs.remote.autostart", true);
|
||||
pref("browser.tabs.remote.desktopbehavior", true);
|
||||
pref("browser.tabs.remote.ignoreBlockPolicy", true);
|
||||
// -1 means automatic tab-isolation mode: try one process per tab.
|
||||
pref("dom.ipc.processCount", -1);
|
||||
// Safety ceiling used by automatic tab-isolation mode.
|
||||
pref("dom.ipc.processCount.webIsolatedMax", 64);
|
||||
|
||||
// This pref governs whether we attempt to work around problems caused by
|
||||
// plugins using OS calls to manipulate the cursor while running out-of-
|
||||
|
|
@ -1245,10 +1250,8 @@ pref("browser.tabs.remote.autostart.2", true);
|
|||
pref("extensions.interposition.enabled", true);
|
||||
pref("extensions.interposition.prefetching", true);
|
||||
|
||||
// Enable blocking of e10s for add-on users on beta/release.
|
||||
#ifdef RELEASE_OR_BETA
|
||||
pref("extensions.e10sBlocksEnabling", true);
|
||||
#endif
|
||||
// Keep e10s enabled even when legacy add-ons are present.
|
||||
pref("extensions.e10sBlocksEnabling", false);
|
||||
|
||||
// How often to check for CPOW timeouts. CPOWs are only timed out by
|
||||
// the hang monitor.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -4203,6 +4203,12 @@ MultiprocessBlockPolicy() {
|
|||
}
|
||||
gMultiprocessBlockPolicyInitialized = true;
|
||||
|
||||
// Allow downstream applications to bypass legacy e10s block policies.
|
||||
// This is evaluated at startup and requires restart to take effect.
|
||||
if (Preferences::GetBool("browser.tabs.remote.ignoreBlockPolicy", false)) {
|
||||
return gMultiprocessBlockPolicy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Avoids enabling e10s if there are add-ons installed.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue