Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); |
michael@0 | 6 | Components.utils.import("resource://gre/modules/Services.jsm"); |
michael@0 | 7 | |
michael@0 | 8 | let Scope = {} |
michael@0 | 9 | Components.utils.import("resource://gre/modules/CrashMonitor.jsm", Scope); |
michael@0 | 10 | let MonitorAPI = Scope.CrashMonitor; |
michael@0 | 11 | |
michael@0 | 12 | function CrashMonitor() {}; |
michael@0 | 13 | |
michael@0 | 14 | CrashMonitor.prototype = { |
michael@0 | 15 | |
michael@0 | 16 | classID: Components.ID("{d9d75e86-8f17-4c57-993e-f738f0d86d42}"), |
michael@0 | 17 | contractID: "@mozilla.org/toolkit/crashmonitor;1", |
michael@0 | 18 | |
michael@0 | 19 | QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]), |
michael@0 | 20 | |
michael@0 | 21 | observe: function (aSubject, aTopic, aData) { |
michael@0 | 22 | switch (aTopic) { |
michael@0 | 23 | case "profile-after-change": |
michael@0 | 24 | MonitorAPI.init(); |
michael@0 | 25 | } |
michael@0 | 26 | }, |
michael@0 | 27 | }; |
michael@0 | 28 | |
michael@0 | 29 | this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CrashMonitor]); |