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

Side by Side Diff: content/browser/geolocation/gps_location_provider_linux.h

Issue 22821002: Delete todo to add threading in GpsLocationProviderLinux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file declares GPS providers that run on linux. Currently, just uses 5 // This file declares GPS providers that run on linux. Currently, just uses
6 // the libgps (gpsd) API. Public for testing only - for normal usage this 6 // the libgps (gpsd) API. Public for testing only - for normal usage this
7 // header should not be required, as location_provider.h declares the needed 7 // header should not be required, as location_provider.h declares the needed
8 // factory function. 8 // factory function.
9 9
10 #ifndef CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_ 10 #ifndef CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 scoped_ptr<gps_data_t> gps_data_; 50 scoped_ptr<gps_data_t> gps_data_;
51 bool is_open_; 51 bool is_open_;
52 #endif // defined(USE_LIBGPS) 52 #endif // defined(USE_LIBGPS)
53 53
54 private: 54 private:
55 DISALLOW_COPY_AND_ASSIGN(LibGps); 55 DISALLOW_COPY_AND_ASSIGN(LibGps);
56 }; 56 };
57 57
58 // Location provider for Linux, that uses libgps/gpsd to obtain position fixes. 58 // Location provider for Linux, that uses libgps/gpsd to obtain position fixes.
59 // TODO(joth): Currently this runs entirely in the client thread (i.e. Chrome's
60 // IO thread). As the older libgps API is not designed to support polling,
61 // there's a chance it could block, so better move this into its own worker
62 // thread.
63 class CONTENT_EXPORT GpsLocationProviderLinux : public LocationProviderBase { 59 class CONTENT_EXPORT GpsLocationProviderLinux : public LocationProviderBase {
64 public: 60 public:
65 typedef LibGps* (*LibGpsFactory)(); 61 typedef LibGps* (*LibGpsFactory)();
66 // |factory| will be used to create the gpsd client library wrapper. (Note 62 // |factory| will be used to create the gpsd client library wrapper. (Note
67 // NewSystemLocationProvider() will use the default factory). 63 // NewSystemLocationProvider() will use the default factory).
68 explicit GpsLocationProviderLinux(LibGpsFactory libgps_factory); 64 explicit GpsLocationProviderLinux(LibGpsFactory libgps_factory);
69 virtual ~GpsLocationProviderLinux(); 65 virtual ~GpsLocationProviderLinux();
70 66
71 void SetGpsdReconnectIntervalMillis(int value) { 67 void SetGpsdReconnectIntervalMillis(int value) {
72 gpsd_reconnect_interval_millis_ = value; 68 gpsd_reconnect_interval_millis_ = value;
(...skipping 27 matching lines...) Expand all
100 scoped_ptr<LibGps> gps_; 96 scoped_ptr<LibGps> gps_;
101 Geoposition position_; 97 Geoposition position_;
102 98
103 // Holder for the tasks which run on the thread; takes care of cleanup. 99 // Holder for the tasks which run on the thread; takes care of cleanup.
104 base::WeakPtrFactory<GpsLocationProviderLinux> weak_factory_; 100 base::WeakPtrFactory<GpsLocationProviderLinux> weak_factory_;
105 }; 101 };
106 102
107 } // namespace content 103 } // namespace content
108 104
109 #endif // CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_ 105 #endif // CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698