1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/startupcache/StartupCacheModule.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include <string.h> 1.10 + 1.11 +#include "nscore.h" 1.12 + 1.13 +#include "nsID.h" 1.14 +#include "nsIComponentManager.h" 1.15 +#include "nsIServiceManager.h" 1.16 +#include "nsCOMPtr.h" 1.17 +#include "nsIModule.h" 1.18 +#include "mozilla/ModuleUtils.h" 1.19 +#include "mozilla/scache/StartupCache.h" 1.20 + 1.21 +using namespace mozilla::scache; 1.22 + 1.23 +// XXX Need help with guard for ENABLE_TEST 1.24 +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(StartupCacheWrapper, 1.25 + StartupCacheWrapper::GetSingleton) 1.26 +NS_DEFINE_NAMED_CID(NS_STARTUPCACHE_CID); 1.27 + 1.28 +static const mozilla::Module::CIDEntry kStartupCacheCIDs[] = { 1.29 + { &kNS_STARTUPCACHE_CID, false, nullptr, StartupCacheWrapperConstructor }, 1.30 + { nullptr } 1.31 +}; 1.32 + 1.33 +static const mozilla::Module::ContractIDEntry kStartupCacheContracts[] = { 1.34 + { "@mozilla.org/startupcache/cache;1", &kNS_STARTUPCACHE_CID }, 1.35 + { nullptr } 1.36 +}; 1.37 + 1.38 +static const mozilla::Module kStartupCacheModule = { 1.39 + mozilla::Module::kVersion, 1.40 + kStartupCacheCIDs, 1.41 + kStartupCacheContracts, 1.42 + nullptr, 1.43 + nullptr, 1.44 + nullptr, 1.45 + nullptr 1.46 +}; 1.47 + 1.48 +NSMODULE_DEFN(StartupCacheModule) = &kStartupCacheModule;