nsUrlClassifierListManager.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. const Cc = Components.classes;
  5. const Ci = Components.interfaces;
  6. Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
  7. #include ./content/listmanager.js
  8. var modScope = this;
  9. function Init() {
  10. // Pull the library in.
  11. var jslib = Cc["@mozilla.org/url-classifier/jslib;1"]
  12. .getService().wrappedJSObject;
  13. Function.prototype.inherits = function(parentCtor) {
  14. var tempCtor = function(){};
  15. tempCtor.prototype = parentCtor.prototype;
  16. this.superClass_ = parentCtor.prototype;
  17. this.prototype = new tempCtor();
  18. },
  19. modScope.G_Preferences = jslib.G_Preferences;
  20. modScope.G_PreferenceObserver = jslib.G_PreferenceObserver;
  21. modScope.G_ObserverServiceObserver = jslib.G_ObserverServiceObserver;
  22. modScope.G_Debug = jslib.G_Debug;
  23. modScope.G_Assert = jslib.G_Assert;
  24. modScope.G_debugService = jslib.G_debugService;
  25. modScope.G_Alarm = jslib.G_Alarm;
  26. modScope.BindToObject = jslib.BindToObject;
  27. modScope.PROT_XMLFetcher = jslib.PROT_XMLFetcher;
  28. modScope.RequestBackoffV4 = jslib.RequestBackoffV4;
  29. // We only need to call Init once.
  30. modScope.Init = function() {};
  31. }
  32. function RegistrationData()
  33. {
  34. }
  35. RegistrationData.prototype = {
  36. classID: Components.ID("{ca168834-cc00-48f9-b83c-fd018e58cae3}"),
  37. _xpcom_factory: {
  38. createInstance: function(outer, iid) {
  39. if (outer != null)
  40. throw Components.results.NS_ERROR_NO_AGGREGATION;
  41. Init();
  42. return (new PROT_ListManager()).QueryInterface(iid);
  43. }
  44. },
  45. };
  46. this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]);