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

Unified Diff: device/bluetooth/bluetooth_adapter_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_adapter_android.cc
diff --git a/device/bluetooth/bluetooth_adapter_android.cc b/device/bluetooth/bluetooth_adapter_android.cc
index 41228bb635bae3ac24c26c8b50bb22d539a22013..2155707c059d98e8605b42c16a4bd15e95fb272c 100644
--- a/device/bluetooth/bluetooth_adapter_android.cc
+++ b/device/bluetooth/bluetooth_adapter_android.cc
@@ -183,7 +183,7 @@ void BluetoothAdapterAndroid::CreateOrUpdateDeviceOnScan(
const JavaParamRef<jobjectArray>& advertised_uuids, // Java Type: String[]
int32_t tx_power) {
std::string device_address = ConvertJavaStringToUTF8(env, address);
- DevicesMap::const_iterator iter = devices_.find(device_address);
+ auto iter = devices_.find(device_address);
bool is_new_device = false;
std::unique_ptr<BluetoothDeviceAndroid> device_android_owner;
@@ -197,7 +197,7 @@ void BluetoothAdapterAndroid::CreateOrUpdateDeviceOnScan(
device_android = device_android_owner.get();
} else {
// Existing device.
- device_android = static_cast<BluetoothDeviceAndroid*>(iter->second);
+ device_android = static_cast<BluetoothDeviceAndroid*>(iter->second.get());
}
DCHECK(device_android);
@@ -219,7 +219,7 @@ void BluetoothAdapterAndroid::CreateOrUpdateDeviceOnScan(
tx_power == INT32_MIN ? nullptr : &clamped_tx_power);
if (is_new_device) {
- devices_.add(device_address, std::move(device_android_owner));
+ devices_[device_address] = std::move(device_android_owner);
for (auto& observer : observers_)
observer.DeviceAdded(this, device_android);
} else {

Powered by Google App Engine
This is Rietveld 408576698