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

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

Issue 2667053002: Add RemoteGATTDescriptor to WebBluetoothFunction histogram enum. (Closed)
Patch Set: ortuno review. 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..579763197d21b0068d07cc5167d9e6aed1a54da4 100644
--- a/content/browser/bluetooth/bluetooth_metrics.cc
+++ b/content/browser/bluetooth/bluetooth_metrics.cc
@@ -266,6 +266,63 @@ 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));
Ilya Sherman 2017/02/11 00:18:27 Are the UUIDs whitelisted in any way? If not, is
dougt 2017/02/11 00:56:09 I do not think so. The UUIDs can be any value but
Ilya Sherman 2017/02/11 01:02:36 I'm not comfortable with recording a histogram tha
ortuno 2017/02/13 00:34:15 Making custom descriptors is quite rare and there
Ilya Sherman 2017/02/13 22:06:57 Okay, thanks for clarifying that. LGTM assuming t
+ 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);
+ case CacheQueryOutcome::NO_DESCRIPTOR:
+ NOTREACHED();
+ return;
+ }
+}
+
// GATT Operations
void RecordGATTOperationOutcome(UMAGATTOperation operation,

Powered by Google App Engine
This is Rietveld 408576698