| Index: content/browser/bluetooth/bluetooth_metrics.cc
|
| diff --git a/content/browser/bluetooth/bluetooth_metrics.cc b/content/browser/bluetooth/bluetooth_metrics.cc
|
| index 32f7c73dfa7015e6fda33fb643be6be3c95b19bc..c143b799637b406bcf1dfe631d0168be33b44102 100644
|
| --- a/content/browser/bluetooth/bluetooth_metrics.cc
|
| +++ b/content/browser/bluetooth/bluetooth_metrics.cc
|
| @@ -138,47 +138,28 @@ void RecordGetPrimaryServiceOutcome(CacheQueryOutcome outcome) {
|
| RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome::NO_DEVICE);
|
| }
|
|
|
| -// getCharacteristic
|
| -
|
| -void RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome outcome) {
|
| - UMA_HISTOGRAM_ENUMERATION(
|
| - "Bluetooth.Web.GetCharacteristic.Outcome", static_cast<int>(outcome),
|
| - static_cast<int>(UMAGetCharacteristicOutcome::COUNT));
|
| -}
|
| -
|
| -void RecordGetCharacteristicOutcome(CacheQueryOutcome outcome) {
|
| - switch (outcome) {
|
| - case CacheQueryOutcome::SUCCESS:
|
| - case CacheQueryOutcome::BAD_RENDERER:
|
| - // No need to record a success or renderer crash.
|
| - NOTREACHED();
|
| +// getCharacteristic & getCharacteristics
|
| +
|
| +void RecordGetCharacteristicsOutcome(
|
| + blink::mojom::WebBluetoothGATTQueryQuantity quantity,
|
| + UMAGetCharacteristicOutcome outcome) {
|
| + switch (quantity) {
|
| + case blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE:
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "Bluetooth.Web.GetCharacteristic.Outcome", static_cast<int>(outcome),
|
| + static_cast<int>(UMAGetCharacteristicOutcome::COUNT));
|
| return;
|
| - case CacheQueryOutcome::NO_DEVICE:
|
| - RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome::NO_DEVICE);
|
| - return;
|
| - case CacheQueryOutcome::NO_SERVICE:
|
| - RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome::NO_SERVICE);
|
| - return;
|
| - case CacheQueryOutcome::NO_CHARACTERISTIC:
|
| - NOTREACHED();
|
| + case blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE:
|
| + UMA_HISTOGRAM_ENUMERATION(
|
| + "Bluetooth.Web.GetCharacteristics.Outcome", static_cast<int>(outcome),
|
| + static_cast<int>(UMAGetCharacteristicOutcome::COUNT));
|
| return;
|
| }
|
| }
|
|
|
| -void RecordGetCharacteristicCharacteristic(const std::string& characteristic) {
|
| - UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetCharacteristic.Characteristic",
|
| - HashUUID(characteristic));
|
| -}
|
| -
|
| -// getCharacteristics
|
| -
|
| -void RecordGetCharacteristicsOutcome(UMAGetCharacteristicOutcome outcome) {
|
| - UMA_HISTOGRAM_ENUMERATION(
|
| - "Bluetooth.Web.GetCharacteristics.Outcome", static_cast<int>(outcome),
|
| - static_cast<int>(UMAGetCharacteristicOutcome::COUNT));
|
| -}
|
| -
|
| -void RecordGetCharacteristicsOutcome(CacheQueryOutcome outcome) {
|
| +void RecordGetCharacteristicsOutcome(
|
| + blink::mojom::WebBluetoothGATTQueryQuantity quantity,
|
| + CacheQueryOutcome outcome) {
|
| switch (outcome) {
|
| case CacheQueryOutcome::SUCCESS:
|
| case CacheQueryOutcome::BAD_RENDERER:
|
| @@ -186,10 +167,12 @@ void RecordGetCharacteristicsOutcome(CacheQueryOutcome outcome) {
|
| NOTREACHED();
|
| return;
|
| case CacheQueryOutcome::NO_DEVICE:
|
| - RecordGetCharacteristicsOutcome(UMAGetCharacteristicOutcome::NO_DEVICE);
|
| + RecordGetCharacteristicsOutcome(quantity,
|
| + UMAGetCharacteristicOutcome::NO_DEVICE);
|
| return;
|
| case CacheQueryOutcome::NO_SERVICE:
|
| - RecordGetCharacteristicsOutcome(UMAGetCharacteristicOutcome::NO_SERVICE);
|
| + RecordGetCharacteristicsOutcome(quantity,
|
| + UMAGetCharacteristicOutcome::NO_SERVICE);
|
| return;
|
| case CacheQueryOutcome::NO_CHARACTERISTIC:
|
| NOTREACHED();
|
| @@ -197,9 +180,21 @@ void RecordGetCharacteristicsOutcome(CacheQueryOutcome outcome) {
|
| }
|
| }
|
|
|
| -void RecordGetCharacteristicsCharacteristic(const std::string& characteristic) {
|
| - UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetCharacteristics.Characteristic",
|
| - HashUUID(characteristic));
|
| +void RecordGetCharacteristicsCharacteristic(
|
| + blink::mojom::WebBluetoothGATTQueryQuantity quantity,
|
| + const std::string& characteristic) {
|
| + switch (quantity) {
|
| + case blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE:
|
| + UMA_HISTOGRAM_SPARSE_SLOWLY(
|
| + "Bluetooth.Web.GetCharacteristic.Characteristic",
|
| + HashUUID(characteristic));
|
| + return;
|
| + case blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE:
|
| + UMA_HISTOGRAM_SPARSE_SLOWLY(
|
| + "Bluetooth.Web.GetCharacteristics.Characteristic",
|
| + HashUUID(characteristic));
|
| + return;
|
| + }
|
| }
|
|
|
| // GATT Operations
|
|
|