OLD | NEW |
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 #include "content/browser/geolocation/gps_location_provider_linux.h" | 5 #include "content/browser/geolocation/gps_location_provider_linux.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "content/public/common/geoposition.h" | 18 #include "content/public/common/geoposition.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 namespace { | 21 namespace { |
22 | 22 |
23 const int kGpsdReconnectRetryIntervalMillis = 10 * 1000; | 23 const int kGpsdReconnectRetryIntervalMillis = 10 * 1000; |
24 | 24 |
25 // As per http://gpsd.berlios.de/performance.html#id374524, poll twice per sec. | 25 // As per http://gpsd.berlios.de/performance.html#id374524, poll twice per sec. |
26 const int kPollPeriodMovingMillis = 500; | 26 const int kPollPeriodMovingMillis = 500; |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, | 293 base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, |
294 weak_factory_.GetWeakPtr()), | 294 weak_factory_.GetWeakPtr()), |
295 base::TimeDelta::FromMilliseconds(interval)); | 295 base::TimeDelta::FromMilliseconds(interval)); |
296 } | 296 } |
297 | 297 |
298 LocationProvider* NewSystemLocationProvider() { | 298 LocationProvider* NewSystemLocationProvider() { |
299 return new GpsLocationProviderLinux(LibGps::New); | 299 return new GpsLocationProviderLinux(LibGps::New); |
300 } | 300 } |
301 | 301 |
302 } // namespace content | 302 } // namespace content |
OLD | NEW |