| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 void OnDownloadUrl(const GURL& url, | 194 void OnDownloadUrl(const GURL& url, |
| 195 const GURL& referrer, | 195 const GURL& referrer, |
| 196 int render_process_host_id, | 196 int render_process_host_id, |
| 197 int render_view_id, | 197 int render_view_id, |
| 198 URLRequestContext* request_context); | 198 URLRequestContext* request_context); |
| 199 | 199 |
| 200 // Called on the UI thread to remove a download item or manager. | 200 // Called on the UI thread to remove a download item or manager. |
| 201 void RemoveDownloadManager(DownloadManager* manager); | 201 void RemoveDownloadManager(DownloadManager* manager); |
| 202 void RemoveDownload(int id, DownloadManager* manager); | 202 void RemoveDownload(int id, DownloadManager* manager); |
| 203 | 203 |
| 204 #if !defined(OS_MACOSX) |
| 205 // The open and show methods run on the file thread, which does not work on |
| 206 // Mac OS X (which uses the UI thread for opens). |
| 207 |
| 204 // Handler for shell operations sent from the UI to the download thread. | 208 // Handler for shell operations sent from the UI to the download thread. |
| 205 void OnShowDownloadInShell(const FilePath& full_path); | 209 void OnShowDownloadInShell(const FilePath& full_path); |
| 210 |
| 206 // Handler to open or execute a downloaded file. | 211 // Handler to open or execute a downloaded file. |
| 207 void OnOpenDownloadInShell(const FilePath& full_path, | 212 void OnOpenDownloadInShell(const FilePath& full_path, |
| 208 const GURL& url, | 213 const GURL& url, |
| 209 gfx::NativeView parent_window); | 214 gfx::NativeView parent_window); |
| 215 #endif |
| 210 | 216 |
| 211 // The download manager has provided a final name for a download. Sent from | 217 // The download manager has provided a final name for a download. Sent from |
| 212 // the UI thread and run on the download thread. | 218 // the UI thread and run on the download thread. |
| 213 void OnFinalDownloadName(int id, const FilePath& full_path, | 219 void OnFinalDownloadName(int id, const FilePath& full_path, |
| 214 DownloadManager* download_manager); | 220 DownloadManager* download_manager); |
| 215 | 221 |
| 216 // Timer notifications. | 222 // Timer notifications. |
| 217 void UpdateInProgressDownloads(); | 223 void UpdateInProgressDownloads(); |
| 218 | 224 |
| 219 MessageLoop* file_loop() const { return file_loop_; } | 225 MessageLoop* file_loop() const { return file_loop_; } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 // Used for progress updates on the UI thread, mapping download->id() to bytes | 281 // Used for progress updates on the UI thread, mapping download->id() to bytes |
| 276 // received so far. Written to by the file thread and read by the UI thread. | 282 // received so far. Written to by the file thread and read by the UI thread. |
| 277 typedef base::hash_map<int, int64> ProgressMap; | 283 typedef base::hash_map<int, int64> ProgressMap; |
| 278 ProgressMap ui_progress_; | 284 ProgressMap ui_progress_; |
| 279 Lock progress_lock_; | 285 Lock progress_lock_; |
| 280 | 286 |
| 281 DISALLOW_COPY_AND_ASSIGN(DownloadFileManager); | 287 DISALLOW_COPY_AND_ASSIGN(DownloadFileManager); |
| 282 }; | 288 }; |
| 283 | 289 |
| 284 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 290 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| OLD | NEW |