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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm

Issue 2912633002: bluetooth: macOS: Adding histograms for NSError values (Closed)
Patch Set: . Created 3 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
Index: device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
index 900f3f6613ff866b754d734485da20efe264d7d6..1131a84a1443c2a48f22e08ad819f84d2396988c 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
@@ -9,6 +9,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "device/bluetooth/bluetooth_adapter_mac.h"
+#include "device/bluetooth/bluetooth_adapter_mac_metrics.h"
#include "device/bluetooth/bluetooth_device_mac.h"
#include "device/bluetooth/bluetooth_gatt_notify_session.h"
#include "device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h"
@@ -251,6 +252,7 @@ void BluetoothRemoteGattCharacteristicMac::DidUpdateValue(NSError* error) {
CHECK_EQ(GetCBPeripheral().state, CBPeripheralStateConnected);
// This method is called when the characteristic is read and when a
// notification is received.
+ RecordDidUpdateValueResult(error);
if (HasPendingRead()) {
std::pair<ValueCallback, ErrorCallback> callbacks;
callbacks.swap(read_characteristic_value_callbacks_);
@@ -289,6 +291,7 @@ void BluetoothRemoteGattCharacteristicMac::UpdateValue() {
}
void BluetoothRemoteGattCharacteristicMac::DidWriteValue(NSError* error) {
+ RecordDidWriteValueResult(error);
// We could have called cancelPeripheralConnection, which causes
// [CBPeripheral state] to be CBPeripheralStateDisconnected, before or during
// a write without response callback so we flush all pending writes.
@@ -340,6 +343,7 @@ void BluetoothRemoteGattCharacteristicMac::DidUpdateNotificationState(
VLOG(1) << *this << ": No pending notification update for characteristic.";
return;
}
+ RecordDidUpdateNotificationStateResult(error);
if (error) {
BluetoothGattService::GattErrorCode error_code =
BluetoothDeviceMac::GetGattErrorCodeFromNSError(error);
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_device_mac.mm ('k') | device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698