summaryrefslogtreecommitdiffstats
path: root/chrome/browser/geolocation
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/geolocation')
-rw-r--r--chrome/browser/geolocation/network_location_request.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/geolocation/network_location_request.cc b/chrome/browser/geolocation/network_location_request.cc
index c278b74..45a2516 100644
--- a/chrome/browser/geolocation/network_location_request.cc
+++ b/chrome/browser/geolocation/network_location_request.cc
@@ -54,6 +54,8 @@ void AddInteger(const std::wstring& property_name,
int value,
DictionaryValue* object);
// Parses the server response body. Returns true if parsing was successful.
+// Sets |*position| to the parsed location if a valid fix was received,
+// otherwise leaves it unchanged (i.e. IsInitialized() == false).
bool ParseServerResponse(const std::string& response_body,
const base::Time& timestamp,
Geoposition* position,
@@ -279,6 +281,7 @@ bool ParseServerResponse(const std::string& response_body,
Geoposition* position,
string16* access_token) {
DCHECK(position);
+ DCHECK(!position->IsInitialized());
DCHECK(access_token);
DCHECK(!timestamp.is_null());
@@ -314,7 +317,9 @@ bool ParseServerResponse(const std::string& response_body,
Value* location_value = NULL;
if (!response_object->Get(kLocationString, &location_value)) {
LOG(INFO) << "ParseServerResponse() : Missing location attribute.\n";
- return false;
+ // GLS returns an empty response (with no location property) to represent
+ // no fix available; return true to indicate successful parse.
+ return true;
}
DCHECK(location_value);