OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/storage_monitor/volume_mount_watcher_win.h" | 5 #include "chrome/browser/storage_monitor/volume_mount_watcher_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <dbt.h> | 8 #include <dbt.h> |
9 #include <fileapi.h> | 9 #include <fileapi.h> |
10 | 10 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 366 } |
367 } | 367 } |
368 | 368 |
369 void VolumeMountWatcherWin::SetNotifications( | 369 void VolumeMountWatcherWin::SetNotifications( |
370 StorageMonitor::Receiver* notifications) { | 370 StorageMonitor::Receiver* notifications) { |
371 notifications_ = notifications; | 371 notifications_ = notifications; |
372 } | 372 } |
373 | 373 |
374 VolumeMountWatcherWin::~VolumeMountWatcherWin() { | 374 VolumeMountWatcherWin::~VolumeMountWatcherWin() { |
375 weak_factory_.InvalidateWeakPtrs(); | 375 weak_factory_.InvalidateWeakPtrs(); |
| 376 device_info_worker_pool_->Shutdown(); |
376 } | 377 } |
377 | 378 |
378 void VolumeMountWatcherWin::HandleDeviceAttachEventOnUIThread( | 379 void VolumeMountWatcherWin::HandleDeviceAttachEventOnUIThread( |
379 const base::FilePath& device_path, | 380 const base::FilePath& device_path, |
380 const MountPointInfo& info) { | 381 const MountPointInfo& info) { |
381 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 382 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
382 | 383 |
383 device_metadata_[device_path.value()] = info; | 384 device_metadata_[device_path.value()] = info; |
384 | 385 |
385 DeviceCheckComplete(device_path); | 386 DeviceCheckComplete(device_path); |
(...skipping 21 matching lines...) Expand all Loading... |
407 // If the device isn't type removable (like a CD), it won't be there. | 408 // If the device isn't type removable (like a CD), it won't be there. |
408 if (device_info == device_metadata_.end()) | 409 if (device_info == device_metadata_.end()) |
409 return; | 410 return; |
410 | 411 |
411 if (notifications_) | 412 if (notifications_) |
412 notifications_->ProcessDetach(device_info->second.device_id); | 413 notifications_->ProcessDetach(device_info->second.device_id); |
413 device_metadata_.erase(device_info); | 414 device_metadata_.erase(device_info); |
414 } | 415 } |
415 | 416 |
416 } // namespace chrome | 417 } // namespace chrome |
OLD | NEW |