| 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 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // Render process(stop serializing DOM and sending | 48 // Render process(stop serializing DOM and sending |
| 49 // data) | 49 // data) |
| 50 // | 50 // |
| 51 // | 51 // |
| 52 // The SaveFileManager tracks saving requests, mapping from a save ID | 52 // The SaveFileManager tracks saving requests, mapping from a save ID |
| 53 // (unique integer created in the IO thread) to the SavePackage for the | 53 // (unique integer created in the IO thread) to the SavePackage for the |
| 54 // tab where the saving job was initiated. In the event of a tab closure | 54 // tab where the saving job was initiated. In the event of a tab closure |
| 55 // during saving, the SavePackage will notice the SaveFileManage to | 55 // during saving, the SavePackage will notice the SaveFileManage to |
| 56 // cancel all SaveFile job. | 56 // cancel all SaveFile job. |
| 57 | 57 |
| 58 #ifndef CHROME_BROWSER_SAVE_FILE_MANAGER_H__ | 58 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H__ |
| 59 #define CHROME_BROWSER_SAVE_FILE_MANAGER_H__ | 59 #define CHROME_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H__ |
| 60 | 60 |
| 61 #include <utility> | 61 #include <utility> |
| 62 | 62 |
| 63 #include "base/basictypes.h" | 63 #include "base/basictypes.h" |
| 64 #include "base/hash_tables.h" | 64 #include "base/hash_tables.h" |
| 65 #include "base/ref_counted.h" | 65 #include "base/ref_counted.h" |
| 66 #include "base/thread.h" | 66 #include "base/thread.h" |
| 67 #include "chrome/browser/save_types.h" | 67 #include "chrome/browser/download/save_types.h" |
| 68 | 68 |
| 69 class GURL; | 69 class GURL; |
| 70 class SaveFile; | 70 class SaveFile; |
| 71 class SavePackage; | 71 class SavePackage; |
| 72 class MessageLoop; | 72 class MessageLoop; |
| 73 class ResourceDispatcherHost; | 73 class ResourceDispatcherHost; |
| 74 class Task; | 74 class Task; |
| 75 class URLRequestContext; | 75 class URLRequestContext; |
| 76 | 76 |
| 77 class SaveFileManager | 77 class SaveFileManager |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // use a hashmap to map the tab id (we actually use render_process_id) to the | 252 // use a hashmap to map the tab id (we actually use render_process_id) to the |
| 253 // hashmap since it is possible to save same URL in different tab at | 253 // hashmap since it is possible to save same URL in different tab at |
| 254 // same time. | 254 // same time. |
| 255 typedef base::hash_map<std::wstring, SavePackage*> StartingRequestsMap; | 255 typedef base::hash_map<std::wstring, SavePackage*> StartingRequestsMap; |
| 256 typedef base::hash_map<int, StartingRequestsMap> TabToStartingRequestsMap; | 256 typedef base::hash_map<int, StartingRequestsMap> TabToStartingRequestsMap; |
| 257 TabToStartingRequestsMap tab_starting_requests_; | 257 TabToStartingRequestsMap tab_starting_requests_; |
| 258 | 258 |
| 259 DISALLOW_EVIL_CONSTRUCTORS(SaveFileManager); | 259 DISALLOW_EVIL_CONSTRUCTORS(SaveFileManager); |
| 260 }; | 260 }; |
| 261 | 261 |
| 262 #endif // CHROME_BROWSER_SAVE_FILE_MANAGER_H__ | 262 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H__ |
| OLD | NEW |