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

Unified Diff: device/bluetooth/bluetooth_adapter_win.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/bluetooth_adapter_win.h ('k') | device/bluetooth/bluetooth_adapter_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter_win.cc
diff --git a/device/bluetooth/bluetooth_adapter_win.cc b/device/bluetooth/bluetooth_adapter_win.cc
index 2a53da31796f06b4f4a33fae5ead03d671f98008..78424bd7a3eaf61a934c850aae79e3be25df9be8 100644
--- a/device/bluetooth/bluetooth_adapter_win.cc
+++ b/device/bluetooth/bluetooth_adapter_win.cc
@@ -228,7 +228,8 @@ void BluetoothAdapterWin::AdapterStateChanged(
}
void BluetoothAdapterWin::DevicesPolled(
- const ScopedVector<BluetoothTaskManagerWin::DeviceState>& devices) {
+ const std::vector<std::unique_ptr<BluetoothTaskManagerWin::DeviceState>>&
+ devices) {
DCHECK(thread_checker_.CalledOnValidThread());
// We are receiving a new list of all devices known to the system. Merge this
@@ -241,8 +242,8 @@ void BluetoothAdapterWin::DevicesPolled(
known_devices.insert(device.first);
DeviceAddressSet new_devices;
- for (auto iter = devices.begin(); iter != devices.end(); ++iter)
- new_devices.insert((*iter)->address);
+ for (const auto& device_state : devices)
+ new_devices.insert(device_state->address);
// Process device removal first.
DeviceAddressSet removed_devices =
@@ -260,8 +261,7 @@ void BluetoothAdapterWin::DevicesPolled(
base::STLSetDifference<DeviceAddressSet>(new_devices, known_devices);
DeviceAddressSet changed_devices =
base::STLSetIntersection<DeviceAddressSet>(known_devices, new_devices);
- for (auto iter = devices.begin(); iter != devices.end(); ++iter) {
- BluetoothTaskManagerWin::DeviceState* device_state = (*iter);
+ for (const auto& device_state : devices) {
if (added_devices.find(device_state->address) != added_devices.end()) {
BluetoothDeviceWin* device_win =
new BluetoothDeviceWin(this, *device_state, ui_task_runner_,
« no previous file with comments | « device/bluetooth/bluetooth_adapter_win.h ('k') | device/bluetooth/bluetooth_adapter_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698