Bug 668157 part.2 mozilla/dom should use mozilla::Preferences r=jst

This commit is contained in:
Masayuki Nakano 2012-04-04 13:09:20 +09:00
parent 198aeb4f07
commit b2f0fc7b65
15 changed files with 77 additions and 176 deletions

View File

@ -148,7 +148,6 @@
#include "nsIJSContextStack.h"
#include "nsIJSRuntimeService.h"
#include "nsIMarkupDocumentViewer.h"
#include "nsIPrefBranch.h"
#include "nsIPresShell.h"
#include "nsIPrivateDOMEvent.h"
#include "nsIProgrammingLanguage.h"

View File

@ -49,8 +49,6 @@
#include "nsIFilePicker.h"
#include "nsIWindowWatcher.h"
#include "nsIDOMWindow.h"
#include "nsIPrefBranch.h"
#include "nsIPrefLocalizedString.h"
#include "nsIObserverService.h"
#include "nsContentUtils.h"
#include "nsAutoPtr.h"
@ -216,10 +214,7 @@ ContentParent::Init()
obs->AddObserver(this, "a11y-init-or-shutdown", false);
#endif
}
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
prefs->AddObserver("", this, false);
}
Preferences::AddStrongObserver(this, "");
nsCOMPtr<nsIThreadInternal>
threadInt(do_QueryInterface(NS_GetCurrentThread()));
if (threadInt) {
@ -249,13 +244,8 @@ ContentParent::OnChannelConnected(int32 pid)
SetOtherProcess(handle);
#if defined(ANDROID) || defined(LINUX)
EnsurePrefService();
nsCOMPtr<nsIPrefBranch> branch;
branch = do_QueryInterface(mPrefService);
// Check nice preference
PRInt32 nice = 0;
branch->GetIntPref("dom.ipc.content.nice", &nice);
PRInt32 nice = Preferences::GetInt("dom.ipc.content.nice", 0);
// Environment variable overrides preference
char* relativeNicenessStr = getenv("MOZ_CHILD_PROCESS_RELATIVE_NICENESS");
@ -329,11 +319,7 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
SetChildMemoryReporters(empty);
// remove the global remote preferences observers
nsCOMPtr<nsIPrefBranch> prefs
(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
prefs->RemoveObserver("", this);
}
Preferences::RemoveObserver(this, "");
RecvRemoveGeolocationListener();
@ -464,7 +450,6 @@ ContentParent::IsAlive()
bool
ContentParent::RecvReadPrefsArray(InfallibleTArray<PrefTuple> *prefs)
{
EnsurePrefService();
Preferences::MirrorPreferences(prefs);
return true;
}
@ -478,18 +463,6 @@ ContentParent::RecvReadFontList(InfallibleTArray<FontListEntry>* retValue)
return true;
}
void
ContentParent::EnsurePrefService()
{
nsresult rv;
if (!mPrefService) {
mPrefService = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
NS_ASSERTION(NS_SUCCEEDED(rv),
"We lost prefService in the Chrome process !");
}
}
bool
ContentParent::RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions)
{

View File

@ -48,7 +48,6 @@
#include "nsIObserver.h"
#include "nsIThreadInternal.h"
#include "nsNetUtil.h"
#include "nsIPrefService.h"
#include "nsIPermissionManager.h"
#include "nsIDOMGeoPositionCallback.h"
#include "nsIMemoryReporter.h"
@ -167,8 +166,6 @@ private:
virtual bool RecvReadPrefsArray(InfallibleTArray<PrefTuple> *retValue);
virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue);
void EnsurePrefService();
virtual bool RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions);
virtual bool RecvGetIndexedDBDirectory(nsString* aDirectory);
@ -238,8 +235,6 @@ private:
nsCOMArray<nsIMemoryReporter> mMemoryReporters;
bool mIsAlive;
nsCOMPtr<nsIPrefService> mPrefService;
bool mSendPermissionUpdates;
nsRefPtr<nsFrameMessageManager> mMessageManager;

View File

