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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 2907033002: Bluetooth: macOS: Making code to get mac descriptors more coherent (Closed)
Patch Set: Merge Created 3 years, 6 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_remote_gatt_service_mac.h » ('j') | 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 dd93a2abce3104ef4673c3279cfd2ea3547412e2..41dcd06bdf94758afbbda13cea215b58c3984104 100644
--- a/device/bluetooth/bluetooth_low_energy_device_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm
@@ -490,15 +490,13 @@ BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattCharacteristicMac(
BluetoothRemoteGattDescriptorMac*
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattDescriptorMac(
CBDescriptor* cb_descriptor) const {
- CBCharacteristic* cb_characteristic = cb_descriptor.characteristic;
- BluetoothRemoteGattServiceMac* gatt_service =
- GetBluetoothRemoteGattServiceMac(cb_characteristic.service);
- DCHECK(gatt_service);
- BluetoothRemoteGattCharacteristicMac* gatt_characteristic =
- gatt_service->GetBluetoothRemoteGattCharacteristicMac(cb_characteristic);
- DCHECK(gatt_characteristic);
- return gatt_characteristic->GetBluetoothRemoteGattDescriptorMac(
- cb_descriptor);
+ CBService* cb_service = [[cb_descriptor characteristic] service];
+ BluetoothRemoteGattServiceMac* gatt_service_mac =
+ GetBluetoothRemoteGattServiceMac(cb_service);
+ if (!gatt_service_mac) {
+ return nullptr;
+ }
+ return gatt_service_mac->GetBluetoothRemoteGattDescriptorMac(cb_descriptor);
}
void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral(NSError* error) {
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_remote_gatt_service_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698