Bug 1406212 - Default to e10s on with 4 content processes. r=Felipe
☠☠ backed out by c42cf7677816 ☠ ☠
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 28 Sep 2017 15:50:15 -0700
changeset 385960 1b5e78113f06a05ffa7a3345e59cac35cd0835cc
parent 385959 adb9c07370c6d6c7cebb1cfb2baf4cbb9c0e6b8e
child 385961 1a050da96e9e0af6801f44a764424e656d12153a
push id32672
push userarchaeopteryx@coole-files.de
push dateFri, 13 Oct 2017 09:00:05 +0000
treeherdermozilla-central@3efcb26e5f37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1406212
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1406212 - Default to e10s on with 4 content processes. r=Felipe MozReview-Commit-ID: CtBXBOgTuki
browser/app/profile/firefox.js
modules/libpref/init/all.js
toolkit/xre/nsAppRunner.cpp
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1536,17 +1536,17 @@ pref("privacy.userContext.ui.enabled", f
 pref("privacy.usercontext.about_newtab_segregation.enabled", false);
 
 // 0 disables long press, 1 when clicked, the menu is shown, 2 the menu is shown after X milliseconds.
 pref("privacy.userContext.longPressBehavior", 0);
 #endif
 pref("privacy.userContext.extension", "");
 
 // Start the browser in e10s mode
-pref("browser.tabs.remote.autostart", false);
+pref("browser.tabs.remote.autostart", true);
 pref("browser.tabs.remote.desktopbehavior", true);
 
 #if !defined(RELEASE_OR_BETA) || defined(MOZ_DEV_EDITION)
 // At the moment, autostart.2 is used, while autostart.1 is unused.
 // We leave it here set to false to reset users' defaults and allow
 // us to change everybody to true in the future, when desired.
 pref("browser.tabs.remote.autostart.1", false);
 pref("browser.tabs.remote.autostart.2", true);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3314,23 +3314,18 @@ pref("dom.ipc.plugins.reportCrashURL", t
 // Defaults to 30 seconds.
 pref("dom.ipc.plugins.unloadTimeoutSecs", 30);
 
 // Allow Flash async drawing mode in 64-bit release builds
 pref("dom.ipc.plugins.asyncdrawing.enabled", true);
 // Force the accelerated direct path for a subset of Flash wmode values
 pref("dom.ipc.plugins.forcedirect.enabled", true);
 
-// Enable multi by default for Nightly and DevEdition only.
-// For Beta and Release builds, multi is controlled by the e10srollout addon.
-#if defined(RELEASE_OR_BETA) && !defined(MOZ_DEV_EDITION)
-pref("dom.ipc.processCount", 1);
-#else
+// Enable multi by default.
 pref("dom.ipc.processCount", 4);
-#endif
 
 // Default to allow only one file:// URL content process.
 pref("dom.ipc.processCount.file", 1);
 
 // WebExtensions only support a single extension process.
 pref("dom.ipc.processCount.extension", 1);
 
 // Don't use a native event loop in the content process.
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -950,17 +950,16 @@ nsXULAppInfo::GetRemoteType(nsAString& a
   }
 
   return NS_OK;
 }
 
 static bool gBrowserTabsRemoteAutostart = false;
 static uint64_t gBrowserTabsRemoteStatus = 0;
 static bool gBrowserTabsRemoteAutostartInitialized = false;
-static bool gListeningForCohortChange = false;
 
 NS_IMETHODIMP
 nsXULAppInfo::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData) {
   if (!nsCRT::strcmp(aTopic, "getE10SBlocked")) {
     nsCOMPtr<nsISupportsPRUint64> ret = do_QueryInterface(aSubject);
     if (!ret)
       return NS_ERROR_FAILURE;
 
@@ -5136,48 +5135,30 @@ MultiprocessBlockPolicy()
    * None of the blocking policies matched, so e10s is allowed to run. Return
    * 0, indicating success.
    */
   return 0;
 }
 
 namespace mozilla {
 
-static void
-CohortChanged(const char* aPref, void* aClosure)
-{
-  // Reset to the default state and recompute on the next call.
-  gBrowserTabsRemoteAutostartInitialized = false;
-  gBrowserTabsRemoteAutostart = false;
-  Preferences::UnregisterCallback(CohortChanged, "e10s.rollout.cohort");
-}
-
 bool
 BrowserTabsRemoteAutostart()
 {
   if (gBrowserTabsRemoteAutostartInitialized) {
     return gBrowserTabsRemoteAutostart;
   }
   gBrowserTabsRemoteAutostartInitialized = true;
 
   // If we're in the content process, we are running E10S.
   if (XRE_IsContentProcess()) {
     gBrowserTabsRemoteAutostart = true;
     return gBrowserTabsRemoteAutostart;
   }
 
-  // This is a pretty heinous hack. On the first launch, we end up retrieving
-  // whether e10s is enabled setting up a document very early in startup. This
-  // caches that e10s is off before the e10srollout extension can run. See
-  // bug 1372824 comment 3 for a more thorough explanation.
-  if (!gListeningForCohortChange) {
-    gListeningForCohortChange = true;
-    Preferences::RegisterCallback(CohortChanged, "e10s.rollout.cohort");
-  }
-
   bool optInPref = Preferences::GetBool("browser.tabs.remote.autostart", false);
   bool trialPref = Preferences::GetBool("browser.tabs.remote.autostart.2", false);
   bool prefEnabled = optInPref || trialPref;
   int status;
   if (optInPref) {
     status = kE10sEnabledByUser;
   } else if (trialPref) {
     status = kE10sEnabledByDefault;
@@ -5226,40 +5207,17 @@ GetMaxWebProcessCount()
   // introducing multiple prefs a la the autostart.N prefs.
   if (Preferences::GetInt("dom.ipc.multiOptOut", 0) >=
           nsIXULRuntime::E10S_MULTI_EXPERIMENT) {
     return 1;
   }
 
   const char* optInPref = "dom.ipc.processCount";
   uint32_t optInPrefValue = Preferences::GetInt(optInPref, 1);
-  const char* useDefaultPerformanceSettings =
-    "browser.preferences.defaultPerformanceSettings.enabled";
-  bool useDefaultPerformanceSettingsValue =
-    Preferences::GetBool(useDefaultPerformanceSettings, true);
-
-  // If the user has set dom.ipc.processCount, or if they have opt out of
-  // default performances settings from about:preferences, respect their
-  // decision regardless of add-ons that might affect their experience or
-  // experiment cohort.
-  if (Preferences::HasUserValue(optInPref) || !useDefaultPerformanceSettingsValue) {
-    return std::max(1u, optInPrefValue);
-  }
-
-#ifdef RELEASE_OR_BETA
-  // For our rollout on Release and Beta, we set this pref from the
-  // e10srollout extension. On Nightly, we don't touch the pref at all,
-  // allowing stale values to disable e10s-multi for certain users.
-  if (Preferences::HasUserValue("dom.ipc.processCount.web")) {
-    // The user didn't opt in or out so read the .web version of the pref.
-    return std::max(1, Preferences::GetInt("dom.ipc.processCount.web", 1));
-  }
-#endif
-
-  return optInPrefValue;
+  return std::max(1u, optInPrefValue);
 }
 
 const char*
 PlatformBuildID()
 {
   return gToolkitBuildID;
 }