| 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 <stdint.h> |
| 9 |
| 8 #include <map> | 10 #include <map> |
| 9 #include <string> | 11 #include <string> |
| 10 #include <utility> | 12 #include <utility> |
| 11 #include <vector> | 13 #include <vector> |
| 12 | 14 |
| 13 #include "base/basictypes.h" | |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 | 19 |
| 19 // Map from save_item_id into final file path. | 20 // Map from save_item_id into final file path. |
| 20 typedef std::map<int, base::FilePath> FinalNamesMap; | 21 typedef std::map<int, base::FilePath> FinalNamesMap; |
| 21 | 22 |
| 22 // This structure is used to handle and deliver some info | 23 // This structure is used to handle and deliver some info |
| 23 // when processing each save item job. | 24 // when processing each save item job. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 | 47 |
| 47 // Constructor for SAVE_FILE_FROM_NET case. | 48 // Constructor for SAVE_FILE_FROM_NET case. |
| 48 SaveFileCreateInfo(const GURL& url, | 49 SaveFileCreateInfo(const GURL& url, |
| 49 const GURL& final_url, | 50 const GURL& final_url, |
| 50 int save_item_id, | 51 int save_item_id, |
| 51 int save_package_id, | 52 int save_package_id, |
| 52 int render_process_id, | 53 int render_process_id, |
| 53 int render_frame_routing_id, | 54 int render_frame_routing_id, |
| 54 int request_id, | 55 int request_id, |
| 55 const std::string& content_disposition, | 56 const std::string& content_disposition, |
| 56 int64 total_bytes); | 57 int64_t total_bytes); |
| 57 | 58 |
| 58 ~SaveFileCreateInfo(); | 59 ~SaveFileCreateInfo(); |
| 59 | 60 |
| 60 // SaveItem fields. | 61 // SaveItem fields. |
| 61 // The local file path of saved file. | 62 // The local file path of saved file. |
| 62 base::FilePath path; | 63 base::FilePath path; |
| 63 // Original URL of the saved resource. | 64 // Original URL of the saved resource. |
| 64 GURL url; | 65 GURL url; |
| 65 // Final URL of the saved resource since some URL might be redirected. | 66 // Final URL of the saved resource since some URL might be redirected. |
| 66 GURL final_url; | 67 GURL final_url; |
| 67 // The unique identifier of SaveItem object associated with this job. | 68 // The unique identifier of SaveItem object associated with this job. |
| 68 int save_item_id; | 69 int save_item_id; |
| 69 // ID of SavePackage object. | 70 // ID of SavePackage object. |
| 70 int save_package_id; | 71 int save_package_id; |
| 71 // IDs for looking up the contents we are associated with. | 72 // IDs for looking up the contents we are associated with. |
| 72 int render_process_id; | 73 int render_process_id; |
| 73 int render_frame_routing_id; | 74 int render_frame_routing_id; |
| 74 // Handle for informing the ResourceDispatcherHost of a UI based cancel. | 75 // Handle for informing the ResourceDispatcherHost of a UI based cancel. |
| 75 int request_id; | 76 int request_id; |
| 76 // Disposition info from HTTP response. | 77 // Disposition info from HTTP response. |
| 77 std::string content_disposition; | 78 std::string content_disposition; |
| 78 // Total bytes of saved file. | 79 // Total bytes of saved file. |
| 79 int64 total_bytes; | 80 int64_t total_bytes; |
| 80 // Source type of saved file. | 81 // Source type of saved file. |
| 81 SaveFileSource save_source; | 82 SaveFileSource save_source; |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 } // namespace content | 85 } // namespace content |
| 85 | 86 |
| 86 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ | 87 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ |
| OLD | NEW |