OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bluetooth/bluetooth_metrics.h" | 5 #include "content/browser/bluetooth/bluetooth_metrics.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include <map> | 9 #include <map> |
8 #include <set> | 10 #include <set> |
9 #include "base/hash.h" | 11 #include "base/hash.h" |
10 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
11 #include "base/metrics/sparse_histogram.h" | 13 #include "base/metrics/sparse_histogram.h" |
12 #include "content/common/bluetooth/bluetooth_scan_filter.h" | 14 #include "content/common/bluetooth/bluetooth_scan_filter.h" |
13 #include "device/bluetooth/bluetooth_uuid.h" | 15 #include "device/bluetooth/bluetooth_uuid.h" |
14 | 16 |
15 using device::BluetoothUUID; | 17 using device::BluetoothUUID; |
16 | 18 |
17 namespace { | 19 namespace { |
18 // TODO(ortuno): Remove once we have a macro to histogram strings. | 20 // TODO(ortuno): Remove once we have a macro to histogram strings. |
19 // http://crbug.com/520284 | 21 // http://crbug.com/520284 |
20 int HashUUID(const std::string& uuid) { | 22 int HashUUID(const std::string& uuid) { |
21 uint32 data = base::SuperFastHash(uuid.data(), uuid.size()); | 23 uint32_t data = base::SuperFastHash(uuid.data(), uuid.size()); |
22 | 24 |
23 // Strip off the signed bit because UMA doesn't support negative values, | 25 // Strip off the signed bit because UMA doesn't support negative values, |
24 // but takes a signed int as input. | 26 // but takes a signed int as input. |
25 return static_cast<int>(data & 0x7fffffff); | 27 return static_cast<int>(data & 0x7fffffff); |
26 } | 28 } |
27 } // namespace | 29 } // namespace |
28 | 30 |
29 namespace content { | 31 namespace content { |
30 | 32 |
31 // General | 33 // General |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 static_cast<int>(outcome), | 242 static_cast<int>(outcome), |
241 static_cast<int>(UMAGATTOperationOutcome::COUNT)); | 243 static_cast<int>(UMAGATTOperationOutcome::COUNT)); |
242 } | 244 } |
243 | 245 |
244 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome) { | 246 void RecordStartNotificationsOutcome(CacheQueryOutcome outcome) { |
245 RecordStartNotificationsOutcome( | 247 RecordStartNotificationsOutcome( |
246 TranslateCacheQueryOutcomeToGATTOperationOutcome(outcome)); | 248 TranslateCacheQueryOutcomeToGATTOperationOutcome(outcome)); |
247 } | 249 } |
248 | 250 |
249 } // namespace content | 251 } // namespace content |
OLD | NEW |