toolkit/components/url-classifier/nsUrlClassifierListManager.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/url-classifier/nsUrlClassifierListManager.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     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
     1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +const Cc = Components.classes;
     1.9 +const Ci = Components.interfaces;
    1.10 +
    1.11 +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
    1.12 +
    1.13 +#include ./content/listmanager.js
    1.14 +
    1.15 +var modScope = this;
    1.16 +function Init() {
    1.17 +  // Pull the library in.
    1.18 +  var jslib = Cc["@mozilla.org/url-classifier/jslib;1"]
    1.19 +              .getService().wrappedJSObject;
    1.20 +  Function.prototype.inherits = jslib.Function.prototype.inherits;
    1.21 +  modScope.G_Preferences = jslib.G_Preferences;
    1.22 +  modScope.G_PreferenceObserver = jslib.G_PreferenceObserver;
    1.23 +  modScope.G_ObserverServiceObserver = jslib.G_ObserverServiceObserver;
    1.24 +  modScope.G_Debug = jslib.G_Debug;
    1.25 +  modScope.G_Assert = jslib.G_Assert;
    1.26 +  modScope.G_debugService = jslib.G_debugService;
    1.27 +  modScope.G_Alarm = jslib.G_Alarm;
    1.28 +  modScope.BindToObject = jslib.BindToObject;
    1.29 +  modScope.PROT_XMLFetcher = jslib.PROT_XMLFetcher;
    1.30 +  modScope.RequestBackoff = jslib.RequestBackoff;
    1.31 +
    1.32 +  // We only need to call Init once.
    1.33 +  modScope.Init = function() {};
    1.34 +}
    1.35 +
    1.36 +function RegistrationData()
    1.37 +{
    1.38 +}
    1.39 +RegistrationData.prototype = {
    1.40 +    classID: Components.ID("{ca168834-cc00-48f9-b83c-fd018e58cae3}"),
    1.41 +    _xpcom_factory: {
    1.42 +        createInstance: function(outer, iid) {
    1.43 +            if (outer != null)
    1.44 +                throw Components.results.NS_ERROR_NO_AGGREGATION;
    1.45 +            Init();
    1.46 +            return (new PROT_ListManager()).QueryInterface(iid);
    1.47 +        }
    1.48 +    },
    1.49 +};
    1.50 +
    1.51 +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]);

mercurial