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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_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 | « device/bluetooth/bluetooth_low_energy_device_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8b56d51bb661cdeb732985d92f8b9f41feda4387..0db9ce10233571d642f9c29ee3050faecdf8b970 100644
--- a/device/bluetooth/bluetooth_low_energy_device_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm
@@ -390,13 +390,18 @@
return nullptr;
}
-void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral() {
+void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral(
+ BluetoothDevice::ConnectErrorCode error_code) {
SetGattServicesDiscoveryComplete(false);
// Removing all services at once to ensure that calling GetGattService on
// removed service in GattServiceRemoved returns null.
GattServiceMap gatt_services_swapped;
gatt_services_swapped.swap(gatt_services_);
gatt_services_swapped.clear();
- DCHECK(create_gatt_connection_error_callbacks_.empty());
- DidDisconnectGatt();
-}
+ if (create_gatt_connection_error_callbacks_.empty()) {
+ // TODO(http://crbug.com/585897): Need to pass the error.
+ DidDisconnectGatt();
+ } else {
+ DidFailToConnectGatt(error_code);
+ }
+}
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_device_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698