Bug 1087110 - Don't update experiments manifests if no experiment is running. r=gfritzsche
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Tue, 10 Mar 2015 13:36:17 +0100
changeset 266180 5c0cc88b465e5ef03598514fd1a0f7c1ab180649
parent 266179 31034d214829a9b414c97acdbe1c4f7c3fa6a346
child 266181 6f3151d4ff03c0bb1924e121fbef87d3696d5724
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1087110
milestone39.0a1
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
Bug 1087110 - Don't update experiments manifests if no experiment is running. r=gfritzsche
browser/experiments/Experiments.jsm
browser/experiments/ExperimentsService.js
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -414,16 +414,24 @@ Experiments.Experiments = function (poli
   this._firstEvaluate = true;
 
   this.init();
 };
 
 Experiments.Experiments.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback, Ci.nsIObserver]),
 
+  /**
+   * `true` if the experiments manager is currently setup (has been fully initialized
+   * and not uninitialized yet).
+   */
+  get isReady() {
+    return !this._shutdown;
+  },
+
   init: function () {
     this._shutdown = false;
     configureLogging();
 
     gExperimentsEnabled = gPrefs.get(PREF_ENABLED, false);
     this._log.trace("enabled=" + gExperimentsEnabled + ", " + this.enabled);
 
     gPrefs.observe(PREF_LOGGING, configureLogging);
--- a/browser/experiments/ExperimentsService.js
+++ b/browser/experiments/ExperimentsService.js
@@ -51,17 +51,20 @@ ExperimentsService.prototype = {
 
   notify: function (timer) {
     if (!gExperimentsEnabled) {
       return;
     }
     if (OS.Constants.Path.profileDir === undefined) {
       throw Error("Update timer fired before profile was initialized?");
     }
-    Experiments.instance().updateManifest();
+    let instance = Experiments.instance();
+    if (instance.isReady) {
+      instance.updateManifest();
+    }
   },
 
   _delayedInit: function () {
     if (!this._initialized) {
       this._initialized = true;
       Experiments.instance(); // for side effects
     }
   },