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

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

Issue 2641173009: Add BluetoothRemoteGATTDescriptor reporting for .readValue(). (Closed)
Patch Set: Created 3 years, 11 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 152384426d37fd93ba72254d67be21f307473837..5adce0eeaf41874eec81f3bf15c7b6341768c44f 100644
--- a/content/browser/bluetooth/web_bluetooth_service_impl.cc
+++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -744,6 +744,8 @@ void WebBluetoothServiceImpl::RemoteDescriptorReadValue(
const std::string& descriptor_instance_id,
const RemoteDescriptorReadValueCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ RecordWebBluetoothFunctionCall(
+ UMAWebBluetoothFunction::DESCRIPTOR_READ_VALUE);
const CacheQueryResult query_result =
QueryCacheForDescriptor(descriptor_instance_id);
@@ -753,12 +755,14 @@ void WebBluetoothServiceImpl::RemoteDescriptorReadValue(
}
if (query_result.outcome != CacheQueryOutcome::SUCCESS) {
+ RecordDescriptorReadValueOutcome(query_result.outcome);
callback.Run(query_result.GetWebResult(), base::nullopt /* value */);
return;
}
if (BluetoothBlocklist::Get().IsExcludedFromReads(
query_result.descriptor->GetUUID())) {
+ RecordDescriptorReadValueOutcome(UMAGATTOperationOutcome::BLOCKLISTED);
callback.Run(blink::mojom::WebBluetoothResult::BLOCKLISTED_READ,
base::nullopt /* value */);
return;
@@ -976,6 +980,7 @@ void WebBluetoothServiceImpl::OnDescriptorReadValueSuccess(
const RemoteDescriptorReadValueCallback& callback,
const std::vector<uint8_t>& value) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ RecordDescriptorReadValueOutcome(UMAGATTOperationOutcome::SUCCESS);
callback.Run(blink::mojom::WebBluetoothResult::SUCCESS, value);
}
@@ -983,7 +988,6 @@ void WebBluetoothServiceImpl::OnDescriptorReadValueFailed(
const RemoteDescriptorReadValueCallback& callback,
device::BluetoothRemoteGattService::GattErrorCode error_code) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // TODO(667319) We are reporting failures to UMA but not reporting successes.
callback.Run(TranslateGATTErrorAndRecord(error_code,
UMAGATTOperation::DESCRIPTOR_READ),
base::nullopt /* value */);
« 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