| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/storage_monitor/volume_mount_watcher_win.h" | 5 #include "components/storage_monitor/volume_mount_watcher_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 device_info_task_runner_.get(), FROM_HERE, GetAttachedDevicesCallback(), | 365 device_info_task_runner_.get(), FROM_HERE, GetAttachedDevicesCallback(), |
| 366 base::Bind(&VolumeMountWatcherWin::AddDevicesOnUIThread, | 366 base::Bind(&VolumeMountWatcherWin::AddDevicesOnUIThread, |
| 367 weak_factory_.GetWeakPtr())); | 367 weak_factory_.GetWeakPtr())); |
| 368 } | 368 } |
| 369 | 369 |
| 370 void VolumeMountWatcherWin::AddDevicesOnUIThread( | 370 void VolumeMountWatcherWin::AddDevicesOnUIThread( |
| 371 std::vector<base::FilePath> removable_devices) { | 371 std::vector<base::FilePath> removable_devices) { |
| 372 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 372 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 373 | 373 |
| 374 for (size_t i = 0; i < removable_devices.size(); i++) { | 374 for (size_t i = 0; i < removable_devices.size(); i++) { |
| 375 if (ContainsKey(pending_device_checks_, removable_devices[i])) | 375 if (base::ContainsKey(pending_device_checks_, removable_devices[i])) |
| 376 continue; | 376 continue; |
| 377 pending_device_checks_.insert(removable_devices[i]); | 377 pending_device_checks_.insert(removable_devices[i]); |
| 378 device_info_task_runner_->PostTask( | 378 device_info_task_runner_->PostTask( |
| 379 FROM_HERE, | 379 FROM_HERE, |
| 380 base::Bind(&VolumeMountWatcherWin::RetrieveInfoForDeviceAndAdd, | 380 base::Bind(&VolumeMountWatcherWin::RetrieveInfoForDeviceAndAdd, |
| 381 removable_devices[i], GetDeviceDetailsCallback(), | 381 removable_devices[i], GetDeviceDetailsCallback(), |
| 382 weak_factory_.GetWeakPtr())); | 382 weak_factory_.GetWeakPtr())); |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 | 385 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 callback.Run(StorageMonitor::EJECT_FAILURE); | 547 callback.Run(StorageMonitor::EJECT_FAILURE); |
| 548 return; | 548 return; |
| 549 } | 549 } |
| 550 | 550 |
| 551 device_info_task_runner_->PostTask( | 551 device_info_task_runner_->PostTask( |
| 552 FROM_HERE, base::Bind(&EjectDeviceInThreadPool, device, callback, | 552 FROM_HERE, base::Bind(&EjectDeviceInThreadPool, device, callback, |
| 553 device_info_task_runner_, 0)); | 553 device_info_task_runner_, 0)); |
| 554 } | 554 } |
| 555 | 555 |
| 556 } // namespace storage_monitor | 556 } // namespace storage_monitor |
| OLD | NEW |