Bug 1570212 - Convert geo.timeout to a static pref. r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D40156

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicholas Nethercote 2019-08-02 11:59:05 +00:00
parent 1814e8c4b2
commit 0de3df67cd
2 changed files with 8 additions and 6 deletions

View File

@ -503,12 +503,7 @@ NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsGeolocationService)
NS_IMPL_RELEASE(nsGeolocationService)
static int32_t sProviderTimeout = 6000; // Time, in milliseconds, to wait for
// the location provider to spin up.
nsresult nsGeolocationService::Init() {
Preferences::AddIntVarCache(&sProviderTimeout, "geo.timeout",
sProviderTimeout);
if (!StaticPrefs::geo_enabled()) {
return NS_ERROR_FAILURE;
}
@ -688,7 +683,8 @@ void nsGeolocationService::SetDisconnectTimer() {
mDisconnectTimer->Cancel();
}
mDisconnectTimer->Init(this, sProviderTimeout, nsITimer::TYPE_ONE_SHOT);
mDisconnectTimer->Init(this, StaticPrefs::geo_timeout(),
nsITimer::TYPE_ONE_SHOT);
}
bool nsGeolocationService::HighAccuracyRequested() {

View File

@ -2598,6 +2598,12 @@
value: true
mirror: always
# Time, in milliseconds, to wait for the location provider to spin up.
- name: geo.timeout
type: int32_t
value: 6000
mirror: always
#---------------------------------------------------------------------------
# Prefs starting with "gfx."
#---------------------------------------------------------------------------