toolkit/components/telemetry/TelemetryStartup.js

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 "use strict";
     8 const Cu = Components.utils;
    10 Cu.import("resource://gre/modules/TelemetryPing.jsm", this);
    11 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this)
    13 /**
    14  * TelemetryStartup is needed to forward the "profile-after-change" notification
    15  * to TelemetryPing.jsm.
    16  */
    17 function TelemetryStartup() {
    18 }
    20 TelemetryStartup.prototype.classID = Components.ID("{117b219f-92fe-4bd2-a21b-95a342a9d474}");
    21 TelemetryStartup.prototype.QueryInterface = XPCOMUtils.generateQI([Components.interfaces.nsIObserver])
    22 TelemetryStartup.prototype.observe = function(aSubject, aTopic, aData){
    23   if (aTopic == "profile-after-change") {
    24     TelemetryPing.observe(null, "profile-after-change", null);
    25   }
    26 }
    28 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelemetryStartup]);

mercurial