|
1 # This Source Code Form is subject to the terms of the Mozilla Public |
|
2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 |
|
5 const Cc = Components.classes; |
|
6 const Ci = Components.interfaces; |
|
7 |
|
8 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); |
|
9 |
|
10 #include ./content/listmanager.js |
|
11 |
|
12 var modScope = this; |
|
13 function Init() { |
|
14 // Pull the library in. |
|
15 var jslib = Cc["@mozilla.org/url-classifier/jslib;1"] |
|
16 .getService().wrappedJSObject; |
|
17 Function.prototype.inherits = jslib.Function.prototype.inherits; |
|
18 modScope.G_Preferences = jslib.G_Preferences; |
|
19 modScope.G_PreferenceObserver = jslib.G_PreferenceObserver; |
|
20 modScope.G_ObserverServiceObserver = jslib.G_ObserverServiceObserver; |
|
21 modScope.G_Debug = jslib.G_Debug; |
|
22 modScope.G_Assert = jslib.G_Assert; |
|
23 modScope.G_debugService = jslib.G_debugService; |
|
24 modScope.G_Alarm = jslib.G_Alarm; |
|
25 modScope.BindToObject = jslib.BindToObject; |
|
26 modScope.PROT_XMLFetcher = jslib.PROT_XMLFetcher; |
|
27 modScope.RequestBackoff = jslib.RequestBackoff; |
|
28 |
|
29 // We only need to call Init once. |
|
30 modScope.Init = function() {}; |
|
31 } |
|
32 |
|
33 function RegistrationData() |
|
34 { |
|
35 } |
|
36 RegistrationData.prototype = { |
|
37 classID: Components.ID("{ca168834-cc00-48f9-b83c-fd018e58cae3}"), |
|
38 _xpcom_factory: { |
|
39 createInstance: function(outer, iid) { |
|
40 if (outer != null) |
|
41 throw Components.results.NS_ERROR_NO_AGGREGATION; |
|
42 Init(); |
|
43 return (new PROT_ListManager()).QueryInterface(iid); |
|
44 } |
|
45 }, |
|
46 }; |
|
47 |
|
48 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]); |