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

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

Issue 1286883002: bluetooth: Add histograms and logging for getCharacteristic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-uma-refactoring
Patch Set: Fix Typoe Created 5 years, 4 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 | « no previous file | content/browser/bluetooth/bluetooth_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
index 2d2061660acb6e86e50c974468878ede236ceeca..c6427a684dc793e5a35155a8c5b42897c9f06d4e 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -360,6 +360,7 @@ void BluetoothDispatcherHost::OnGetCharacteristic(
const std::string& characteristic_uuid) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RecordWebBluetoothFunctionCall(UMAWebBluetoothFunction::GET_CHARACTERISTIC);
+ RecordGetCharacteristicCharacteristic(characteristic_uuid);
auto device_iter = service_to_device_.find(service_instance_id);
// A service_instance_id not in the map implies a hostile renderer
@@ -377,6 +378,7 @@ void BluetoothDispatcherHost::OnGetCharacteristic(
adapter_->GetDevice(device_iter->second /* device_instance_id */);
if (device == nullptr) { // See "NETWORK_ERROR Note" above.
+ RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome::NO_DEVICE);
Send(new BluetoothMsg_GetCharacteristicError(
thread_id, request_id, WebBluetoothError::DeviceNoLongerInRange));
return;
@@ -387,6 +389,7 @@ void BluetoothDispatcherHost::OnGetCharacteristic(
device::BluetoothGattService* service =
device->GetGattService(service_instance_id);
if (!service) {
+ RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome::NO_SERVICE);
Send(new BluetoothMsg_GetCharacteristicError(
thread_id, request_id, WebBluetoothError::ServiceNoLongerExists));
return;
@@ -405,6 +408,7 @@ void BluetoothDispatcherHost::OnGetCharacteristic(
if (!insert_result.second)
DCHECK(insert_result.first->second == service_instance_id);
+ RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome::SUCCESS);
// TODO(ortuno): Use generated instance ID instead.
// https://crbug.com/495379
Send(new BluetoothMsg_GetCharacteristicSuccess(
@@ -412,6 +416,7 @@ void BluetoothDispatcherHost::OnGetCharacteristic(
return;
}
}
+ RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome::NOT_FOUND);
Send(new BluetoothMsg_GetCharacteristicError(
thread_id, request_id, WebBluetoothError::CharacteristicNotFound));
}
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698