| 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
|
|
|