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

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

Issue 1723723002: bluetooth: Implement Service.getCharacteristics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Merge with ToT Created 4 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
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | content/common/bluetooth/bluetooth_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_metrics.cc
diff --git a/content/browser/bluetooth/bluetooth_metrics.cc b/content/browser/bluetooth/bluetooth_metrics.cc
index 13070bd3b5524862e0f6c8de5f212b86ee6dbc64..32f7c73dfa7015e6fda33fb643be6be3c95b19bc 100644
--- a/content/browser/bluetooth/bluetooth_metrics.cc
+++ b/content/browser/bluetooth/bluetooth_metrics.cc
@@ -150,7 +150,8 @@ void RecordGetCharacteristicOutcome(CacheQueryOutcome outcome) {
switch (outcome) {
case CacheQueryOutcome::SUCCESS:
case CacheQueryOutcome::BAD_RENDERER:
- NOTREACHED() << "No need to record a success or renderer crash";
+ // No need to record a success or renderer crash.
+ NOTREACHED();
return;
case CacheQueryOutcome::NO_DEVICE:
RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome::NO_DEVICE);
@@ -169,6 +170,38 @@ void RecordGetCharacteristicCharacteristic(const std::string& 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) {
+ switch (outcome) {
+ case CacheQueryOutcome::SUCCESS:
+ case CacheQueryOutcome::BAD_RENDERER:
+ // No need to record a success or renderer crash.
+ NOTREACHED();
+ return;
+ case CacheQueryOutcome::NO_DEVICE:
+ RecordGetCharacteristicsOutcome(UMAGetCharacteristicOutcome::NO_DEVICE);
+ return;
+ case CacheQueryOutcome::NO_SERVICE:
+ RecordGetCharacteristicsOutcome(UMAGetCharacteristicOutcome::NO_SERVICE);
+ return;
+ case CacheQueryOutcome::NO_CHARACTERISTIC:
+ NOTREACHED();
+ return;
+ }
+}
+
+void RecordGetCharacteristicsCharacteristic(const std::string& characteristic) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Bluetooth.Web.GetCharacteristics.Characteristic",
+ HashUUID(characteristic));
+}
+
// GATT Operations
void RecordGATTOperationOutcome(UMAGATTOperation operation,
@@ -195,7 +228,8 @@ static UMAGATTOperationOutcome TranslateCacheQueryOutcomeToGATTOperationOutcome(
switch (outcome) {
case CacheQueryOutcome::SUCCESS:
case CacheQueryOutcome::BAD_RENDERER:
- NOTREACHED() << "No need to record success or renderer crash";
+ // No need to record a success or renderer crash.
+ NOTREACHED();
return UMAGATTOperationOutcome::NOT_SUPPORTED;
case CacheQueryOutcome::NO_DEVICE:
return UMAGATTOperationOutcome::NO_DEVICE;
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | content/common/bluetooth/bluetooth_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698