| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 saving files, on the file thread. | 5 // Objects that handle file operations for saving files, on the file thread. |
| 6 // | 6 // |
| 7 // The SaveFileManager owns a set of SaveFile objects, each of which connects | 7 // The SaveFileManager owns a set of SaveFile objects, each of which connects |
| 8 // with a SaveItem object which belongs to one SavePackage and runs on the file | 8 // with a SaveItem object which belongs to one SavePackage and runs on the file |
| 9 // thread for saving data in order to avoid disk activity on either network IO | 9 // thread for saving data in order to avoid disk activity on either network IO |
| 10 // thread or the UI thread. It coordinates the notifications from the network | 10 // thread or the UI thread. It coordinates the notifications from the network |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // Deletes a specified file on the file thread. | 207 // Deletes a specified file on the file thread. |
| 208 void OnDeleteDirectoryOrFile(const FilePath& full_path, bool is_dir); | 208 void OnDeleteDirectoryOrFile(const FilePath& full_path, bool is_dir); |
| 209 | 209 |
| 210 // Notifications sent from the UI thread and run on the IO thread | 210 // Notifications sent from the UI thread and run on the IO thread |
| 211 | 211 |
| 212 // Initiates a request for URL to be saved. | 212 // Initiates a request for URL to be saved. |
| 213 void OnSaveURL(const GURL& url, | 213 void OnSaveURL(const GURL& url, |
| 214 const GURL& referrer, | 214 const GURL& referrer, |
| 215 int render_process_host_id, | 215 int render_process_host_id, |
| 216 int render_view_id, | 216 int render_view_id, |
| 217 const FilePath& default_download_dir, |
| 217 const content::ResourceContext* context); | 218 const content::ResourceContext* context); |
| 218 // Handler for a notification sent to the IO thread for generating save id. | 219 // Handler for a notification sent to the IO thread for generating save id. |
| 219 void OnRequireSaveJobFromOtherSource(SaveFileCreateInfo* info); | 220 void OnRequireSaveJobFromOtherSource(SaveFileCreateInfo* info); |
| 220 // Call ResourceDispatcherHost's CancelRequest method to execute cancel | 221 // Call ResourceDispatcherHost's CancelRequest method to execute cancel |
| 221 // action in the IO thread. | 222 // action in the IO thread. |
| 222 void ExecuteCancelSaveRequest(int render_process_id, int request_id); | 223 void ExecuteCancelSaveRequest(int render_process_id, int request_id); |
| 223 | 224 |
| 224 // Unique ID for the next SaveFile object. | 225 // Unique ID for the next SaveFile object. |
| 225 int next_id_; | 226 int next_id_; |
| 226 | 227 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 246 // hashmap since it is possible to save same URL in different tab at | 247 // hashmap since it is possible to save same URL in different tab at |
| 247 // same time. | 248 // same time. |
| 248 typedef base::hash_map<std::string, SavePackage*> StartingRequestsMap; | 249 typedef base::hash_map<std::string, SavePackage*> StartingRequestsMap; |
| 249 typedef base::hash_map<int, StartingRequestsMap> TabToStartingRequestsMap; | 250 typedef base::hash_map<int, StartingRequestsMap> TabToStartingRequestsMap; |
| 250 TabToStartingRequestsMap tab_starting_requests_; | 251 TabToStartingRequestsMap tab_starting_requests_; |
| 251 | 252 |
| 252 DISALLOW_COPY_AND_ASSIGN(SaveFileManager); | 253 DISALLOW_COPY_AND_ASSIGN(SaveFileManager); |
| 253 }; | 254 }; |
| 254 | 255 |
| 255 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H__ | 256 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H__ |
| OLD | NEW |