Bug 600816 - Blank page at geolocation and strange behavior. r=dougt a=blocking-fennec

This commit is contained in:
Fabrice Desre 2010-10-08 14:48:39 -07:00
parent 281b8787aa
commit 607c94214f

View File

@ -79,7 +79,7 @@ WifiGeoCoordsObject.prototype = {
};
function WifiGeoPositionObject(location, address) {
function WifiGeoPositionObject(location) {
this.coords = new WifiGeoCoordsObject(location.latitude,
location.longitude,
@ -87,7 +87,8 @@ function WifiGeoPositionObject(location, address) {
location.altitude || 0,
location.altitude_accuracy || 0);
if (address) {
if (location.address) {
let address = location.address;
this.address = new WifiGeoAddressObject(address.street_number || null,
address.street || null,
address.premises || null,
@ -383,19 +384,12 @@ WifiGeoPositionProvider.prototype = {
}
}
var address = null;
try {
address = response.location.address;
} catch (e) {
LOG("No address in response");
if (response.location) {
var newLocation = new WifiGeoPositionObject(response.location);
var update = Cc["@mozilla.org/geolocation/service;1"].getService(Ci.nsIGeolocationUpdate);
update.update(newLocation);
}
LOG("sending update to geolocation.");
var newLocation = new WifiGeoPositionObject(response.location, address);
var update = Cc["@mozilla.org/geolocation/service;1"].getService(Ci.nsIGeolocationUpdate);
update.update(newLocation);
};
var accessToken = this.getAccessTokenForURL(provider_url);