@ -55,12 +55,11 @@
#include "nsIServiceManager.h"
#include "nsThreadUtils.h"
#include "nsIPrivateBrowsingService.h"
#include "mozilla/Preferences.h"
#include "nsIPluginStreamListener.h"
#include "nsPluginsDir.h"
#include "nsPluginSafety.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsPluginLogging.h"
#include "nsIJSContextStack.h"
@ -352,7 +351,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
}
#endif
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
nsIPrefBranch* prefs = Preferences::GetRootBranch();
if (!prefs) {
return false;
}
@ -385,8 +384,7 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
// so use the mime type (mIsJavaPlugin) and a special pref.
bool javaIsEnabled;
if (aPluginTag->mIsJavaPlugin &&
NS_SUCCEEDED(prefs->GetBoolPref("dom.ipc.plugins.java.enabled", &javaIsEnabled)) &&
!javaIsEnabled) {
!Preferences::GetBool("dom.ipc.plugins.java.enabled", true)) {
return false;
}
@ -417,8 +415,8 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
match = (NS_WildCardMatch(prefFile.get(), maskStart, 0) == MATCH);
}
if (match && NS_SUCCEEDED(prefs->GetBoolPref(prefNames[currentPref],
&oopPluginsEnabled))) {
if (match && NS_SUCCEEDED(Preferences::GetBool(prefNames[currentPref],
&oopPluginsEnabled))) {
prefSet = true;
break;
}
@ -427,17 +425,17 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
}
if (!prefSet) {
oopPluginsEnabled = false;
oopPluginsEnabled =
#ifdef XP_MACOSX
#if defined(__i386__)
prefs->GetBoolPref("dom.ipc.plugins.enabled.i386", &oopPluginsEnabled);
Preferences::GetBool("dom.ipc.plugins.enabled.i386", false);
#elif defined(__x86_64__)
prefs->GetBoolPref("dom.ipc.plugins.enabled.x86_64", &oopPluginsEnabled);
Preferences::GetBool("dom.ipc.plugins.enabled.x86_64", false);
#elif defined(__ppc__)
prefs->GetBoolPref("dom.ipc.plugins.enabled.ppc", &oopPluginsEnabled);
Preferences::GetBool("dom.ipc.plugins.enabled.ppc", false);
#endif
#else
prefs->GetBoolPref("dom.ipc.plugins.enabled", &oopPluginsEnabled);
Preferences::GetBool("dom.ipc.plugins.enabled", false);
#endif
}
@ -2061,12 +2059,10 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
case NPNVjavascriptEnabledBool: {
*(NPBool*)result = false;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
bool js = false;;
res = prefs->GetBoolPref("javascript.enabled", &js);
if (NS_SUCCEEDED(res))
*(NPBool*)result = js;
bool js = false;
res = Preferences::GetBool("javascript.enabled", &js);
if (NS_SUCCEEDED(res)) {
*(NPBool*)result = js;
}
return NPERR_NO_ERROR;
}

View File

@ -61,6 +61,8 @@
#include "nsNetCID.h"
#include "nsIContent.h"
#include "mozilla/Preferences.h"
#ifdef MOZ_WIDGET_ANDROID
#include "ANPBase.h"
#include <android/log.h>
@ -105,13 +107,8 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance()
mNPP.pdata = NULL;
mNPP.ndata = this;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
bool useLayersPref;
nsresult rv = prefs->GetBoolPref("plugins.use_layers", &useLayersPref);
if (NS_SUCCEEDED(rv))
mUsePluginLayersPref = useLayersPref;
}
mUsePluginLayersPref =
Preferences::GetBool("plugins.use_layers", mUsePluginLayersPref);
PLUGIN_LOG(PLUGIN_LOG_BASIC, ("nsNPAPIPluginInstance ctor: this=%p\n",this));
}

View File

