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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_android.cc

Issue 2606823002: Remove base::ScopedPtrHashMap from device/. (Closed)
Patch Set: one last fix Created 4 years 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_remote_gatt_service_android.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_android.cc b/device/bluetooth/bluetooth_remote_gatt_service_android.cc
index 25087b733697c9bab9b56d0437bfcf121a425ae8..c7b20ad165a39424dfefc5fcb95cb7bd839b1d11 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_android.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service_android.cc
@@ -135,7 +135,7 @@ BluetoothRemoteGattServiceAndroid::GetCharacteristics() const {
EnsureCharacteristicsCreated();
std::vector<device::BluetoothRemoteGattCharacteristic*> characteristics;
for (const auto& map_iter : characteristics_)
- characteristics.push_back(map_iter.second);
+ characteristics.push_back(map_iter.second.get());
return characteristics;
}
@@ -152,7 +152,7 @@ BluetoothRemoteGattServiceAndroid::GetCharacteristic(
const auto& iter = characteristics_.find(identifier);
if (iter == characteristics_.end())
return nullptr;
- return iter->second;
+ return iter->second.get();
}
void BluetoothRemoteGattServiceAndroid::CreateGattRemoteCharacteristic(
@@ -166,13 +166,12 @@ void BluetoothRemoteGattServiceAndroid::CreateGattRemoteCharacteristic(
std::string instance_id_string =
base::android::ConvertJavaStringToUTF8(env, instance_id);
- DCHECK(!characteristics_.contains(instance_id_string));
+ DCHECK(characteristics_.find(instance_id_string) == characteristics_.end());
Reilly Grant (use Gerrit) 2016/12/28 22:48:01 !base::ContainsKey
Avi (use Gerrit) 2017/01/02 19:42:26 Done.
- characteristics_.set(
- instance_id_string,
+ characteristics_[instance_id_string] =
BluetoothRemoteGattCharacteristicAndroid::Create(
adapter_, this, instance_id_string,
- bluetooth_gatt_characteristic_wrapper, chrome_bluetooth_device));
+ bluetooth_gatt_characteristic_wrapper, chrome_bluetooth_device);
}
BluetoothRemoteGattServiceAndroid::BluetoothRemoteGattServiceAndroid(

Powered by Google App Engine
This is Rietveld 408576698