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

Unified Diff: content/browser/bluetooth/web_bluetooth_service_impl.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
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/web_bluetooth_service_impl.cc
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.cc b/content/browser/bluetooth/web_bluetooth_service_impl.cc
index 9ee82b70c39d9400bdc41f6b2c4459f9fa50682a..bb410e7e9f60ade0a48b30e3beb7af996a02bd76 100644
--- a/content/browser/bluetooth/web_bluetooth_service_impl.cc
+++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -528,8 +528,16 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors(
const base::Optional<BluetoothUUID>& descriptors_uuid,
const RemoteCharacteristicGetDescriptorsCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ RecordWebBluetoothFunctionCall(
+ quantity == blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE
+ ? UMAWebBluetoothFunction::CHARACTERISTIC_GET_DESCRIPTOR
+ : UMAWebBluetoothFunction::CHARACTERISTIC_GET_DESCRIPTORS);
+ RecordGetDescriptorsDescriptor(quantity, descriptors_uuid);
+
if (descriptors_uuid &&
BluetoothBlocklist::Get().IsExcluded(descriptors_uuid.value())) {
+ RecordGetDescriptorsOutcome(quantity, UMAGetDescriptorOutcome::BLOCKLISTED);
callback.Run(blink::mojom::WebBluetoothResult::BLOCKLISTED_DESCRIPTOR_UUID,
base::nullopt /* descriptor */);
return;
@@ -543,6 +551,7 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors(
}
if (query_result.outcome != CacheQueryOutcome::SUCCESS) {
+ RecordGetDescriptorsOutcome(quantity, query_result.outcome);
callback.Run(query_result.GetWebResult(), base::nullopt /* descriptor */);
return;
}
@@ -577,11 +586,14 @@ void WebBluetoothServiceImpl::RemoteCharacteristicGetDescriptors(
}
if (!response_descriptors.empty()) {
+ RecordGetDescriptorsOutcome(quantity, UMAGetDescriptorOutcome::SUCCESS);
callback.Run(blink::mojom::WebBluetoothResult::SUCCESS,
std::move(response_descriptors));
return;
}
-
+ RecordGetDescriptorsOutcome(
+ quantity, descriptors_uuid ? UMAGetDescriptorOutcome::NOT_FOUND
+ : UMAGetDescriptorOutcome::NO_DESCRIPTORS);
callback.Run(descriptors_uuid
? blink::mojom::WebBluetoothResult::DESCRIPTOR_NOT_FOUND
: blink::mojom::WebBluetoothResult::NO_DESCRIPTORS_FOUND,
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698