From c0d02b25beefbf075d60e9c91b98094a74800acb Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Mon, 17 Apr 2017 14:58:52 -0700 Subject: [PATCH] Bug 1349363 - Use a centralized function to tell if e10s-multi is on. r=Felipe MozReview-Commit-ID: JQJtCanIv3a --HG-- extra : rebase_source : e459489211499ccc65b3b834ed0ec4e4d751994e --- browser/base/content/tabbrowser.xml | 2 +- .../aboutdebugging/components/workers/multi-e10s-warning.js | 6 ++++-- devtools/client/aboutdebugging/components/workers/panel.js | 4 +++- dom/base/ProcessSelector.js | 3 --- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 5a73505efee9..33b5502192d1 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -4898,7 +4898,7 @@ 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 + ")"; } } diff --git a/devtools/client/aboutdebugging/components/workers/multi-e10s-warning.js b/devtools/client/aboutdebugging/components/workers/multi-e10s-warning.js index b1e5c9bd2715..32f51f0c4983 100644 --- a/devtools/client/aboutdebugging/components/workers/multi-e10s-warning.js +++ b/devtools/client/aboutdebugging/components/workers/multi-e10s-warning.js @@ -20,7 +20,7 @@ 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", @@ -28,7 +28,9 @@ module.exports = createClass({ 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); } diff --git a/devtools/client/aboutdebugging/components/workers/panel.js b/devtools/client/aboutdebugging/components/workers/panel.js index 0737dcf807be..527925ddd07a 100644 --- a/devtools/client/aboutdebugging/components/workers/panel.js +++ b/devtools/client/aboutdebugging/components/workers/panel.js @@ -75,7 +75,9 @@ module.exports = createClass({ }, 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 }); }, diff --git a/dom/base/ProcessSelector.js b/dom/base/ProcessSelector.js index dfeb512016f9..4c5ab6772416 100644 --- a/dom/base/ProcessSelector.js +++ b/dom/base/ProcessSelector.js @@ -7,9 +7,6 @@ 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() {