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

Unified Diff: content/browser/bluetooth/web_bluetooth_service_impl.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/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 be6853b1fd7cd9adee5a7648d7a385c54499a973..195bf92210544e61f5e17cdaedf6e5b4ad49babb 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,15 @@ 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,

Powered by Google App Engine
This is Rietveld 408576698