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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 2904363002: bluetooth: macOS: Removing intermediate methods in BluetoothRemoteServiceMac (Closed)
Patch Set: Created 3 years, 7 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
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 8e730550b4f26c2f9ad01d7dd1a405770ad60f57..ee66fbd4c6c676458333c5ab0232cf3e6eea5d3d 100644
--- a/device/bluetooth/bluetooth_low_energy_device_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm
@@ -309,28 +309,28 @@ void BluetoothLowEnergyDeviceMac::DidModifyServices(
void BluetoothLowEnergyDeviceMac::DidUpdateValue(
CBCharacteristic* characteristic,
NSError* error) {
- BluetoothRemoteGattServiceMac* gatt_service =
- GetBluetoothRemoteGattServiceMac(characteristic.service);
- DCHECK(gatt_service);
- gatt_service->DidUpdateValue(characteristic, error);
+ BluetoothRemoteGattCharacteristicMac* gatt_characteristic_mac =
+ GetBluetoothRemoteGattCharacteristicMac(characteristic);
+ DCHECK(gatt_characteristic_mac);
+ gatt_characteristic_mac->DidUpdateValue(error);
}
void BluetoothLowEnergyDeviceMac::DidWriteValue(
CBCharacteristic* characteristic,
NSError* error) {
- BluetoothRemoteGattServiceMac* gatt_service =
- GetBluetoothRemoteGattServiceMac(characteristic.service);
- DCHECK(gatt_service);
- gatt_service->DidWriteValue(characteristic, error);
+ BluetoothRemoteGattCharacteristicMac* gatt_characteristic_mac =
+ GetBluetoothRemoteGattCharacteristicMac(characteristic);
+ DCHECK(gatt_characteristic_mac);
+ gatt_characteristic_mac->DidWriteValue(error);
}
void BluetoothLowEnergyDeviceMac::DidUpdateNotificationState(
CBCharacteristic* characteristic,
NSError* error) {
- BluetoothRemoteGattServiceMac* gatt_service =
- GetBluetoothRemoteGattServiceMac(characteristic.service);
- DCHECK(gatt_service);
- gatt_service->DidUpdateNotificationState(characteristic, error);
+ BluetoothRemoteGattCharacteristicMac* gatt_characteristic_mac =
+ GetBluetoothRemoteGattCharacteristicMac(characteristic);
+ DCHECK(gatt_characteristic_mac);
+ gatt_characteristic_mac->DidUpdateNotificationState(error);
}
void BluetoothLowEnergyDeviceMac::DidDiscoverDescriptors(
@@ -463,6 +463,19 @@ BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattServiceMac(
return nullptr;
}
+device::BluetoothRemoteGattCharacteristicMac*
+BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattCharacteristicMac(
+ CBCharacteristic* cb_characteristic) const {
+ CBService* cb_service = [cb_characteristic service];
+ device::BluetoothRemoteGattServiceMac* gatt_service_mac =
+ GetBluetoothRemoteGattServiceMac(cb_service);
+ if (!gatt_service_mac) {
+ return nullptr;
+ }
+ return gatt_service_mac->GetBluetoothRemoteGattCharacteristicMac(
+ cb_characteristic);
+}
+
device::BluetoothRemoteGattDescriptorMac*
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattDescriptorMac(
CBDescriptor* cb_descriptor) const {
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_device_mac.h ('k') | device/bluetooth/bluetooth_remote_gatt_service_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698