Index: content/browser/bluetooth/bluetooth_metrics.cc |
diff --git a/content/browser/bluetooth/bluetooth_metrics.cc b/content/browser/bluetooth/bluetooth_metrics.cc |
index 7a0b4722f7dd4bb77a30d4ca8497935cb0690ba4..6ae97006a59a33d63af9d0f41dae3967840639ef 100644 |
--- a/content/browser/bluetooth/bluetooth_metrics.cc |
+++ b/content/browser/bluetooth/bluetooth_metrics.cc |
@@ -6,6 +6,7 @@ |
#include <stdint.h> |
+#include <algorithm> |
#include <map> |
#include <set> |
#include <unordered_set> |
@@ -42,6 +43,9 @@ int HashUUID(const base::Optional<BluetoothUUID>& uuid) { |
return uuid ? HashUUID(uuid->canonical_value()) : 0; |
} |
+// The maximum number of devices that needs to be recorded. |
+const size_t kMaxNumOfDevices = 100; |
+ |
} // namespace |
namespace content { |
@@ -353,4 +357,13 @@ void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level) { |
static_cast<int>(UMARSSISignalStrengthLevel::COUNT)); |
} |
+void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices) { |
+ if (accept_all_devices) { |
+ UMA_HISTOGRAM_SPARSE_SLOWLY( |
+ "Bluetooth.Web.RequestDevice." |
+ "NumOfDevicesInChooserWhenNotAcceptingAllDevices", |
+ std::min(num_of_devices, kMaxNumOfDevices)); |
+ } |
+} |
+ |
} // namespace content |