diff --git a/dom/geolocation/nsGeolocation.cpp b/dom/geolocation/nsGeolocation.cpp index 929f5596c1ff..b2de06b0372c 100644 --- a/dom/geolocation/nsGeolocation.cpp +++ b/dom/geolocation/nsGeolocation.cpp @@ -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() { diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index d7b6e6aadd72..abc22234ef1c 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -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." #---------------------------------------------------------------------------