michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: Components.utils.import("resource://gre/modules/Services.jsm"); michael@0: michael@0: let Scope = {} michael@0: Components.utils.import("resource://gre/modules/CrashMonitor.jsm", Scope); michael@0: let MonitorAPI = Scope.CrashMonitor; michael@0: michael@0: function CrashMonitor() {}; michael@0: michael@0: CrashMonitor.prototype = { michael@0: michael@0: classID: Components.ID("{d9d75e86-8f17-4c57-993e-f738f0d86d42}"), michael@0: contractID: "@mozilla.org/toolkit/crashmonitor;1", michael@0: michael@0: QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]), michael@0: michael@0: observe: function (aSubject, aTopic, aData) { michael@0: switch (aTopic) { michael@0: case "profile-after-change": michael@0: MonitorAPI.init(); michael@0: } michael@0: }, michael@0: }; michael@0: michael@0: this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CrashMonitor]);