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.h" |
17 #include "base/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; |
27 | 27 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, | 290 base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, |
291 weak_factory_.GetWeakPtr()), | 291 weak_factory_.GetWeakPtr()), |
292 base::TimeDelta::FromMilliseconds(interval)); | 292 base::TimeDelta::FromMilliseconds(interval)); |
293 } | 293 } |
294 | 294 |
295 LocationProviderBase* NewSystemLocationProvider() { | 295 LocationProviderBase* NewSystemLocationProvider() { |
296 return new GpsLocationProviderLinux(LibGps::New); | 296 return new GpsLocationProviderLinux(LibGps::New); |
297 } | 297 } |
298 | 298 |
299 } // namespace content | 299 } // namespace content |
OLD | NEW |