mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Bug 1121864 - Fix some minor nits in NetworkGeolocationProvider.js. r=garvank
This commit is contained in:
parent
af543c1cd3
commit
1ab0ff809c
@ -2,6 +2,8 @@
|
||||
* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
@ -318,13 +320,12 @@ WifiGeoPositionProvider.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
Services.obs.addObserver(this, SETTINGS_CHANGED_TOPIC, false);
|
||||
let settings = Cc["@mozilla.org/settingsService;1"].getService(Ci.nsISettingsService);
|
||||
Services.obs.addObserver(this, SETTINGS_CHANGED_TOPIC, false);
|
||||
let settingsService = Cc["@mozilla.org/settingsService;1"];
|
||||
if (settingsService) {
|
||||
let settings = settingsService.getService(Ci.nsISettingsService);
|
||||
settings.createLock().get(SETTINGS_WIFI_ENABLED, settingsCallback);
|
||||
settings.createLock().get(SETTINGS_DEBUG_ENABLED, settingsCallback);
|
||||
} catch(ex) {
|
||||
// This platform doesn't have the settings interface, and that is just peachy
|
||||
}
|
||||
|
||||
if (gWifiScanningEnabled && Cc["@mozilla.org/wifi/monitor;1"]) {
|
||||
@ -509,7 +510,7 @@ WifiGeoPositionProvider.prototype = {
|
||||
[POSITION_UNAVAILABLE]);
|
||||
}).bind(this);
|
||||
xhr.onload = (function() {
|
||||
LOG("gls returned status: " + xhr.status + " --> " + JSON.stringify(xhr.response));
|
||||
LOG("server returned status: " + xhr.status + " --> " + JSON.stringify(xhr.response));
|
||||
if ((xhr.channel instanceof Ci.nsIHttpChannel && xhr.status != 200) ||
|
||||
!xhr.response || !xhr.response.location) {
|
||||
this.notifyListener("notifyError",
|
||||
|
Loading…
x
Reference in New Issue
Block a user