diff options
Diffstat (limited to 'content/browser/geolocation/gps_location_provider_linux.cc')
-rw-r--r-- | content/browser/geolocation/gps_location_provider_linux.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/content/browser/geolocation/gps_location_provider_linux.cc b/content/browser/geolocation/gps_location_provider_linux.cc index 6b23b90..b9c8ec3 100644 --- a/content/browser/geolocation/gps_location_provider_linux.cc +++ b/content/browser/geolocation/gps_location_provider_linux.cc @@ -22,6 +22,7 @@ #include "third_party/gpsd/release-3.1/gps.h" #endif // defined(USE_LIBGPS) +namespace content { namespace { const int kGpsdReconnectRetryIntervalMillis = 10 * 1000; @@ -39,8 +40,8 @@ const int kMovementThresholdMeters = 20; // The arbitrary delta is decreased (Gears used 100 meters); if we need to // decrease it any further we'll likely want to do some smarter filtering to // remove GPS location jitter noise. -bool PositionsDifferSiginificantly(const content::Geoposition& position_1, - const content::Geoposition& position_2) { +bool PositionsDifferSiginificantly(const Geoposition& position_1, + const Geoposition& position_2) { const bool pos_1_valid = position_1.Validate(); if (pos_1_valid != position_2.Validate()) return true; @@ -275,7 +276,7 @@ bool GpsLocationProviderLinux::StartProvider(bool high_accuracy) { DCHECK(weak_factory_.HasWeakPtrs()); return true; } - position_.error_code = content::Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; + position_.error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; gps_.reset(libgps_factory_()); if (gps_ == NULL) { DLOG(WARNING) << "libgps could not be loaded"; @@ -290,11 +291,11 @@ void GpsLocationProviderLinux::StopProvider() { gps_.reset(); } -void GpsLocationProviderLinux::GetPosition(content::Geoposition* position) { +void GpsLocationProviderLinux::GetPosition(Geoposition* position) { DCHECK(position); *position = position_; DCHECK(position->Validate() || - position->error_code != content::Geoposition::ERROR_CODE_NONE); + position->error_code != Geoposition::ERROR_CODE_NONE); } void GpsLocationProviderLinux::UpdatePosition() { @@ -308,19 +309,18 @@ void GpsLocationProviderLinux::DoGpsPollTask() { return; } - content::Geoposition new_position; + Geoposition new_position; if (!gps_->Read(&new_position)) { ScheduleNextGpsPoll(poll_period_stationary_millis_); return; } DCHECK(new_position.Validate() || - new_position.error_code != content::Geoposition::ERROR_CODE_NONE); + new_position.error_code != Geoposition::ERROR_CODE_NONE); const bool differ = PositionsDifferSiginificantly(position_, new_position); ScheduleNextGpsPoll(differ ? poll_period_moving_millis_ : poll_period_stationary_millis_); - if (differ || - new_position.error_code != content::Geoposition::ERROR_CODE_NONE) { + if (differ || new_position.error_code != Geoposition::ERROR_CODE_NONE) { // Update if the new location is interesting or we have an error to report. position_ = new_position; UpdateListeners(); @@ -339,3 +339,5 @@ void GpsLocationProviderLinux::ScheduleNextGpsPoll(int interval) { LocationProviderBase* NewSystemLocationProvider() { return new GpsLocationProviderLinux(LibGps::New); } + +} // namespace content |