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

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

Issue 2662433003: Add BluetoothRemoteGATTDescriptor reporting for .writeValue(). (Closed)
Patch Set: updating comments 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 a2c2c14adddb3589cae53e249cab645b5ec7c5c6..be6853b1fd7cd9adee5a7648d7a385c54499a973 100644
--- a/content/browser/bluetooth/web_bluetooth_service_impl.cc
+++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -780,6 +780,8 @@ void WebBluetoothServiceImpl::RemoteDescriptorWriteValue(
const std::vector<uint8_t>& value,
const RemoteDescriptorWriteValueCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ RecordWebBluetoothFunctionCall(
+ UMAWebBluetoothFunction::DESCRIPTOR_WRITE_VALUE);
// We perform the length check on the renderer side. So if we
// get a value with length > 512, we can assume it's a hostile
@@ -797,12 +799,14 @@ void WebBluetoothServiceImpl::RemoteDescriptorWriteValue(
}
if (query_result.outcome != CacheQueryOutcome::SUCCESS) {
+ RecordDescriptorWriteValueOutcome(query_result.outcome);
callback.Run(query_result.GetWebResult());
return;
}
if (BluetoothBlocklist::Get().IsExcludedFromWrites(
query_result.descriptor->GetUUID())) {
+ RecordDescriptorWriteValueOutcome(UMAGATTOperationOutcome::BLOCKLISTED);
callback.Run(blink::mojom::WebBluetoothResult::BLOCKLISTED_WRITE);
return;
}
@@ -1043,7 +1047,7 @@ void WebBluetoothServiceImpl::OnDescriptorWriteValueFailed(
const RemoteDescriptorWriteValueCallback& callback,
device::BluetoothRemoteGattService::GattErrorCode error_code) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // TODO(683477) reporting for .writeValue()
+ RecordDescriptorWriteValueOutcome(UMAGATTOperationOutcome::SUCCESS);
callback.Run(TranslateGATTErrorAndRecord(error_code,
UMAGATTOperation::DESCRIPTOR_WRITE));
}
« 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