Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1152)

Unified Diff: content/browser/geolocation/location_arbitrator.cc

Issue 10316007: Make the Geoposition helper class public (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix forward-declaration of struct as class. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/geolocation/location_arbitrator.cc
diff --git a/content/browser/geolocation/location_arbitrator.cc b/content/browser/geolocation/location_arbitrator.cc
index 5ae3e38a5b6be17ec1f8561ef5e11b87aea7a188..10617f5e5935ba8947b0ef12b64dd66ce2059fc2 100644
--- a/content/browser/geolocation/location_arbitrator.cc
+++ b/content/browser/geolocation/location_arbitrator.cc
@@ -13,6 +13,7 @@
#include "googleurl/src/gurl.h"
using content::AccessTokenStore;
+using content::Geoposition;
namespace {
@@ -124,7 +125,8 @@ void GeolocationArbitrator::LocationUpdateAvailable(
DCHECK(provider);
Geoposition new_position;
provider->GetPosition(&new_position);
- DCHECK(new_position.IsInitialized());
+ DCHECK(new_position.Validate() ||
+ new_position.error_code != content::Geoposition::ERROR_CODE_NONE);
if (!IsNewPositionBetter(position_, new_position,
provider == position_provider_))
return;
@@ -138,11 +140,11 @@ bool GeolocationArbitrator::IsNewPositionBetter(
bool from_same_provider) const {
// Updates location_info if it's better than what we currently have,
// or if it's a newer update from the same provider.
- if (!old_position.IsValidFix()) {
+ if (!old_position.Validate()) {
// Older location wasn't locked.
return true;
}
- if (new_position.IsValidFix()) {
+ if (new_position.Validate()) {
// New location is locked, let's check if it's any better.
if (old_position.accuracy >= new_position.accuracy) {
// Accuracy is better.
« no previous file with comments | « content/browser/geolocation/location_arbitrator.h ('k') | content/browser/geolocation/location_arbitrator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698