| 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 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/id_type.h" |
| 14 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 18 |
| 19 class SavePackage; |
| 20 using SavePackageId = base::IdType<SavePackage, int, 0>; |
| 21 |
| 17 typedef std::vector<std::pair<int, base::FilePath> > FinalNameList; | 22 typedef std::vector<std::pair<int, base::FilePath> > FinalNameList; |
| 18 typedef std::vector<int> SaveIDList; | 23 typedef std::vector<int> SaveIDList; |
| 19 | 24 |
| 20 // This structure is used to handle and deliver some info | 25 // This structure is used to handle and deliver some info |
| 21 // when processing each save item job. | 26 // when processing each save item job. |
| 22 struct SaveFileCreateInfo { | 27 struct SaveFileCreateInfo { |
| 23 enum SaveFileSource { | 28 enum SaveFileSource { |
| 24 // This type indicates the source is not set. | 29 // This type indicates the source is not set. |
| 25 SAVE_FILE_FROM_UNKNOWN = -1, | 30 SAVE_FILE_FROM_UNKNOWN = -1, |
| 26 // This type indicates the save item needs to be retrieved from the network. | 31 // This type indicates the save item needs to be retrieved from the network. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 46 // The local file path of saved file. | 51 // The local file path of saved file. |
| 47 base::FilePath path; | 52 base::FilePath path; |
| 48 // Original URL of the saved resource. | 53 // Original URL of the saved resource. |
| 49 GURL url; | 54 GURL url; |
| 50 // Final URL of the saved resource since some URL might be redirected. | 55 // Final URL of the saved resource since some URL might be redirected. |
| 51 GURL final_url; | 56 GURL final_url; |
| 52 // The unique identifier for saving job, assigned at creation by | 57 // The unique identifier for saving job, assigned at creation by |
| 53 // the SaveFileManager for its internal record keeping. | 58 // the SaveFileManager for its internal record keeping. |
| 54 int save_id; | 59 int save_id; |
| 55 // ID of SavePackage object. | 60 // ID of SavePackage object. |
| 56 int save_package_id; | 61 SavePackageId save_package_id; |
| 57 // IDs for looking up the contents we are associated with. | 62 // IDs for looking up the contents we are associated with. |
| 58 int render_process_id; | 63 int render_process_id; |
| 59 int render_frame_routing_id; | 64 int render_frame_routing_id; |
| 60 // Handle for informing the ResourceDispatcherHost of a UI based cancel. | 65 // Handle for informing the ResourceDispatcherHost of a UI based cancel. |
| 61 int request_id; | 66 int request_id; |
| 62 // Disposition info from HTTP response. | 67 // Disposition info from HTTP response. |
| 63 std::string content_disposition; | 68 std::string content_disposition; |
| 64 // Total bytes of saved file. | 69 // Total bytes of saved file. |
| 65 int64 total_bytes; | 70 int64 total_bytes; |
| 66 // Source type of saved file. | 71 // Source type of saved file. |
| 67 SaveFileSource save_source; | 72 SaveFileSource save_source; |
| 68 }; | 73 }; |
| 69 | 74 |
| 70 } // namespace content | 75 } // namespace content |
| 71 | 76 |
| 72 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ | 77 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ |
| OLD | NEW |