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

Unified Diff: device/bluetooth/bluetooth_adapter_mac.mm

Issue 2235313004: Revert of Bluetooth: mac: Crash while loging nil error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | device/bluetooth/bluetooth_low_energy_device_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter_mac.mm
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index d0f98c4478a38e00d131d24c68594e3934dcf4bf..dca907ffdeac4f616fb7be80f9b5869985590224 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -561,15 +561,13 @@
[low_energy_central_manager_ cancelPeripheralConnection:peripheral];
return;
}
+ VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
+ << ", error code: " << error.code;
BluetoothDevice::ConnectErrorCode error_code =
- BluetoothDevice::ConnectErrorCode::ERROR_FAILED;
- VLOG(1) << "Fail to connect to peripheral";
- if (error) {
- error_code = BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
- VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
- << ", error code: " << error.code
- << ", converted into: " << error_code;
- }
+ BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
+ VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
+ << ", error code: " << error.code
+ << ", converted into: " << error_code;
device_mac->DidFailToConnectGatt(error_code);
}
@@ -581,14 +579,11 @@
[low_energy_central_manager_ cancelPeripheralConnection:peripheral];
return;
}
- VLOG(1) << "Peripheral disconnected";
- if (error) {
- VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
- << ", error code: " << error.code;
- // TODO(http://crbug.com/585897): Need to pass the error to
- // DidDisconnectPeripheral().
- }
- device_mac->DidDisconnectPeripheral();
+ VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
+ << ", error code: " << error.code;
+ BluetoothDevice::ConnectErrorCode error_code =
+ BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
+ device_mac->DidDisconnectPeripheral(error_code);
}
BluetoothLowEnergyDeviceMac*
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_low_energy_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698