Bug 1349363 - Use a centralized function to tell if e10s-multi is on. r=Felipe
authorBlake Kaplan <mrbkap@gmail.com>
Mon, 17 Apr 2017 14:58:52 -0700
changeset 353689 c0c849826a143ade9b6eb1c81bfd97d93194e872
parent 353688 fa4cbef6f51716010b2b35ff4fb6daa88aa608cb
child 353690 483168efae35648010c909809c427d190f010b9c
push id41012
push usermrbkap@mozilla.com
push dateWed, 19 Apr 2017 00:14:55 +0000
treeherderautoland@bf54a5711184 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1349363
milestone55.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 1349363 - Use a centralized function to tell if e10s-multi is on. r=Felipe MozReview-Commit-ID: JQJtCanIv3a
browser/base/content/tabbrowser.xml
devtools/client/aboutdebugging/components/workers/multi-e10s-warning.js
devtools/client/aboutdebugging/components/workers/panel.js
dom/base/ProcessSelector.js
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4893,17 +4893,17 @@
               label = this.mStringBundle.getString(stringID);
             }
           } else {
             label = tab.getAttribute("label");
             if (AppConstants.E10S_TESTING_ONLY &&
                 tab.linkedBrowser &&
                 tab.linkedBrowser.isRemoteBrowser) {
               label += " - e10s";
-              if (Services.prefs.getIntPref("dom.ipc.processCount") > 1) {
+              if (Services.appinfo.maxWebProcessCount > 1) {
                 label += " (" + tab.linkedBrowser.frameLoader.tabParent.osPid + ")";
               }
             }
             if (tab.userContextId) {
               label = this.mStringBundle.getFormattedString("tabs.containers.tooltip", [label, ContextualIdentityService.getUserContextLabel(tab.userContextId)]);
             }
           }
 
--- a/devtools/client/aboutdebugging/components/workers/multi-e10s-warning.js
+++ b/devtools/client/aboutdebugging/components/workers/multi-e10s-warning.js
@@ -15,25 +15,27 @@ const { Ci } = require("chrome");
 
 loader.lazyImporter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 loader.lazyRequireGetter(this, "DebuggerClient",
   "devtools/shared/client/main", true);
 
 const Strings = Services.strings.createBundle("chrome://devtools/locale/aboutdebugging.properties");
-const PROCESS_COUNT_PREF = "dom.ipc.processCount";
+const MULTI_OPT_OUT_PREF = "dom.ipc.multiOptOut";
 
 module.exports = createClass({
   displayName: "multiE10SWarning",
 
   onUpdatePreferenceClick() {
     let message = Strings.GetStringFromName("multiProcessWarningConfirmUpdate");
     if (window.confirm(message)) {
-      Services.prefs.setIntPref(PROCESS_COUNT_PREF, 1);
+      // Disable multi until at least the next experiment.
+      Services.prefs.setIntPref(MULTI_OPT_OUT_PREF,
+                                Services.appinfo.E10S_MULTI_EXPERIMENT);
       // Restart the browser.
       Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
     }
   },
 
   render() {
     return dom.div(
       {
--- a/devtools/client/aboutdebugging/components/workers/panel.js
+++ b/devtools/client/aboutdebugging/components/workers/panel.js
@@ -70,17 +70,19 @@ module.exports = createClass({
     client.removeListener("serviceWorkerRegistrationListChanged", this.updateWorkers);
     client.removeListener("workerListChanged", this.updateWorkers);
     client.removeListener("registration-changed", this.updateWorkers);
 
     Services.prefs.removeObserver(PROCESS_COUNT_PREF, this.updateMultiE10S);
   },
 
   updateMultiE10S() {
-    let processCount = Services.prefs.getIntPref(PROCESS_COUNT_PREF);
+    // We watch the pref but set the state based on
+    // nsIXULRuntime::maxWebProcessCount.
+    let processCount = Services.appinfo.maxWebProcessCount;
     this.setState({ processCount });
   },
 
   updateWorkers() {
     let workers = this.getInitialState().workers;
 
     getWorkerForms(this.props.client).then(forms => {
       forms.registrations.forEach(form => {
--- a/dom/base/ProcessSelector.js
+++ b/dom/base/ProcessSelector.js
@@ -2,19 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import('resource://gre/modules/Services.jsm');
 
-const BASE_PREF = "dom.ipc.processCount"
-const PREF_BRANCH = BASE_PREF + ".";
-
 // Fills up aProcesses until max and then selects randomly from the available
 // ones.
 function RandomSelector() {
 }
 
 RandomSelector.prototype = {
   classID:          Components.ID("{c616fcfd-9737-41f1-aa74-cee72a38f91b}"),
   QueryInterface:   XPCOMUtils.generateQI([Ci.nsIContentProcessProvider]),