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> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // The maximum number of devices that needs to be recorded. | 46 // The maximum number of devices that needs to be recorded. |
47 const size_t kMaxNumOfDevices = 100; | 47 const size_t kMaxNumOfDevices = 100; |
48 | 48 |
49 } // namespace | 49 } // namespace |
50 | 50 |
51 namespace content { | 51 namespace content { |
52 | 52 |
53 // General | 53 // General |
54 | 54 |
55 void RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction function) { | |
56 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.FunctionCall.Count", | |
57 static_cast<int>(function), | |
58 static_cast<int>(UMAWebBluetoothFunction::COUNT)); | |
59 } | |
60 | |
61 // requestDevice() | 55 // requestDevice() |
62 | 56 |
63 void RecordRequestDeviceOutcome(UMARequestDeviceOutcome outcome) { | 57 void RecordRequestDeviceOutcome(UMARequestDeviceOutcome outcome) { |
64 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.RequestDevice.Outcome", | 58 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.RequestDevice.Outcome", |
65 static_cast<int>(outcome), | 59 static_cast<int>(outcome), |
66 static_cast<int>(UMARequestDeviceOutcome::COUNT)); | 60 static_cast<int>(UMARequestDeviceOutcome::COUNT)); |
67 } | 61 } |
68 | 62 |
69 static void RecordRequestDeviceFilters( | 63 static void RecordRequestDeviceFilters( |
70 const std::vector<blink::mojom::WebBluetoothScanFilterPtr>& filters) { | 64 const std::vector<blink::mojom::WebBluetoothScanFilterPtr>& filters) { |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices) { | 446 void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices) { |
453 if (!accept_all_devices) { | 447 if (!accept_all_devices) { |
454 UMA_HISTOGRAM_SPARSE_SLOWLY( | 448 UMA_HISTOGRAM_SPARSE_SLOWLY( |
455 "Bluetooth.Web.RequestDevice." | 449 "Bluetooth.Web.RequestDevice." |
456 "NumOfDevicesInChooserWhenNotAcceptingAllDevices", | 450 "NumOfDevicesInChooserWhenNotAcceptingAllDevices", |
457 std::min(num_of_devices, kMaxNumOfDevices)); | 451 std::min(num_of_devices, kMaxNumOfDevices)); |
458 } | 452 } |
459 } | 453 } |
460 | 454 |
461 } // namespace content | 455 } // namespace content |
OLD | NEW |