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

Unified Diff: device/bluetooth/bluetooth_device_android.cc

Issue 2567903004: Replace ScopedVector/ScopedPtrHashMap with std::vector and std::unordered_map (Closed)
Patch Set: Mac bustage 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_device_android.cc
diff --git a/device/bluetooth/bluetooth_device_android.cc b/device/bluetooth/bluetooth_device_android.cc
index ce76d20b169b8667980d7833366732b7a95be885..6e474728319c5dd86b685413466b849ff0e6e173 100644
--- a/device/bluetooth/bluetooth_device_android.cc
+++ b/device/bluetooth/bluetooth_device_android.cc
@@ -245,18 +245,15 @@ void BluetoothDeviceAndroid::CreateGattRemoteService(
bluetooth_gatt_service_wrapper) { // BluetoothGattServiceWrapper
std::string instance_id_string =
base::android::ConvertJavaStringToUTF8(env, instance_id);
-
- if (gatt_services_.contains(instance_id_string))
+ if (base::ContainsKey(gatt_services_, instance_id_string))
return;
- BluetoothDevice::GattServiceMap::iterator service_iterator =
- gatt_services_.set(
- instance_id_string,
- BluetoothRemoteGattServiceAndroid::Create(
- GetAndroidAdapter(), this, bluetooth_gatt_service_wrapper,
- instance_id_string, j_device_));
-
- adapter_->NotifyGattServiceAdded(service_iterator->second);
+ auto service = BluetoothRemoteGattServiceAndroid::Create(
+ GetAndroidAdapter(), this, bluetooth_gatt_service_wrapper,
+ instance_id_string, j_device_);
+ auto insertion = gatt_services_.insert(
+ std::make_pair(instance_id_string, std::move(service)));
+ adapter_->NotifyGattServiceAdded(insertion.first->second.get());
}
BluetoothDeviceAndroid::BluetoothDeviceAndroid(BluetoothAdapterAndroid* adapter)

Powered by Google App Engine
This is Rietveld 408576698