author | Mike de Boer <mdeboer@mozilla.com> |
Thu, 06 Feb 2020 14:50:38 +0000 | |
changeset 512867 | ed077a95bbc4cb8e6c7eb494ba767067ed1f6692 |
parent 512866 | 261683a6e3511bcfde9afc46ef120a8223041ced |
child 512868 | 2f49bf59710be968997fff517292dff4ebab13c1 |
push id | 37100 |
push user | apavel@mozilla.com |
push date | Fri, 07 Feb 2020 21:53:54 +0000 |
treeherder | mozilla-central@882200a11bcf [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | garvan |
bugs | 1613627 |
milestone | 74.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
dom/system/NetworkGeolocationProvider.jsm | file | annotate | diff | comparison | revisions | |
dom/system/components.conf | file | annotate | diff | comparison | revisions |
--- a/dom/system/NetworkGeolocationProvider.jsm +++ b/dom/system/NetworkGeolocationProvider.jsm @@ -217,45 +217,45 @@ function isCachedRequestMoreAccurateThan ) { return true; } } return false; } -function WifiGeoCoordsObject(lat, lon, acc) { +function NetworkGeoCoordsObject(lat, lon, acc) { this.latitude = lat; this.longitude = lon; this.accuracy = acc; // Neither GLS nor MLS return the following properties, so set them to NaN // here. nsGeoPositionCoords will convert NaNs to null for optional properties // of the JavaScript Coordinates object. this.altitude = NaN; this.altitudeAccuracy = NaN; this.heading = NaN; this.speed = NaN; } -WifiGeoCoordsObject.prototype = { +NetworkGeoCoordsObject.prototype = { QueryInterface: ChromeUtils.generateQI([Ci.nsIDOMGeoPositionCoords]), }; -function WifiGeoPositionObject(lat, lng, acc) { - this.coords = new WifiGeoCoordsObject(lat, lng, acc); +function NetworkGeoPositionObject(lat, lng, acc) { + this.coords = new NetworkGeoCoordsObject(lat, lng, acc); this.address = null; this.timestamp = Date.now(); } -WifiGeoPositionObject.prototype = { +NetworkGeoPositionObject.prototype = { QueryInterface: ChromeUtils.generateQI([Ci.nsIDOMGeoPosition]), }; -function WifiGeoPositionProvider() { +function NetworkGeolocationProvider() { gLoggingEnabled = Services.prefs.getBoolPref( "geo.provider.network.logging.enabled", false ); gLocationRequestTimeout = Services.prefs.getIntPref( "geo.provider.network.timeToWaitBeforeSending", 5000 ); @@ -264,32 +264,33 @@ function WifiGeoPositionProvider() { true ); this.wifiService = null; this.timer = null; this.started = false; } -WifiGeoPositionProvider.prototype = { +NetworkGeolocationProvider.prototype = { classID: Components.ID("{77DA64D3-7458-4920-9491-86CC9914F904}"), QueryInterface: ChromeUtils.generateQI([ Ci.nsIGeolocationProvider, Ci.nsIWifiListener, Ci.nsITimerCallback, Ci.nsIObserver, ]), listener: null, resetTimer() { if (this.timer) { this.timer.cancel(); this.timer = null; } - // wifi thread triggers WifiGeoPositionProvider to proceed, with no wifi, do manual timeout + // Wifi thread triggers NetworkGeolocationProvider to proceed. With no wifi, + // do manual timeout. this.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); this.timer.initWithCallback( this, gLocationRequestTimeout, this.timer.TYPE_REPEATING_SLACK ); }, @@ -440,17 +441,17 @@ WifiGeoPositionProvider.prototype = { (xhr.channel instanceof Ci.nsIHttpChannel && xhr.status != 200) || !xhr.response || !xhr.response.location ) { notifyPositionUnavailable(this.listener); return; } - let newLocation = new WifiGeoPositionObject( + let newLocation = new NetworkGeoPositionObject( xhr.response.location.lat, xhr.response.location.lng, xhr.response.accuracy ); if (this.listener) { this.listener.update(newLocation); } @@ -468,9 +469,9 @@ WifiGeoPositionProvider.prototype = { function notifyPositionUnavailable(listener) { if (listener) { listener.notifyError(POSITION_UNAVAILABLE); } } }, }; -var EXPORTED_SYMBOLS = ["WifiGeoPositionProvider"]; +var EXPORTED_SYMBOLS = ["NetworkGeolocationProvider"];
--- a/dom/system/components.conf +++ b/dom/system/components.conf @@ -7,11 +7,11 @@ Classes = [ { 'cid': '{77DA64D3-7458-4920-9491-86CC9914F904}', 'contract_ids': [ '@mozilla.org/geolocation/provider;1', '@mozilla.org/geolocation/mls-provider;1', ], 'jsm': 'resource://gre/modules/NetworkGeolocationProvider.jsm', - 'constructor': 'WifiGeoPositionProvider', + 'constructor': 'NetworkGeolocationProvider', }, ]