--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4368,23 +4368,16 @@
get minimizedOrFullyOccluded() {
return window.windowState == window.STATE_MINIMIZED ||
window.isFullyOccluded;
},
init() {
this.log("START");
- XPCOMUtils.defineLazyPreferenceGetter(this, "WARMING_ENABLED",
- "browser.tabs.remote.warmup.enabled", false);
- XPCOMUtils.defineLazyPreferenceGetter(this, "MAX_WARMING_TABS",
- "browser.tabs.remote.warmup.maxTabs", 3);
- XPCOMUtils.defineLazyPreferenceGetter(this, "WARMING_UNLOAD_DELAY" /* ms */,
- "browser.tabs.remote.warmup.unloadDelayMs", 2000);
-
// If we minimized the window before the switcher was activated,
// we might have set the preserveLayers flag for the current
// browser. Let's clear it.
this.tabbrowser.mCurrentBrowser.preserveLayers(false);
window.addEventListener("MozAfterPaint", this);
window.addEventListener("MozLayerTreeReady", this);
window.addEventListener("MozLayerTreeCleared", this);
@@ -4712,18 +4705,18 @@
// handlers, which might cause finish() to already have been called.
// Check for that before calling finish() again.
if (!this.tabbrowser._switcher) {
return;
}
this.maybeFinishTabSwitch();
- if (numWarming > this.MAX_WARMING_TABS) {
- this.logState("Hit MAX_WARMING_TABS");
+ if (numWarming > this.tabbrowser.tabWarmingMax) {
+ this.logState("Hit tabWarmingMax");
if (this.unloadTimer) {
this.clearTimer(this.unloadTimer);
}
this.unloadNonRequiredTabs();
}
if (numPending == 0) {
this.finish();
@@ -4932,17 +4925,17 @@
},
activateBrowserForPrintPreview(browser) {
let tab = this.tabbrowser.getTabForBrowser(browser);
this.setTabState(tab, this.STATE_LOADING);
},
canWarmTab(tab) {
- if (!this.WARMING_ENABLED) {
+ if (!this.tabbrowser.tabWarmingEnabled) {
return false;
}
// If the tab is not yet inserted, closing, not remote,
// crashed, already visible, or already requested, warming
// up the tab makes no sense.
if (this.minimizedOrFullyOccluded ||
!tab.linkedPanel ||
@@ -4972,26 +4965,27 @@
if (!this.canWarmTab(tab)) {
return;
}
this.logState("warmupTab " + this.tinfo(tab));
this.warmingTabs.add(tab);
this.setTabState(tab, this.STATE_LOADING);
- this.suppressDisplayPortAndQueueUnload(tab, this.WARMING_UNLOAD_DELAY);
+ this.suppressDisplayPortAndQueueUnload(tab,
+ this.tabbrowser.tabWarmingUnloadDelay);
},
// Called when the user asks to switch to a given tab.
requestTab(tab) {
if (tab === this.requestedTab) {
return;
}
- if (this.WARMING_ENABLED) {
+ if (this.tabbrowser.tabWarmingEnabled) {
let warmingState = "disqualified";
if (this.warmingTabs.has(tab)) {
let tabState = this.getTabState(tab);
if (tabState == this.STATE_LOADING) {
warmingState = "stillLoading";
} else if (tabState == this.STATE_LOADED) {
warmingState = "loaded";
@@ -5876,16 +5870,22 @@
// Add listeners for prerender messages
messageManager.addMessageListener("Prerender:Request", this);
messageManager.addMessageListener("Prerender:Cancel", this);
messageManager.addMessageListener("Prerender:Swap", this);
XPCOMUtils.defineLazyPreferenceGetter(this, "animationsEnabled",
"toolkit.cosmeticAnimations.enabled", true);
+ XPCOMUtils.defineLazyPreferenceGetter(this, "tabWarmingEnabled",
+ "browser.tabs.remote.warmup.enabled", false);
+ XPCOMUtils.defineLazyPreferenceGetter(this, "tabWarmingMax",
+ "browser.tabs.remote.warmup.maxTabs", 3);
+ XPCOMUtils.defineLazyPreferenceGetter(this, "tabWarmingUnloadDelay" /* ms */,
+ "browser.tabs.remote.warmup.unloadDelayMs", 2000);
]]>
</constructor>
<method name="_generateUniquePanelID">
<body><![CDATA[
if (!this._uniquePanelIDCounter) {
this._uniquePanelIDCounter = 0;
}