Backed out changeset be4c66d5dc65 (bug 506975) for bc1 test failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 20 Oct 2014 13:00:24 +0200
changeset 235599 ca94702ad5cb01c84a3bb964d63e83d5ea9038a3
parent 235598 739a5fce8c1d22455fb230d2c2d7acb31352ac31
child 235600 95f15176c6b3a5672937e899c09b0c98842b58b2
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs506975
milestone36.0a1
backs outbe4c66d5dc65833bbed0eaf527bdb58da0f9b68a
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
Backed out changeset be4c66d5dc65 (bug 506975) for bc1 test failures
browser/app/profile/firefox.js
browser/components/sessionstore/SessionSaver.jsm
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1039,18 +1039,16 @@ pref("browser.rights.3.shown", false);
 pref("browser.rights.override", true);
 #endif
 
 pref("browser.sessionstore.resume_from_crash", true);
 pref("browser.sessionstore.resume_session_once", false);
 
 // minimal interval between two save operations in milliseconds
 pref("browser.sessionstore.interval", 15000);
-// Minimal interval between two save operations when device is unplugged
-pref("browser.sessionstore.interval_battery", 60000);
 // on which sites to save text data, POSTDATA and cookies
 // 0 = everywhere, 1 = unencrypted sites, 2 = nowhere
 pref("browser.sessionstore.privacy_level", 0);
 // the same as browser.sessionstore.privacy_level, but for saving deferred session data
 pref("browser.sessionstore.privacy_level_deferred", 1);
 // how many tabs can be reopened (per window)
 pref("browser.sessionstore.max_tabs_undo", 10);
 // how many windows can be reopened (per session) - on non-OS X platforms this
--- a/browser/components/sessionstore/SessionSaver.jsm
+++ b/browser/components/sessionstore/SessionSaver.jsm
@@ -12,42 +12,41 @@ const Ci = Components.interfaces;
 
 Cu.import("resource://gre/modules/Timer.jsm", this);
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
 
 XPCOMUtils.defineLazyModuleGetter(this, "console",
   "resource://gre/modules/devtools/Console.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Battery",
-  "resource://gre/modules/Battery.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
   "resource:///modules/sessionstore/PrivacyFilter.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
   "resource:///modules/sessionstore/SessionStore.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionFile",
   "resource:///modules/sessionstore/SessionFile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
-function observeSaveIntervalPref(obj, pref, property) {
+// Minimal interval between two save operations (in milliseconds).
+XPCOMUtils.defineLazyGetter(this, "gInterval", function () {
+  const PREF = "browser.sessionstore.interval";
+
   // Observer that updates the cached value when the preference changes.
-  Services.prefs.addObserver(pref, () => {
-    obj[property] = Services.prefs.getIntPref(pref);
+  Services.prefs.addObserver(PREF, () => {
+    this.gInterval = Services.prefs.getIntPref(PREF);
 
-    // Cancel any pending runs and call runDelayed()
-    // to apply the newly configured interval.
+    // Cancel any pending runs and call runDelayed() with
+    // zero to apply the newly configured interval.
     SessionSaverInternal.cancel();
     SessionSaverInternal.runDelayed(0);
   }, false);
-  obj[property] = Services.prefs.getIntPref(pref);
-}
 
-observeSaveIntervalPref(this, "browser.sessionstore.interval", "gInterval");
-observeSaveIntervalPref(this, "browser.sessionstore.interval_battery", "gIntervalBattery");
+  return Services.prefs.getIntPref(PREF);
+});
 
 // Notify observers about a given topic with a given subject.
 function notify(subject, topic) {
   Services.obs.notifyObservers(subject, topic, "");
 }
 
 // TelemetryStopwatch helper functions.
 function stopWatch(method) {
@@ -141,18 +140,17 @@ let SessionSaverInternal = {
    */
   runDelayed: function (delay = 2000) {
     // Bail out if there's a pending run.
     if (this._timeoutID) {
       return;
     }
 
     // Interval until the next disk operation is allowed.
-    let interval = Battery.charging ? gInterval : gIntervalBattery;
-    delay = Math.max(this._lastSaveTime + interval - Date.now(), delay, 0);
+    delay = Math.max(this._lastSaveTime + gInterval - Date.now(), delay, 0);
 
     // Schedule a state save.
     this._timeoutID = setTimeout(() => this._saveStateAsync(), delay);
   },
 
   /**
    * Sets the last save time to the current time. This will cause us to wait for
    * at least the configured interval when runDelayed() is called next.