startupcache/StartupCacheModule.cpp

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include <string.h>
     8 #include "nscore.h"
    10 #include "nsID.h"
    11 #include "nsIComponentManager.h"
    12 #include "nsIServiceManager.h"
    13 #include "nsCOMPtr.h"
    14 #include "nsIModule.h"
    15 #include "mozilla/ModuleUtils.h"
    16 #include "mozilla/scache/StartupCache.h"
    18 using namespace mozilla::scache;
    20 // XXX Need help with guard for ENABLE_TEST
    21 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(StartupCacheWrapper,
    22                                          StartupCacheWrapper::GetSingleton)
    23 NS_DEFINE_NAMED_CID(NS_STARTUPCACHE_CID);
    25 static const mozilla::Module::CIDEntry kStartupCacheCIDs[] = {
    26     { &kNS_STARTUPCACHE_CID, false, nullptr, StartupCacheWrapperConstructor },
    27     { nullptr }
    28 };
    30 static const mozilla::Module::ContractIDEntry kStartupCacheContracts[] = {
    31     { "@mozilla.org/startupcache/cache;1", &kNS_STARTUPCACHE_CID },
    32     { nullptr }
    33 };
    35 static const mozilla::Module kStartupCacheModule = {
    36     mozilla::Module::kVersion,
    37     kStartupCacheCIDs,
    38     kStartupCacheContracts,
    39     nullptr,
    40     nullptr,
    41     nullptr,
    42     nullptr
    43 };
    45 NSMODULE_DEFN(StartupCacheModule) = &kStartupCacheModule;

mercurial