gecko/toolkit/components/crashes/CrashService.js
Gregory Szorc 8ea9191e05 Bug 875562 - Part 3b: Review fixups; r=me
--HG--
extra : rebase_source : 1bbadefa0a86dd3c56c038089242647027c88d8f
2014-01-29 09:46:39 -08:00

34 lines
1.0 KiB
JavaScript

/* 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 {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
/**
* This component makes crash data available throughout the application.
*
* It is a service because some background activity will eventually occur.
*/
this.CrashService = function () {};
CrashService.prototype = Object.freeze({
classID: Components.ID("{92668367-1b17-4190-86b2-1061b2179744}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
observe: function (subject, topic, data) {
switch (topic) {
case "profile-after-change":
// Side-effect is the singleton is instantiated.
let m = Services.crashmanager;
break;
}
},
});
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CrashService]);