diff options
5 files changed, 7 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. diff --git a/chrome/common/geoposition.h b/chrome/common/geoposition.h index 377e7f3..527de44 100644 --- a/chrome/common/geoposition.h +++ b/chrome/common/geoposition.h @@ -52,6 +52,8 @@ struct Geoposition { double altitude_accuracy; // In metres double heading; // In degrees clockwise relative to the true north double speed; // In meters per second + // Timestamp for this position fix object taken from the host computer's + // system clock (i.e. from Time::Now(), not the source device's clock). base::Time timestamp; // These properties are returned to JavaScript as a PositionError object. |