| 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 #ifndef CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ | 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ |
| 6 #define CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ | 6 #define CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // devices freeze workers trying to get device info, resulting in | 93 // devices freeze workers trying to get device info, resulting in |
| 94 // shutdown hangs. | 94 // shutdown hangs. |
| 95 scoped_refptr<base::SequencedWorkerPool> device_info_worker_pool_; | 95 scoped_refptr<base::SequencedWorkerPool> device_info_worker_pool_; |
| 96 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 96 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 friend class test::TestVolumeMountWatcherWin; | 99 friend class test::TestVolumeMountWatcherWin; |
| 100 | 100 |
| 101 // Key: Mass storage device mount point. | 101 // Key: Mass storage device mount point. |
| 102 // Value: Mass storage device metadata. | 102 // Value: Mass storage device metadata. |
| 103 typedef std::map<base::string16, StorageInfo> MountPointDeviceMetadataMap; | 103 typedef std::map<base::FilePath, StorageInfo> MountPointDeviceMetadataMap; |
| 104 | 104 |
| 105 // Maintain a set of device attribute check calls in-flight. Only accessed | 105 // Maintain a set of device attribute check calls in-flight. Only accessed |
| 106 // on the UI thread. This is to try and prevent the same device from | 106 // on the UI thread. This is to try and prevent the same device from |
| 107 // occupying our worker pool in case of windows API call hangs. | 107 // occupying our worker pool in case of windows API call hangs. |
| 108 std::set<base::FilePath> pending_device_checks_; | 108 std::set<base::FilePath> pending_device_checks_; |
| 109 | 109 |
| 110 // A map from device mount point to device metadata. Only accessed on the UI | 110 // A map from device mount point to device metadata. Only accessed on the UI |
| 111 // thread. | 111 // thread. |
| 112 MountPointDeviceMetadataMap device_metadata_; | 112 MountPointDeviceMetadataMap device_metadata_; |
| 113 | 113 |
| 114 base::WeakPtrFactory<VolumeMountWatcherWin> weak_factory_; | 114 base::WeakPtrFactory<VolumeMountWatcherWin> weak_factory_; |
| 115 | 115 |
| 116 // The notifications object to use to signal newly attached volumes. Only | 116 // The notifications object to use to signal newly attached volumes. Only |
| 117 // removable devices will be notified. | 117 // removable devices will be notified. |
| 118 StorageMonitor::Receiver* notifications_; | 118 StorageMonitor::Receiver* notifications_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(VolumeMountWatcherWin); | 120 DISALLOW_COPY_AND_ASSIGN(VolumeMountWatcherWin); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace chrome | 123 } // namespace chrome |
| 124 | 124 |
| 125 #endif // CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ | 125 #endif // CHROME_BROWSER_STORAGE_MONITOR_VOLUME_MOUNT_WATCHER_WIN_H_ |
| OLD | NEW |