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

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

Issue 8463022: Make chrome communicate with gpsd through libgps/shared memory (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: addressing joth@ 's comments Created 9 years, 1 month 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/libgps_2_94_wrapper_linux.cc
diff --git a/content/browser/geolocation/libgps_2_94_wrapper_linux.cc b/content/browser/geolocation/libgps_2_94_wrapper_linux.cc
deleted file mode 100644
index 093afc73f9fbd0077c24dd6126fc39be7ea2a5a4..0000000000000000000000000000000000000000
--- a/content/browser/geolocation/libgps_2_94_wrapper_linux.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Defines a variant of libgps wrapper for use with the 2.94 release of the API.
-
-#include "content/browser/geolocation/libgps_wrapper_linux.h"
-
-#include "base/logging.h"
-#include "content/common/geoposition.h"
-#include "third_party/gpsd/release-2.94/gps.h"
-
-class LibGpsV294 : public LibGps {
- public:
- explicit LibGpsV294(LibGpsLibraryWrapper* dl_wrapper) : LibGps(dl_wrapper) {}
-
- // LibGps
- virtual bool StartStreaming() {
- return library().stream(WATCH_ENABLE) == 0;
- }
- virtual bool DataWaiting() {
- return library().waiting();
- }
- virtual bool GetPositionIfFixed(Geoposition* position) {
- // This function is duplicated between the library versions, however it
- // cannot be shared as each one must be strictly compiled against the
- // corresponding version of gps.h.
- DCHECK(position);
- const gps_data_t& gps_data = library().data();
- if (gps_data.status == STATUS_NO_FIX)
- return false;
- position->latitude = gps_data.fix.latitude;
- position->longitude = gps_data.fix.longitude;
- position->accuracy = std::max(gps_data.fix.epx, gps_data.fix.epy);
- if (position->accuracy != position->accuracy) {
- // TODO(joth): Fixme. This is a workaround for http://crbug.com/99326
- LOG(WARNING) << "libgps reported accuracy NaN, forcing to zero";
- position->accuracy = 0;
- }
- position->altitude = gps_data.fix.altitude;
- position->altitude_accuracy = gps_data.fix.epv;
- position->heading = gps_data.fix.track;
- position->speed = gps_data.fix.speed;
- return true;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(LibGpsV294);
-};
-
-LibGps* LibGps::NewV294(LibGpsLibraryWrapper* dl_wrapper) {
- return new LibGpsV294(dl_wrapper);
-}

Powered by Google App Engine
This is Rietveld 408576698