| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Objects that handle file operations for downloads, on the download thread. | 5 // Objects that handle file operations for downloads, on the download thread. |
| 6 // | 6 // |
| 7 // The DownloadFileManager owns a set of DownloadFile objects, each of which | 7 // The DownloadFileManager owns a set of DownloadFile objects, each of which |
| 8 // represent one in progress download and performs the disk IO for that | 8 // represent one in progress download and performs the disk IO for that |
| 9 // download. The DownloadFileManager itself is a singleton object owned by the | 9 // download. The DownloadFileManager itself is a singleton object owned by the |
| 10 // ResourceDispatcherHost. | 10 // ResourceDispatcherHost. |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 // Handler for shell operations sent from the UI to the download thread. | 199 // Handler for shell operations sent from the UI to the download thread. |
| 200 void OnShowDownloadInShell(const FilePath& full_path); | 200 void OnShowDownloadInShell(const FilePath& full_path); |
| 201 // Handler to open or execute a downloaded file. | 201 // Handler to open or execute a downloaded file. |
| 202 void OnOpenDownloadInShell(const FilePath& full_path, | 202 void OnOpenDownloadInShell(const FilePath& full_path, |
| 203 const GURL& url, | 203 const GURL& url, |
| 204 gfx::NativeView parent_window); | 204 gfx::NativeView parent_window); |
| 205 | 205 |
| 206 // The download manager has provided a final name for a download. Sent from | 206 // The download manager has provided a final name for a download. Sent from |
| 207 // the UI thread and run on the download thread. | 207 // the UI thread and run on the download thread. |
| 208 void OnFinalDownloadName(int id, const FilePath& full_path); | 208 void OnFinalDownloadName(int id, const FilePath& full_path, |
| 209 DownloadManager* download_manager); |
| 209 | 210 |
| 210 // Timer notifications. | 211 // Timer notifications. |
| 211 void UpdateInProgressDownloads(); | 212 void UpdateInProgressDownloads(); |
| 212 | 213 |
| 213 MessageLoop* file_loop() const { return file_loop_; } | 214 MessageLoop* file_loop() const { return file_loop_; } |
| 214 | 215 |
| 215 // Called by the download manager to delete non validated dangerous downloads. | 216 // Called by the download manager to delete non validated dangerous downloads. |
| 216 static void DeleteFile(const FilePath& path); | 217 static void DeleteFile(const FilePath& path); |
| 217 | 218 |
| 218 private: | 219 private: |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // Used for progress updates on the UI thread, mapping download->id() to bytes | 270 // Used for progress updates on the UI thread, mapping download->id() to bytes |
| 270 // received so far. Written to by the file thread and read by the UI thread. | 271 // received so far. Written to by the file thread and read by the UI thread. |
| 271 typedef base::hash_map<int, int64> ProgressMap; | 272 typedef base::hash_map<int, int64> ProgressMap; |
| 272 ProgressMap ui_progress_; | 273 ProgressMap ui_progress_; |
| 273 Lock progress_lock_; | 274 Lock progress_lock_; |
| 274 | 275 |
| 275 DISALLOW_COPY_AND_ASSIGN(DownloadFileManager); | 276 DISALLOW_COPY_AND_ASSIGN(DownloadFileManager); |
| 276 }; | 277 }; |
| 277 | 278 |
| 278 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 279 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| OLD | NEW |