Bug 1382649 - Take the process count value set by e10s rollout as the default in the about:preferences UI, r=evanxd,jaws,mrbkap

When the user sets browser.preferences.defaultPerformanceSettings.enabled to false and want to set custom process count,
we want to offer the process count value given by e10s rollout add-on as the default, instead of the default value
of dom.ipc.processCount.

MozReview-Commit-ID: 1hXWHA9j4xw

--HG--
extra : rebase_source : 5d6001a5f0585b2cd98fbeb85493bb20482bc3df
This commit is contained in:
Timothy Guan-tin Chien 2017-07-21 12:42:19 +08:00
Родитель f3372fc646
Коммит c2ddda3deb
4 изменённых файлов: 40 добавлений и 6 удалений

Просмотреть файл

@ -1118,13 +1118,22 @@ var gMainPane = {
let defaultPerformancePref =
document.getElementById("browser.preferences.defaultPerformanceSettings.enabled");
let performanceSettings = document.getElementById("performanceSettings");
if (defaultPerformancePref.value) {
let processCountPref = document.getElementById("dom.ipc.processCount");
if (defaultPerformancePref.value) {
let accelerationPref = document.getElementById("layers.acceleration.disabled");
// Unset the value so process count will be decided by e10s rollout.
processCountPref.value = processCountPref.defaultValue;
accelerationPref.value = accelerationPref.defaultValue;
performanceSettings.hidden = true;
} else {
let e10sRolloutProcessCountPref =
document.getElementById("dom.ipc.processCount.web");
// Take the e10s rollout value as the default value (if it exists),
// but don't overwrite the user set value.
if (e10sRolloutProcessCountPref.value &&
processCountPref.value == processCountPref.defaultValue) {
processCountPref.value = e10sRolloutProcessCountPref.value;
}
performanceSettings.hidden = false;
}
},
@ -1132,12 +1141,16 @@ var gMainPane = {
buildContentProcessCountMenuList() {
if (gMainPane.isE10SEnabled()) {
let processCountPref = document.getElementById("dom.ipc.processCount");
let e10sRolloutProcessCountPref =
document.getElementById("dom.ipc.processCount.web");
let defaultProcessCount =
e10sRolloutProcessCountPref.value || processCountPref.defaultValue;
let bundlePreferences = document.getElementById("bundlePreferences");
let label = bundlePreferences.getFormattedString("defaultContentProcessCount",
[processCountPref.defaultValue]);
[defaultProcessCount]);
let contentProcessCount =
document.querySelector(`#contentProcessCount > menupopup >
menuitem[value="${processCountPref.defaultValue}"]`);
menuitem[value="${defaultProcessCount}"]`);
contentProcessCount.label = label;
document.getElementById("limitContentProcess").disabled = false;

Просмотреть файл

@ -184,6 +184,10 @@
name="dom.ipc.processCount"
type="int"/>
<preference id="dom.ipc.processCount.web"
name="dom.ipc.processCount.web"
type="int"/>
<preference id="layers.acceleration.disabled"
name="layers.acceleration.disabled"
type="bool"

Просмотреть файл

@ -429,13 +429,22 @@ var gMainPane = {
let defaultPerformancePref =
document.getElementById("browser.preferences.defaultPerformanceSettings.enabled");
let performanceSettings = document.getElementById("performanceSettings");
if (defaultPerformancePref.value) {
let processCountPref = document.getElementById("dom.ipc.processCount");
if (defaultPerformancePref.value) {
let accelerationPref = document.getElementById("layers.acceleration.disabled");
// Unset the value so process count will be decided by e10s rollout.
processCountPref.value = processCountPref.defaultValue;
accelerationPref.value = accelerationPref.defaultValue;
performanceSettings.hidden = true;
} else {
let e10sRolloutProcessCountPref =
document.getElementById("dom.ipc.processCount.web");
// Take the e10s rollout value as the default value (if it exists),
// but don't overwrite the user set value.
if (e10sRolloutProcessCountPref.value &&
processCountPref.value == processCountPref.defaultValue) {
processCountPref.value = e10sRolloutProcessCountPref.value;
}
performanceSettings.hidden = false;
}
},
@ -443,12 +452,16 @@ var gMainPane = {
buildContentProcessCountMenuList() {
if (gMainPane.isE10SEnabled()) {
let processCountPref = document.getElementById("dom.ipc.processCount");
let e10sRolloutProcessCountPref =
document.getElementById("dom.ipc.processCount.web");
let defaultProcessCount =
e10sRolloutProcessCountPref.value || processCountPref.defaultValue;
let bundlePreferences = document.getElementById("bundlePreferences");
let label = bundlePreferences.getFormattedString("defaultContentProcessCount",
[processCountPref.defaultValue]);
[defaultProcessCount]);
let contentProcessCount =
document.querySelector(`#contentProcessCount > menupopup >
menuitem[value="${processCountPref.defaultValue}"]`);
menuitem[value="${defaultProcessCount}"]`);
contentProcessCount.label = label;
document.getElementById("limitContentProcess").disabled = false;

Просмотреть файл

@ -119,6 +119,10 @@
name="dom.ipc.processCount"
type="int"/>
<preference id="dom.ipc.processCount.web"
name="dom.ipc.processCount.web"
type="int"/>
<preference id="layers.acceleration.disabled"
name="layers.acceleration.disabled"
type="bool"