mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
0f53566ffe
--HG-- rename : modules/libpref/src/Makefile.in => modules/libpref/Makefile.in rename : modules/libpref/src/Preferences.cpp => modules/libpref/Preferences.cpp rename : modules/libpref/public/Preferences.h => modules/libpref/Preferences.h rename : modules/libpref/src/init/all.js => modules/libpref/init/all.js rename : modules/libpref/public/nsIPrefBranch.idl => modules/libpref/nsIPrefBranch.idl rename : modules/libpref/public/nsIPrefBranch2.idl => modules/libpref/nsIPrefBranch2.idl rename : modules/libpref/public/nsIPrefBranchInternal.idl => modules/libpref/nsIPrefBranchInternal.idl rename : modules/libpref/public/nsIPrefLocalizedString.idl => modules/libpref/nsIPrefLocalizedString.idl rename : modules/libpref/public/nsIPrefService.idl => modules/libpref/nsIPrefService.idl rename : modules/libpref/public/nsIRelativeFilePref.idl => modules/libpref/nsIRelativeFilePref.idl rename : modules/libpref/src/nsPrefBranch.cpp => modules/libpref/nsPrefBranch.cpp rename : modules/libpref/src/nsPrefBranch.h => modules/libpref/nsPrefBranch.h rename : modules/libpref/src/nsPrefsFactory.cpp => modules/libpref/nsPrefsFactory.cpp rename : modules/libpref/src/prefapi.cpp => modules/libpref/prefapi.cpp rename : modules/libpref/src/prefapi.h => modules/libpref/prefapi.h rename : modules/libpref/src/prefapi_private_data.h => modules/libpref/prefapi_private_data.h rename : modules/libpref/src/prefread.cpp => modules/libpref/prefread.cpp rename : modules/libpref/src/prefread.h => modules/libpref/prefread.h
55 lines
1.8 KiB
C++
55 lines
1.8 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "mozilla/ModuleUtils.h"
|
|
#include "mozilla/Preferences.h"
|
|
#include "nsPrefBranch.h"
|
|
#include "prefapi.h"
|
|
|
|
using namespace mozilla;
|
|
|
|
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(Preferences,
|
|
Preferences::GetInstanceForService)
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrefLocalizedString, Init)
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsRelativeFilePref)
|
|
|
|
static NS_DEFINE_CID(kPrefServiceCID, NS_PREFSERVICE_CID);
|
|
static NS_DEFINE_CID(kPrefLocalizedStringCID, NS_PREFLOCALIZEDSTRING_CID);
|
|
static NS_DEFINE_CID(kRelativeFilePrefCID, NS_RELATIVEFILEPREF_CID);
|
|
|
|
static mozilla::Module::CIDEntry kPrefCIDs[] = {
|
|
{ &kPrefServiceCID, true, nullptr, PreferencesConstructor },
|
|
{ &kPrefLocalizedStringCID, false, nullptr, nsPrefLocalizedStringConstructor },
|
|
{ &kRelativeFilePrefCID, false, nullptr, nsRelativeFilePrefConstructor },
|
|
{ nullptr }
|
|
};
|
|
|
|
static mozilla::Module::ContractIDEntry kPrefContracts[] = {
|
|
{ NS_PREFSERVICE_CONTRACTID, &kPrefServiceCID },
|
|
{ NS_PREFLOCALIZEDSTRING_CONTRACTID, &kPrefLocalizedStringCID },
|
|
{ NS_RELATIVEFILEPREF_CONTRACTID, &kRelativeFilePrefCID },
|
|
// compatibility for extension that uses old service
|
|
{ "@mozilla.org/preferences;1", &kPrefServiceCID },
|
|
{ nullptr }
|
|
};
|
|
|
|
static void
|
|
UnloadPrefsModule()
|
|
{
|
|
Preferences::Shutdown();
|
|
}
|
|
|
|
static const mozilla::Module kPrefModule = {
|
|
mozilla::Module::kVersion,
|
|
kPrefCIDs,
|
|
kPrefContracts,
|
|
nullptr,
|
|
nullptr,
|
|
nullptr,
|
|
UnloadPrefsModule
|
|
};
|
|
|
|
NSMODULE_DEFN(nsPrefModule) = &kPrefModule;
|