Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1253)

Unified Diff: content/browser/bluetooth/bluetooth_metrics.cc

Issue 2667053002: Add RemoteGATTDescriptor to WebBluetoothFunction histogram enum. (Closed)
Patch Set: Missing return stmt. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/bluetooth/bluetooth_metrics.cc
diff --git a/content/browser/bluetooth/bluetooth_metrics.cc b/content/browser/bluetooth/bluetooth_metrics.cc
index d9ae54fb1e2d656fc417fd78a4d1df114bbbc8e1..2569c8a7c700b7fc8f73e246d46caa219b530c9d 100644
--- a/content/browser/bluetooth/bluetooth_metrics.cc
+++ b/content/browser/bluetooth/bluetooth_metrics.cc
@@ -266,6 +266,64 @@ void RecordGetCharacteristicsCharacteristic(
}
}
+void RecordGetDescriptorsDescriptor(
+ blink::mojom::WebBluetoothGATTQueryQuantity quantity,
+ const base::Optional<BluetoothUUID>& descriptor) {
+ switch (quantity) {
+ case blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE:
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetDescriptor.Descriptor",
+ HashUUID(descriptor));
+ return;
+ case blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE:
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetDescriptors.Descriptor",
+ HashUUID(descriptor));
+ return;
+ }
+}
+
+void RecordGetDescriptorsOutcome(
+ blink::mojom::WebBluetoothGATTQueryQuantity quantity,
+ UMAGetDescriptorOutcome outcome) {
+ switch (quantity) {
+ case blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE:
+ UMA_HISTOGRAM_ENUMERATION(
+ "Bluetooth.Web.GetDescriptor.Outcome", static_cast<int>(outcome),
+ static_cast<int>(UMAGetDescriptorOutcome::COUNT));
+ return;
+ case blink::mojom::WebBluetoothGATTQueryQuantity::MULTIPLE:
+ UMA_HISTOGRAM_ENUMERATION(
+ "Bluetooth.Web.GetDescriptors.Outcome", static_cast<int>(outcome),
+ static_cast<int>(UMAGetDescriptorOutcome::COUNT));
+ return;
+ }
+}
+
+void RecordGetDescriptorsOutcome(
+ blink::mojom::WebBluetoothGATTQueryQuantity quantity,
+ CacheQueryOutcome outcome) {
+ switch (outcome) {
+ case CacheQueryOutcome::SUCCESS:
+ case CacheQueryOutcome::BAD_RENDERER:
+ // No need to record a success or renderer crash.
+ NOTREACHED();
+ return;
+ case CacheQueryOutcome::NO_DEVICE:
+ RecordGetDescriptorsOutcome(quantity, UMAGetDescriptorOutcome::NO_DEVICE);
+ return;
+ case CacheQueryOutcome::NO_SERVICE:
+ RecordGetDescriptorsOutcome(quantity,
+ UMAGetDescriptorOutcome::NO_SERVICE);
+ return;
+ case CacheQueryOutcome::NO_CHARACTERISTIC:
+ RecordGetDescriptorsOutcome(quantity,
+ UMAGetDescriptorOutcome::NO_CHARACTERISTIC);
+ return;
+ case CacheQueryOutcome::NO_DESCRIPTOR:
+ NOTREACHED();
+ return;
+ }
+}
+
// GATT Operations
void RecordGATTOperationOutcome(UMAGATTOperation operation,
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | content/browser/bluetooth/web_bluetooth_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698