diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-01 16:07:32 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-01 16:07:32 +0000 |
commit | c001c4c5277e933720fdd4a2dedd152d10de118a (patch) | |
tree | ba90e63a83725fd9dfeb17d6d2bd376314c06c7e /chrome/browser | |
parent | e4b619701fa20dee65de2386cc728cee9b09f717 (diff) | |
download | chromium_src-c001c4c5277e933720fdd4a2dedd152d10de118a.zip chromium_src-c001c4c5277e933720fdd4a2dedd152d10de118a.tar.gz chromium_src-c001c4c5277e933720fdd4a2dedd152d10de118a.tar.bz2 |
Now arbitration is supported (r48631) enable GPS.
Also updated GPS timestamp's to be based on the host machine's own clock (avoids clock drift affecting freshness calculation) and updated Geoposition's docs to clarify this.
BUG=43868
TEST=Run gpsfake nmea.nme, then ./out/Debug/chrome-wrapper --log-level=1 http://maps.google.com/maps/m (map follows GPS track)
Review URL: http://codereview.chromium.org/2438003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48636 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
4 files changed, 5 insertions, 17 deletions
diff --git a/chrome/browser/geolocation/gps_location_provider_linux.cc b/chrome/browser/geolocation/gps_location_provider_linux.cc index 64d56e8..3876369 100644 --- a/chrome/browser/geolocation/gps_location_provider_linux.cc +++ b/chrome/browser/geolocation/gps_location_provider_linux.cc @@ -11,11 +11,6 @@ #include "base/message_loop.h" #include "chrome/browser/geolocation/libgps_wrapper_linux.h" -// Uncomment this to force the arbitrator to use GPS instead of network -// location provider. Note this will break unit tests! -// TODO(joth): remove when arbitration is implemented. -//#define ENABLE_LIBGPS_LOCATION_PROVIDER 1 - namespace { // As per http://gpsd.berlios.de/performance.html#id374524, poll twice per sec. const int kPollPeriodMovingMillis = 500; @@ -61,13 +56,11 @@ bool GpsLocationProviderLinux::StartProvider() { gps_.reset(libgps_factory_()); if (gps_ == NULL) { LOG(WARNING) << "libgps.so could not be loaded"; - // TODO(joth): return false once GeolocationArbitratorImpl can cope with it. - return true; + return false; } if (!gps_->Start(&error_msg_)) { LOG(WARNING) << "Couldn't start GPS provider: " << error_msg_; - // TODO(joth): return false once GeolocationArbitratorImpl can cope with it. - return true; + return false; } ScheduleNextGpsPoll(0); return true; @@ -114,9 +107,5 @@ void GpsLocationProviderLinux::ScheduleNextGpsPoll(int interval) { } LocationProviderBase* NewGpsLocationProvider() { -#ifdef ENABLE_LIBGPS_LOCATION_PROVIDER return new GpsLocationProviderLinux(LibGps::New); -#else - return NULL; -#endif } diff --git a/chrome/browser/geolocation/libgps_2_38_wrapper_linux.cc b/chrome/browser/geolocation/libgps_2_38_wrapper_linux.cc index 075df3e..5c62e87 100644 --- a/chrome/browser/geolocation/libgps_2_38_wrapper_linux.cc +++ b/chrome/browser/geolocation/libgps_2_38_wrapper_linux.cc @@ -6,7 +6,7 @@ #include "chrome/browser/geolocation/libgps_wrapper_linux.h" -// This lot needed for Poll() +// This lot needed for DataWaiting() #include <sys/socket.h> #include <sys/time.h> @@ -52,10 +52,9 @@ class LibGpsV238 : public LibGps { const gps_data_t& gps_data = library().data(); if (gps_data.status == STATUS_NO_FIX) return false; - position->timestamp = base::Time::FromDoubleT(gps_data.fix.time); position->latitude = gps_data.fix.latitude; position->longitude = gps_data.fix.longitude; - position->accuracy = library().data().fix.eph; + position->accuracy = gps_data.fix.eph; position->altitude = gps_data.fix.altitude; position->altitude_accuracy = gps_data.fix.epv; position->heading = gps_data.fix.track; diff --git a/chrome/browser/geolocation/libgps_2_94_wrapper_linux.cc b/chrome/browser/geolocation/libgps_2_94_wrapper_linux.cc index 9c9de30..1f886c0 100644 --- a/chrome/browser/geolocation/libgps_2_94_wrapper_linux.cc +++ b/chrome/browser/geolocation/libgps_2_94_wrapper_linux.cc @@ -30,7 +30,6 @@ class LibGpsV294 : public LibGps { const gps_data_t& gps_data = library().data(); if (gps_data.status == STATUS_NO_FIX) return false; - position->timestamp = base::Time::FromDoubleT(gps_data.fix.time); position->latitude = gps_data.fix.latitude; position->longitude = gps_data.fix.longitude; position->accuracy = std::max(gps_data.fix.epx, gps_data.fix.epy); diff --git a/chrome/browser/geolocation/libgps_wrapper_linux.cc b/chrome/browser/geolocation/libgps_wrapper_linux.cc index 0dc743c..271b46f 100644 --- a/chrome/browser/geolocation/libgps_wrapper_linux.cc +++ b/chrome/browser/geolocation/libgps_wrapper_linux.cc @@ -88,6 +88,7 @@ bool LibGps::GetPosition(Geoposition* position) { return false; } position->error_code = Geoposition::ERROR_CODE_NONE; + position->timestamp = base::Time::Now(); if (!position->IsValidFix()) { // GetPositionIfFixed returned true, yet we've not got a valid fix. // This shouldn't happen; something went wrong in the conversion. |