nsModuleFactory.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #include "mozilla/ModuleUtils.h"
  5. #include "nsIServiceManager.h"
  6. #include "nsContentBlocker.h"
  7. #include "nsXPIDLString.h"
  8. // Define the constructor function for the objects
  9. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsContentBlocker, Init)
  10. NS_DEFINE_NAMED_CID(NS_CONTENTBLOCKER_CID);
  11. static const mozilla::Module::CIDEntry kPermissionsCIDs[] = {
  12. { &kNS_CONTENTBLOCKER_CID, false, nullptr, nsContentBlockerConstructor },
  13. { nullptr }
  14. };
  15. static const mozilla::Module::ContractIDEntry kPermissionsContracts[] = {
  16. { NS_CONTENTBLOCKER_CONTRACTID, &kNS_CONTENTBLOCKER_CID },
  17. { nullptr }
  18. };
  19. static const mozilla::Module::CategoryEntry kPermissionsCategories[] = {
  20. { "content-policy", NS_CONTENTBLOCKER_CONTRACTID, NS_CONTENTBLOCKER_CONTRACTID },
  21. { nullptr }
  22. };
  23. static const mozilla::Module kPermissionsModule = {
  24. mozilla::Module::kVersion,
  25. kPermissionsCIDs,
  26. kPermissionsContracts,
  27. kPermissionsCategories
  28. };
  29. NSMODULE_DEFN(nsPermissionsModule) = &kPermissionsModule;