Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
9 Cu.import("resource://gre/modules/Services.jsm", this);
10 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
12 /**
13 * This component makes crash data available throughout the application.
14 *
15 * It is a service because some background activity will eventually occur.
16 */
17 this.CrashService = function () {};
19 CrashService.prototype = Object.freeze({
20 classID: Components.ID("{92668367-1b17-4190-86b2-1061b2179744}"),
21 QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
23 observe: function (subject, topic, data) {
24 switch (topic) {
25 case "profile-after-change":
26 // Side-effect is the singleton is instantiated.
27 let m = Services.crashmanager;
28 break;
29 }
30 },
31 });
33 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CrashService]);