Bug 1349363 - Use a centralized function to tell if e10s-multi is on. r=Felipe
MozReview-Commit-ID: JQJtCanIv3a
--- 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]),