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)); |
} |