@ -41,16 +41,16 @@
#include "nsCRT.h"
#include "nsILocalFile.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsDependentString.h"
#include "nsXPIDLString.h"
#include "prmem.h"
#include "nsArrayEnumerator.h"
#include "mozilla/Preferences.h"
#include <windows.h>
#include "nsIWindowsRegKey.h"
using namespace mozilla;
typedef struct structVer
{
WORD wMajor;
@ -231,18 +231,15 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
*_retval = nsnull;
*persistant = false;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (!prefs)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIWindowsRegKey> regKey =
do_CreateInstance("@mozilla.org/windows-registry-key;1");
NS_ENSURE_TRUE(regKey, NS_ERROR_FAILURE);
if (nsCRT::strcmp(charProp, NS_WIN_JRE_SCAN_KEY) == 0) {
nsXPIDLCString strVer;
if (NS_FAILED(prefs->GetCharPref(charProp, getter_Copies(strVer))))
nsAdoptingCString strVer = Preferences::GetCString(charProp);
if (!strVer) {
return NS_ERROR_FAILURE;
}
verBlock minVer;
TranslateVersionStr(NS_ConvertASCIItoUTF16(strVer).get(), &minVer);
@ -332,9 +329,10 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
}
}
} else if (nsCRT::strcmp(charProp, NS_WIN_QUICKTIME_SCAN_KEY) == 0) {
nsXPIDLCString strVer;
if (NS_FAILED(prefs->GetCharPref(charProp, getter_Copies(strVer))))
nsAdoptingCString strVer = Preferences::GetCString(charProp);
if (!strVer) {
return NS_ERROR_FAILURE;
}
verBlock minVer;
TranslateVersionStr(NS_ConvertASCIItoUTF16(strVer).get(), &minVer);
@ -371,9 +369,10 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
}
}
} else if (nsCRT::strcmp(charProp, NS_WIN_WMP_SCAN_KEY) == 0) {
nsXPIDLCString strVer;
if (NS_FAILED(prefs->GetCharPref(charProp, getter_Copies(strVer))))
nsAdoptingCString strVer = Preferences::GetCString(charProp);
if (!strVer) {
return NS_ERROR_FAILURE;
}
verBlock minVer;
TranslateVersionStr(NS_ConvertASCIItoUTF16(strVer).get(), &minVer);
@ -409,8 +408,8 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
}
}
} else if (nsCRT::strcmp(charProp, NS_WIN_ACROBAT_SCAN_KEY) == 0) {
nsXPIDLCString strVer;
if (NS_FAILED(prefs->GetCharPref(charProp, getter_Copies(strVer)))) {
nsAdoptingCString strVer = Preferences::GetCString(charProp);
if (!strVer) {
return NS_ERROR_FAILURE;
}

View File

@ -80,7 +80,6 @@
#include "nsHashtable.h"
#include "nsIProxyInfo.h"
#include "nsPluginLogging.h"
#include "nsIPrefBranch.h"
#include "nsIScriptChannel.h"
#include "nsIBlocklistService.h"
#include "nsVersionComparator.h"
@ -88,6 +87,7 @@
#include "nsIObjectLoadingContent.h"
#include "nsIWritablePropertyBag2.h"
#include "nsPluginStreamListenerPeer.h"
#include "mozilla/Preferences.h"
#include "nsEnumeratorUtils.h"
#include "nsXPCOM.h"
@ -336,17 +336,7 @@ NS_IMETHODIMP nsPluginDocReframeEvent::Run() {
static bool UnloadPluginsASAP()
{
nsresult rv;
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv)) {
bool unloadPluginsASAP = false;
rv = pref->GetBoolPref("dom.ipc.plugins.unloadASAP", &unloadPluginsASAP);
if (NS_SUCCEEDED(rv)) {
return unloadPluginsASAP;
}
}
return false;
return Preferences::GetBool("dom.ipc.plugins.unloadASAP", false);
}
nsPluginHost::nsPluginHost()
@ -355,20 +345,10 @@ nsPluginHost::nsPluginHost()
{
// check to see if pref is set at startup to let plugins take over in
// full page mode for certain image mime types that we handle internally
mPrefService = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (mPrefService) {
bool tmp;
nsresult rv = mPrefService->GetBoolPref("plugin.override_internal_types",
&tmp);
if (NS_SUCCEEDED(rv)) {
mOverrideInternalTypes = tmp;
}
mOverrideInternalTypes =
Preferences::GetBool("plugin.override_internal_types", false);
rv = mPrefService->GetBoolPref("plugin.disable", &tmp);
if (NS_SUCCEEDED(rv)) {
mPluginsDisabled = tmp;
}
}
mPluginsDisabled = Preferences::GetBool("plugin.disable", false);
nsCOMPtr<nsIObserverService> obsService =
mozilla::services::GetObserverService();
@ -866,8 +846,6 @@ nsresult nsPluginHost::Destroy()
}
#endif /* XP_WIN */
mPrefService = nsnull; // release prefs service to avoid leaks!
return NS_OK;
}
@ -1454,11 +1432,7 @@ public:
NS_METHOD GetFilename(nsAString& aFilename)
{
bool bShowPath;
nsCOMPtr<nsIPrefBranch> prefService = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefService &&
NS_SUCCEEDED(prefService->GetBoolPref("plugin.expose_full_path", &bShowPath)) &&
bShowPath) {
if (Preferences::GetBool("plugin.expose_full_path", false)) {
CopyUTF8toUTF16(mPluginTag.mFullPath, aFilename);
} else {
CopyUTF8toUTF16(mPluginTag.mFileName, aFilename);
@ -2219,7 +2193,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
}
if (warnOutdated) {
mPrefService->SetBoolPref("plugins.update.notifyUser", true);
Preferences::SetBool("plugins.update.notifyUser", true);
}
return NS_OK;
@ -2348,10 +2322,7 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
// the rest is optional
#ifdef XP_WIN
bool bScanPLIDs = false;
if (mPrefService)
mPrefService->GetBoolPref("plugin.scan.plid.all", &bScanPLIDs);
bool bScanPLIDs = Preferences::GetBool("plugin.scan.plid.all", false);
// Now lets scan any PLID directories
if (bScanPLIDs && mPrivateDirServiceProvider) {
@ -3233,13 +3204,9 @@ nsPluginHost::StopPluginInstance(nsNPAPIPluginInstance* aInstance)
bool doCache = aInstance->ShouldCache();
if (doCache) {
// try to get the max cached instances from a pref or use default
PRUint32 cachedInstanceLimit;
nsresult rv = NS_ERROR_FAILURE;
if (mPrefService)
rv = mPrefService->GetIntPref(NS_PREF_MAX_NUM_CACHED_INSTANCES, (int*)&cachedInstanceLimit);
if (NS_FAILED(rv))
cachedInstanceLimit = DEFAULT_NUMBER_OF_STOPPED_INSTANCES;
PRUint32 cachedInstanceLimit =
Preferences::GetUint(NS_PREF_MAX_NUM_CACHED_INSTANCES,
DEFAULT_NUMBER_OF_STOPPED_INSTANCES);
if (StoppedInstanceCount() >= cachedInstanceLimit) {
nsNPAPIPluginInstance *oldestInstance = FindOldestStoppedInstance();
if (oldestInstance) {

View File

@ -53,7 +53,6 @@
#include "nsWeakPtr.h"
#include "nsIPrompt.h"
#include "nsISupportsArray.h"
#include "nsIPrefBranch.h"
#include "nsWeakReference.h"
#include "nsThreadUtils.h"
#include "nsTArray.h"
@ -322,7 +321,6 @@ private:
nsTArray< nsRefPtr<nsNPAPIPluginInstance> > mInstances;
nsCOMPtr<nsIFile> mPluginRegFile;
nsCOMPtr<nsIPrefBranch> mPrefService;
#ifdef XP_WIN
nsRefPtr<nsPluginDirServiceProvider> mPrivateDirServiceProvider;
#endif

View File

@ -40,8 +40,6 @@
#include "npapi.h"
#include "nsPluginHost.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include <prinrval.h>
#if defined(XP_WIN)
@ -52,14 +50,15 @@ void NS_NotifyPluginCall(PRIntervalTime);
#ifdef CALL_SAFETY_ON
#include "mozilla/Preferences.h"
extern bool gSkipPluginSafeCalls;
#define NS_INIT_PLUGIN_SAFE_CALLS \
PR_BEGIN_MACRO \
nsresult res; \
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID, &res)); \
if(NS_SUCCEEDED(res) && pref) \
res = pref->GetBoolPref("plugin.dont_try_safe_calls", &gSkipPluginSafeCalls);\
#define NS_INIT_PLUGIN_SAFE_CALLS \
PR_BEGIN_MACRO \
gSkipPluginSafeCalls = \
::mozilla::Preferences::GetBool("plugin.dont_try_safe_calls", \
gSkipPluginSafeCalls); \
PR_END_MACRO
#define NS_TRY_SAFE_CALL_RETURN(ret, fun, pluginInst) \

View File

@ -45,8 +45,6 @@
#include "nsIPluginInstanceOwner.h"
#include "nsIDocument.h"
#include "nsServiceManagerUtils.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsPluginsDir.h"
#include "nsPluginHost.h"
#include "nsIUnicodeDecoder.h"
@ -56,7 +54,9 @@
#include "nsICategoryManager.h"
#include "nsNPAPIPlugin.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
using mozilla::TimeStamp;
inline char* new_str(const char* str)
@ -388,10 +388,6 @@ nsPluginTag::RegisterWithCategoryManager(bool aOverrideInternalTypes,
const char *contractId = "@mozilla.org/content/plugin/document-loader-factory;1";
nsCOMPtr<nsIPrefBranch> psvc(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (!psvc)
return; // NS_ERROR_OUT_OF_MEMORY
// A preference controls whether or not the full page plugin is disabled for
// a particular type. The string must be in the form:
// type1,type2,type3,type4
@ -399,11 +395,11 @@ nsPluginTag::RegisterWithCategoryManager(bool aOverrideInternalTypes,
// (and other plugin host settings) so applications can reliably disable
// plugins - without relying on implementation details such as prefs/category
// manager entries.
nsXPIDLCString overrideTypes;
nsCAutoString overrideTypesFormatted;
if (aType != ePluginUnregister) {
psvc->GetCharPref("plugin.disable_full_page_plugin_for_types", getter_Copies(overrideTypes));
overrideTypesFormatted.Assign(',');
nsAdoptingCString overrideTypes =
Preferences::GetCString("plugin.disable_full_page_plugin_for_types");
overrideTypesFormatted += overrideTypes;
overrideTypesFormatted.Append(',');
}

View File

@ -41,8 +41,6 @@
#elif XP_MACOSX
#include "PluginInterposeOSX.h"
#include "PluginUtilsOSX.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#endif
#ifdef MOZ_WIDGET_QT
#include <QtCore/QCoreApplication>
@ -1163,15 +1161,8 @@ PluginModuleParent::RecvGetNativeCursorsSupported(bool* supported)
{
PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
#if defined(XP_MACOSX)
bool nativeCursorsSupported = false;
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefs) {
if (NS_FAILED(prefs->GetBoolPref("dom.ipc.plugins.nativeCursorSupport",
&nativeCursorsSupported))) {
nativeCursorsSupported = false;
}
}
*supported = nativeCursorsSupported;
*supported =
Preferences::GetBool("dom.ipc.plugins.nativeCursorSupport", false);
return true;
#else
NS_NOTREACHED(

View File

@ -66,8 +66,6 @@
#include "nsIURI.h"
#include "nsIPermissionManager.h"
#include "nsIObserverService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIJSContextStack.h"
#include "nsThreadUtils.h"
#include "mozilla/Services.h"

View File

@ -61,7 +61,6 @@ using mozilla::dom::StorageChild;
#include "nsReadableUtils.h"
#include "nsIObserverService.h"
#include "nsNetUtil.h"
#include "nsIPrefBranch.h"
#include "nsICookiePermission.h"
#include "nsIPermission.h"
#include "nsIPermissionManager.h"

View File

@ -48,7 +48,8 @@
#include "nsIServiceManager.h"
#include "nsIPrivateDOMEvent.h"
#include "nsIServiceManager.h"
#include "nsIPrefService.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
using namespace hal;
@ -122,17 +123,9 @@ NS_IMETHODIMP nsDeviceSensorData::GetZ(double *aZ)
NS_IMPL_ISUPPORTS1(nsDeviceSensors, nsIDeviceSensors)
nsDeviceSensors::nsDeviceSensors()
: mEnabled(true)
{
mLastDOMMotionEventTime = TimeStamp::Now();
nsCOMPtr<nsIPrefBranch> prefSrv = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefSrv) {
bool bvalue;
nsresult rv = prefSrv->GetBoolPref("device.motion.enabled", &bvalue);
if (NS_SUCCEEDED(rv) && bvalue == false)
mEnabled = false;
}
mEnabled = Preferences::GetBool("device.motion.enabled", true);
for (int i = 0; i < NUM_SENSOR_TYPE; i++) {
nsTArray<nsIDOMWindow*> *windows = new nsTArray<nsIDOMWindow*>();

View File

@ -41,10 +41,11 @@
#include "MaemoLocationProvider.h"
#include "nsIClassInfo.h"
#include "nsDOMClassInfoID.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIServiceManager.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
NS_IMPL_ISUPPORTS2(MaemoLocationProvider, nsIGeolocationProvider, nsITimerCallback)
@ -192,31 +193,31 @@ NS_IMETHODIMP MaemoLocationProvider::Startup()
{
nsresult rv(NS_OK);
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (!prefs)
return NS_ERROR_FAILURE;
rv = StartControl();
NS_ENSURE_SUCCESS(rv, rv);
rv = StartDevice();
NS_ENSURE_SUCCESS(rv, rv);
prefs->GetBoolPref("geo.herror.ignore.big", &mIgnoreBigHErr);
mIgnoreBigHErr =
Preferences::GetBool("geo.herror.ignore.big", mIgnoreBigHErr);
if (mIgnoreBigHErr)
prefs->GetIntPref("geo.herror.max.value", &mMaxHErr);
if (mIgnoreBigHErr) {
mMaxHErr = Preferences::GetInt("geo.herror.max.value", mMaxHErr);
}
prefs->GetBoolPref("geo.verror.ignore.big", &mIgnoreBigVErr);
mIgnoreBigVErr =
Preferences::GetBool("geo.verror.ignore.big", mIgnoreBigVErr);
if (mIgnoreBigVErr)
prefs->GetIntPref("geo.verror.max.value", &mMaxVErr);
if (mIgnoreBigVErr) {
mMaxVErr = Preferences::GetInt("geo.verror.max.value", mMaxVErr);
}
if (mUpdateTimer)
return NS_OK;
PRInt32 update = 0; //0 second no timer created
prefs->GetIntPref("geo.default.update", &update);
// 0 second no timer created
PRInt32 update = Preferences::GetInt("geo.default.update", 0);
if (!update)
return NS_OK;