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

Unified Diff: device/bluetooth/test/mock_bluetooth_adapter.cc

Issue 2614753004: Remove ScopedVector from bluetooth. (Closed)
Patch Set: last win bits Created 3 years, 11 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
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_adapter.h ('k') | device/bluetooth/test/mock_bluetooth_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/mock_bluetooth_adapter.cc
diff --git a/device/bluetooth/test/mock_bluetooth_adapter.cc b/device/bluetooth/test/mock_bluetooth_adapter.cc
index 2667650f40bf97e3f6678254e9593f482b1f128c..d8eed43ac141e17854993b619ccc5bce1edf45af 100644
--- a/device/bluetooth/test/mock_bluetooth_adapter.cc
+++ b/device/bluetooth/test/mock_bluetooth_adapter.cc
@@ -72,8 +72,8 @@ std::unique_ptr<MockBluetoothDevice> MockBluetoothAdapter::RemoveMockDevice(
if ((*it)->GetAddress() != address) {
continue;
}
- std::unique_ptr<MockBluetoothDevice> removed_device(*it);
- mock_devices_.weak_erase(it);
+ std::unique_ptr<MockBluetoothDevice> removed_device = std::move(*it);
+ mock_devices_.erase(it);
return removed_device;
}
return nullptr;
@@ -81,16 +81,16 @@ std::unique_ptr<MockBluetoothDevice> MockBluetoothAdapter::RemoveMockDevice(
BluetoothAdapter::ConstDeviceList MockBluetoothAdapter::GetConstMockDevices() {
BluetoothAdapter::ConstDeviceList devices;
- for (auto* it : mock_devices_) {
- devices.push_back(it);
+ for (const auto& it : mock_devices_) {
+ devices.push_back(it.get());
}
return devices;
}
BluetoothAdapter::DeviceList MockBluetoothAdapter::GetMockDevices() {
BluetoothAdapter::DeviceList devices;
- for (auto* it : mock_devices_) {
- devices.push_back(it);
+ for (const auto& it : mock_devices_) {
+ devices.push_back(it.get());
}
return devices;
}
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_adapter.h ('k') | device/bluetooth/test/mock_bluetooth_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698