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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 private: | 114 private: |
115 // Open or Close the OS file handle. The file is opened in the constructor | 115 // Open or Close the OS file handle. The file is opened in the constructor |
116 // based on creation information passed to it, and automatically closed in | 116 // based on creation information passed to it, and automatically closed in |
117 // the destructor. | 117 // the destructor. |
118 void Close(); | 118 void Close(); |
119 bool Open(const char* open_mode); | 119 bool Open(const char* open_mode); |
120 | 120 |
121 // OS file handle for writing | 121 // OS file handle for writing |
122 FILE* file_; | 122 FILE* file_; |
123 | 123 |
| 124 // Source URL for the file being downloaded. |
| 125 GURL source_url_; |
| 126 |
| 127 // The URL where the download was initiated. |
| 128 GURL referrer_url_; |
| 129 |
124 // The unique identifier for this download, assigned at creation by | 130 // The unique identifier for this download, assigned at creation by |
125 // the DownloadFileManager for its internal record keeping. | 131 // the DownloadFileManager for its internal record keeping. |
126 int id_; | 132 int id_; |
127 | 133 |
128 // IDs for looking up the tab we are associated with. | 134 // IDs for looking up the tab we are associated with. |
129 int render_process_id_; | 135 int render_process_id_; |
130 int render_view_id_; | 136 int render_view_id_; |
131 | 137 |
132 // Handle for informing the ResourceDispatcherHost of a UI based cancel. | 138 // Handle for informing the ResourceDispatcherHost of a UI based cancel. |
133 int request_id_; | 139 int request_id_; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // Used for progress updates on the UI thread, mapping download->id() to bytes | 276 // Used for progress updates on the UI thread, mapping download->id() to bytes |
271 // received so far. Written to by the file thread and read by the UI thread. | 277 // received so far. Written to by the file thread and read by the UI thread. |
272 typedef base::hash_map<int, int64> ProgressMap; | 278 typedef base::hash_map<int, int64> ProgressMap; |
273 ProgressMap ui_progress_; | 279 ProgressMap ui_progress_; |
274 Lock progress_lock_; | 280 Lock progress_lock_; |
275 | 281 |
276 DISALLOW_COPY_AND_ASSIGN(DownloadFileManager); | 282 DISALLOW_COPY_AND_ASSIGN(DownloadFileManager); |
277 }; | 283 }; |
278 | 284 |
279 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 285 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
OLD | NEW |