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

Side by Side Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 2221353002: Bluetooth: mac: Crash while loging nil error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral(BluetoothDevice::ConnectErrorCode) 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 unified diff | Download patch
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_device_mac.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h" 5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h"
6 6
7 #import <CoreFoundation/CoreFoundation.h> 7 #import <CoreFoundation/CoreFoundation.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 it != gatt_services_.end(); ++it) { 383 it != gatt_services_.end(); ++it) {
384 device::BluetoothRemoteGattService* gatt_service = it->second; 384 device::BluetoothRemoteGattService* gatt_service = it->second;
385 device::BluetoothRemoteGattServiceMac* gatt_service_mac = 385 device::BluetoothRemoteGattServiceMac* gatt_service_mac =
386 static_cast<BluetoothRemoteGattServiceMac*>(gatt_service); 386 static_cast<BluetoothRemoteGattServiceMac*>(gatt_service);
387 if (gatt_service_mac->GetService() == cb_service) 387 if (gatt_service_mac->GetService() == cb_service)
388 return gatt_service_mac; 388 return gatt_service_mac;
389 } 389 }
390 return nullptr; 390 return nullptr;
391 } 391 }
392 392
393 void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral( 393 void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral() {
394 BluetoothDevice::ConnectErrorCode error_code) {
395 SetGattServicesDiscoveryComplete(false); 394 SetGattServicesDiscoveryComplete(false);
396 // Removing all services at once to ensure that calling GetGattService on 395 // Removing all services at once to ensure that calling GetGattService on
397 // removed service in GattServiceRemoved returns null. 396 // removed service in GattServiceRemoved returns null.
398 GattServiceMap gatt_services_swapped; 397 GattServiceMap gatt_services_swapped;
399 gatt_services_swapped.swap(gatt_services_); 398 gatt_services_swapped.swap(gatt_services_);
400 gatt_services_swapped.clear(); 399 gatt_services_swapped.clear();
401 if (create_gatt_connection_error_callbacks_.empty()) { 400 DCHECK(create_gatt_connection_error_callbacks_.empty());
402 // TODO(http://crbug.com/585897): Need to pass the error. 401 DidDisconnectGatt();
403 DidDisconnectGatt();
404 } else {
405 DidFailToConnectGatt(error_code);
406 }
407 } 402 }
OLDNEW
« 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