OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // | 50 // |
51 // | 51 // |
52 // The SaveFileManager tracks saving requests, mapping from a save ID (unique | 52 // The SaveFileManager tracks saving requests, mapping from a save ID (unique |
53 // integer created in the IO thread) to the SavePackage for the contents where | 53 // integer created in the IO thread) to the SavePackage for the contents where |
54 // the saving job was initiated. In the event of a contents closure during | 54 // the saving job was initiated. In the event of a contents closure during |
55 // saving, the SavePackage will notify the SaveFileManage to cancel all SaveFile | 55 // saving, the SavePackage will notify the SaveFileManage to cancel all SaveFile |
56 // jobs. | 56 // jobs. |
57 | 57 |
58 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H_ | 58 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H_ |
59 #define CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H_ | 59 #define CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H_ |
60 #pragma once | |
61 | 60 |
62 #include <string> | 61 #include <string> |
63 | 62 |
64 #include "base/basictypes.h" | 63 #include "base/basictypes.h" |
65 #include "base/hash_tables.h" | 64 #include "base/hash_tables.h" |
66 #include "base/memory/ref_counted.h" | 65 #include "base/memory/ref_counted.h" |
67 #include "content/browser/download/save_types.h" | 66 #include "content/browser/download/save_types.h" |
68 #include "content/common/content_export.h" | 67 #include "content/common/content_export.h" |
69 | 68 |
70 class FilePath; | 69 class FilePath; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // same time. | 240 // same time. |
242 typedef base::hash_map<std::string, SavePackage*> StartingRequestsMap; | 241 typedef base::hash_map<std::string, SavePackage*> StartingRequestsMap; |
243 typedef base::hash_map<int, StartingRequestsMap> | 242 typedef base::hash_map<int, StartingRequestsMap> |
244 ContentsToStartingRequestsMap; | 243 ContentsToStartingRequestsMap; |
245 ContentsToStartingRequestsMap contents_starting_requests_; | 244 ContentsToStartingRequestsMap contents_starting_requests_; |
246 | 245 |
247 DISALLOW_COPY_AND_ASSIGN(SaveFileManager); | 246 DISALLOW_COPY_AND_ASSIGN(SaveFileManager); |
248 }; | 247 }; |
249 | 248 |
250 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H_ | 249 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_FILE_MANAGER_H_ |
OLD | NEW |