Bug 1087110 - Don't update experiments manifests if no experiment is running. r=gfritzsche, a=sledru FIREFOX_BETA_38_BASE
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Tue, 10 Mar 2015 13:36:17 +0100
changeset 248546 8bc9656cad94db48cd44f3947f1b3b1d8c57768a
parent 248545 5a3897ebc3d69a66e599c5f99af105fa358aa206
child 248547 d92bf011e305a4a4ad6bb98192a53b86bd64b813
push id7858
push userryanvm@gmail.com
push dateMon, 30 Mar 2015 16:34:04 +0000
treeherdermozilla-aurora@8bc9656cad94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche, sledru
bugs1087110
milestone38.0a2
Bug 1087110 - Don't update experiments manifests if no experiment is running. r=gfritzsche, a=sledru
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
     }
   },