2014-03-18 14:52:28 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const {interfaces: Ci, utils: Cu} = Components;
|
|
|
|
|
|
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
|
|
|
Cu.import("resource:///modules/experiments/Experiments.jsm");
|
2014-03-18 14:52:30 -07:00
|
|
|
Cu.import("resource://gre/modules/osfile.jsm")
|
2014-03-18 14:52:28 -07:00
|
|
|
|
|
|
|
function ExperimentsService() {
|
|
|
|
}
|
|
|
|
|
|
|
|
ExperimentsService.prototype = {
|
|
|
|
classID: Components.ID("{f7800463-3b97-47f9-9341-b7617e6d8d49}"),
|
|
|
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback, Ci.nsIObserver]),
|
|
|
|
|
|
|
|
notify: function (timer) {
|
2014-03-18 14:52:30 -07:00
|
|
|
if (OS.Constants.Path.profileDir === undefined) {
|
|
|
|
throw Error("Update timer fired before profile was initialized?");
|
2014-03-18 14:52:28 -07:00
|
|
|
}
|
2014-03-18 14:52:30 -07:00
|
|
|
Experiments.instance().updateManifest();
|
2014-03-18 14:52:28 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
observe: function (subject, topic, data) {
|
2014-03-18 14:52:30 -07:00
|
|
|
switch (topic) {
|
|
|
|
case "profile-after-change":
|
|
|
|
Experiments.instance(); // for side effects
|
|
|
|
break;
|
2014-03-18 14:52:28 -07:00
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ExperimentsService]);
|