| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // Handlers for notifications sent from the download thread and run on | 185 // Handlers for notifications sent from the download thread and run on |
| 186 // the UI thread. | 186 // the UI thread. |
| 187 void OnStartDownload(DownloadCreateInfo* info); | 187 void OnStartDownload(DownloadCreateInfo* info); |
| 188 void OnDownloadFinished(int id, int64 bytes_so_far); | 188 void OnDownloadFinished(int id, int64 bytes_so_far); |
| 189 | 189 |
| 190 // Download the URL. Called on the UI thread and forwarded to the | 190 // Download the URL. Called on the UI thread and forwarded to the |
| 191 // ResourceDispatcherHost on the IO thread. | 191 // ResourceDispatcherHost on the IO thread. |
| 192 void DownloadUrl(const GURL& url, | 192 void DownloadUrl(const GURL& url, |
| 193 const GURL& referrer, | 193 const GURL& referrer, |
| 194 const std::string& referrer_charset, | 194 const std::string& referrer_charset, |
| 195 const FilePath& save_file_path, |
| 195 int render_process_host_id, | 196 int render_process_host_id, |
| 196 int render_view_id, | 197 int render_view_id, |
| 197 URLRequestContextGetter* request_context_getter); | 198 URLRequestContextGetter* request_context_getter); |
| 198 | 199 |
| 199 // Run on the IO thread to initiate the download of a URL. | 200 // Run on the IO thread to initiate the download of a URL. |
| 200 void OnDownloadUrl(const GURL& url, | 201 void OnDownloadUrl(const GURL& url, |
| 201 const GURL& referrer, | 202 const GURL& referrer, |
| 202 const std::string& referrer_charset, | 203 const std::string& referrer_charset, |
| 204 const FilePath& save_file_path, |
| 203 int render_process_host_id, | 205 int render_process_host_id, |
| 204 int render_view_id, | 206 int render_view_id, |
| 205 URLRequestContextGetter* request_context_getter); | 207 URLRequestContextGetter* request_context_getter); |
| 206 | 208 |
| 207 // Called on the UI thread to remove a download item or manager. | 209 // Called on the UI thread to remove a download item or manager. |
| 208 void RemoveDownloadManager(DownloadManager* manager); | 210 void RemoveDownloadManager(DownloadManager* manager); |
| 209 void RemoveDownload(int id, DownloadManager* manager); | 211 void RemoveDownload(int id, DownloadManager* manager); |
| 210 | 212 |
| 211 #if !defined(OS_MACOSX) | 213 #if !defined(OS_MACOSX) |
| 212 // The open and show methods run on the file thread, which does not work on | 214 // The open and show methods run on the file thread, which does not work on |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // Used for progress updates on the UI thread, mapping download->id() to bytes | 283 // Used for progress updates on the UI thread, mapping download->id() to bytes |
| 282 // received so far. Written to by the file thread and read by the UI thread. | 284 // received so far. Written to by the file thread and read by the UI thread. |
| 283 typedef base::hash_map<int, int64> ProgressMap; | 285 typedef base::hash_map<int, int64> ProgressMap; |
| 284 ProgressMap ui_progress_; | 286 ProgressMap ui_progress_; |
| 285 Lock progress_lock_; | 287 Lock progress_lock_; |
| 286 | 288 |
| 287 DISALLOW_COPY_AND_ASSIGN(DownloadFileManager); | 289 DISALLOW_COPY_AND_ASSIGN(DownloadFileManager); |
| 288 }; | 290 }; |
| 289 | 291 |
| 290 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 292 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| OLD | NEW |