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

Unified Diff: device/bluetooth/bluetooth_device_android.cc

Issue 1411183003: bluetooth: android: Clean up BluetoothRemoteGattServiceAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-getid-
Patch Set: Created 5 years, 2 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_device_android.cc
diff --git a/device/bluetooth/bluetooth_device_android.cc b/device/bluetooth/bluetooth_device_android.cc
index fccd24fb682780fa15fd134fae97db342178aeca..c71ee5c7ad9b238a796d88b0df2295ebc0d9f011 100644
--- a/device/bluetooth/bluetooth_device_android.cc
+++ b/device/bluetooth/bluetooth_device_android.cc
@@ -236,15 +236,16 @@ void BluetoothDeviceAndroid::CreateGattRemoteService(
if (gatt_services_.contains(instanceIdString))
return;
- BluetoothRemoteGattServiceAndroid* service =
- BluetoothRemoteGattServiceAndroid::Create(
- GetAdapter(), this, bluetooth_gatt_service_wrapper, instanceIdString);
-
- gatt_services_.set(instanceIdString,
- make_scoped_ptr<BluetoothGattService>(service));
+ BluetoothDevice::GattServiceMap::iterator service_iterator =
ortuno 2015/10/26 21:36:26 nit: can you use auto?
scheib 2015/10/26 21:55:47 This is a grey area. Style guide recommends being
ortuno 2015/10/26 22:23:34 hmm not sure how BluetoothDevice::GattServiceMap m
+ gatt_services_.set(
+ instanceIdString,
+ make_scoped_ptr<BluetoothRemoteGattServiceAndroid>(
+ BluetoothRemoteGattServiceAndroid::Create(
+ GetAdapter(), this, bluetooth_gatt_service_wrapper,
+ instanceIdString)));
FOR_EACH_OBSERVER(BluetoothAdapter::Observer, GetAdapter()->GetObservers(),
- GattServiceAdded(adapter_, this, service));
+ GattServiceAdded(adapter_, this, service_iterator->second));
}
BluetoothDeviceAndroid::BluetoothDeviceAndroid(BluetoothAdapterAndroid* adapter)

Powered by Google App Engine
This is Rietveld 408576698