OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wifi_data.h" | 5 #include "content/browser/geolocation/wifi_data.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> |
8 | 11 |
9 #include "base/logging.h" | 12 #include "base/logging.h" |
10 | 13 |
11 namespace content { | 14 namespace content { |
12 | 15 |
13 AccessPointData::AccessPointData() | 16 AccessPointData::AccessPointData() |
14 : radio_signal_strength(kint32min), | 17 : radio_signal_strength(std::numeric_limits<int32_t>::min()), |
15 channel(kint32min), | 18 channel(std::numeric_limits<int32_t>::min()), |
16 signal_to_noise(kint32min) { | 19 signal_to_noise(std::numeric_limits<int32_t>::min()) {} |
17 } | |
18 | 20 |
19 AccessPointData::~AccessPointData() {} | 21 AccessPointData::~AccessPointData() {} |
20 | 22 |
21 WifiData::WifiData() {} | 23 WifiData::WifiData() {} |
22 | 24 |
23 WifiData::~WifiData() {} | 25 WifiData::~WifiData() {} |
24 | 26 |
25 bool WifiData::DiffersSignificantly(const WifiData& other) const { | 27 bool WifiData::DiffersSignificantly(const WifiData& other) const { |
26 // More than 4 or 50% of access points added or removed is significant. | 28 // More than 4 or 50% of access points added or removed is significant. |
27 static const size_t kMinChangedAccessPoints = 4; | 29 static const size_t kMinChangedAccessPoints = 4; |
(...skipping 15 matching lines...) Expand all Loading... |
43 ++num_common; | 45 ++num_common; |
44 } | 46 } |
45 } | 47 } |
46 DCHECK(num_common <= min_ap_count); | 48 DCHECK(num_common <= min_ap_count); |
47 | 49 |
48 // Test how many have changed. | 50 // Test how many have changed. |
49 return max_ap_count > num_common + difference_threadhold; | 51 return max_ap_count > num_common + difference_threadhold; |
50 } | 52 } |
51 | 53 |
52 } // namespace content | 54 } // namespace content |
OLD | NEW |