dom/identity/nsIDService.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/identity/nsIDService.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +"use strict";
     1.9 +
    1.10 +const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
    1.11 +Cu.import("resource://gre/modules/XPCOMUtils.jsm");
    1.12 +Cu.import("resource://gre/modules/Services.jsm");
    1.13 +
    1.14 +this.IDService = function IDService() {
    1.15 +  this.wrappedJSObject = this;
    1.16 +};
    1.17 +
    1.18 +this.IDService.prototype = {
    1.19 +  classID: Components.ID("{4e0a0e98-b1d3-4745-a1eb-f815199dd06b}"),
    1.20 +
    1.21 +  QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
    1.22 +                                         Ci.nsISupportsWeakReference]),
    1.23 +
    1.24 +  observe: function observe(subject, topic, data) {
    1.25 +    switch (topic) {
    1.26 +      case "app-startup":
    1.27 +        Services.obs.addObserver(this, "final-ui-startup", true);
    1.28 +        break;
    1.29 +      case "final-ui-startup":
    1.30 +        // Startup DOMIdentity.jsm
    1.31 +        Cu.import("resource://gre/modules/DOMIdentity.jsm");
    1.32 +        DOMIdentity._init();
    1.33 +        break;
    1.34 +    }
    1.35 +  }
    1.36 +};
    1.37 +
    1.38 +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IDService]);

mercurial