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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 2912633002: bluetooth: macOS: Adding histograms for NSError values (Closed)
Patch Set: Created 3 years, 7 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_low_energy_device_mac.mm
diff --git a/device/bluetooth/bluetooth_low_energy_device_mac.mm b/device/bluetooth/bluetooth_low_energy_device_mac.mm
index 2f2cfa9bbe59f7807dd817260afe1d30af3715a5..56b50c312705c2a701720324ff05fae2018185e0 100644
--- a/device/bluetooth/bluetooth_low_energy_device_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm
@@ -14,6 +14,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "device/bluetooth/bluetooth_adapter_mac.h"
+#include "device/bluetooth/bluetooth_adapter_mac_metrics.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_low_energy_peripheral_delegate.h"
#include "device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h"
@@ -215,6 +216,9 @@ void BluetoothLowEnergyDeviceMac::DidDiscoverPrimaryServices(NSError* error) {
// TODO(http://crbug.com/609320): Need to pass the error.
// TODO(http://crbug.com/609844): Decide what to do if discover failed
// a device services.
+ LogNSErrorToHistogram(
+ error, WebBluetoothMacOSAPIs::
+ WEB_BLUETOOTH_MACOS_APIS_DID_DISCOVER_PRIMARY_SERVICES);
VLOG(1) << *this << ": Can't discover primary services: "
<< BluetoothAdapterMac::String(error);
return;
@@ -258,6 +262,9 @@ void BluetoothLowEnergyDeviceMac::DidDiscoverCharacteristics(
CBService* cb_service,
NSError* error) {
if (error) {
+ LogNSErrorToHistogram(
+ error, WebBluetoothMacOSAPIs::
+ WEB_BLUETOOTH_MACOS_APIS_DID_DISCOVER_CHARACTERISTICS);
// TODO(http://crbug.com/609320): Need to pass the error.
// TODO(http://crbug.com/609844): Decide what to do if discover failed
VLOG(1) << *this << ": Can't discover characteristics: "
@@ -337,6 +344,9 @@ void BluetoothLowEnergyDeviceMac::DidDiscoverDescriptors(
CBCharacteristic* cb_characteristic,
NSError* error) {
if (error) {
+ LogNSErrorToHistogram(
+ error, WebBluetoothMacOSAPIs::
+ WEB_BLUETOOTH_MACOS_APIS_DID_DISCOVER_DESCRIPTORS);
// TODO(http://crbug.com/609320): Need to pass the error.
// TODO(http://crbug.com/609844): Decide what to do if discover failed
VLOG(1) << *this << ": Can't discover descriptors: "
@@ -483,6 +493,9 @@ void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral(NSError* error) {
if (error) {
VLOG(1) << *this
<< ": Bluetooth error: " << BluetoothAdapterMac::String(error);
+ LogNSErrorToHistogram(
+ error, WebBluetoothMacOSAPIs::
+ WEB_BLUETOOTH_MACOS_APIS_DID_DISCONNECT_PERIPHERAL);
}
SetGattServicesDiscoveryComplete(false);
// Removing all services at once to ensure that calling GetGattService on

Powered by Google App Engine
This is Rietveld 408576698