extensions/permissions/nsModuleFactory.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/extensions/permissions/nsModuleFactory.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     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 +#include "mozilla/ModuleUtils.h"
     1.9 +#include "nsIServiceManager.h"
    1.10 +#include "nsContentBlocker.h"
    1.11 +#include "nsXPIDLString.h"
    1.12 +
    1.13 +// Define the constructor function for the objects
    1.14 +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsContentBlocker, Init)
    1.15 +
    1.16 +NS_DEFINE_NAMED_CID(NS_CONTENTBLOCKER_CID);
    1.17 +
    1.18 +static const mozilla::Module::CIDEntry kPermissionsCIDs[] = {
    1.19 +  { &kNS_CONTENTBLOCKER_CID, false, nullptr, nsContentBlockerConstructor },
    1.20 +  { nullptr }
    1.21 +};
    1.22 +
    1.23 +static const mozilla::Module::ContractIDEntry kPermissionsContracts[] = {
    1.24 +  { NS_CONTENTBLOCKER_CONTRACTID, &kNS_CONTENTBLOCKER_CID },
    1.25 +  { nullptr }
    1.26 +};
    1.27 +
    1.28 +static const mozilla::Module::CategoryEntry kPermissionsCategories[] = {
    1.29 +  { "content-policy", NS_CONTENTBLOCKER_CONTRACTID, NS_CONTENTBLOCKER_CONTRACTID },
    1.30 +  { nullptr }
    1.31 +};
    1.32 +
    1.33 +static const mozilla::Module kPermissionsModule = {
    1.34 +  mozilla::Module::kVersion,
    1.35 +  kPermissionsCIDs,
    1.36 +  kPermissionsContracts,
    1.37 +  kPermissionsCategories
    1.38 +};
    1.39 +
    1.40 +NSMODULE_DEFN(nsPermissionsModule) = &kPermissionsModule;

mercurial