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_DOWNLOAD_CREATE_INFO_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/basictypes.h" | |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" |
13 #include "base/time/time.h" | 15 #include "base/time/time.h" |
14 #include "content/browser/download/download_file.h" | 16 #include "content/browser/download/download_file.h" |
15 #include "content/browser/download/download_request_handle.h" | 17 #include "content/browser/download/download_request_handle.h" |
16 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
17 #include "content/public/browser/download_save_info.h" | 19 #include "content/public/browser/download_save_info.h" |
18 #include "net/log/net_log.h" | 20 #include "net/log/net_log.h" |
19 #include "ui/base/page_transition_types.h" | 21 #include "ui/base/page_transition_types.h" |
20 #include "url/gurl.h" | 22 #include "url/gurl.h" |
21 | 23 |
22 namespace content { | 24 namespace content { |
23 | 25 |
24 // Used for informing the download manager of a new download, since we don't | 26 // Used for informing the download manager of a new download, since we don't |
25 // want to pass |DownloadItem|s between threads. | 27 // want to pass |DownloadItem|s between threads. |
26 struct CONTENT_EXPORT DownloadCreateInfo { | 28 struct CONTENT_EXPORT DownloadCreateInfo { |
27 DownloadCreateInfo(const base::Time& start_time, | 29 DownloadCreateInfo(const base::Time& start_time, |
28 int64 total_bytes, | 30 int64_t total_bytes, |
29 const net::BoundNetLog& bound_net_log, | 31 const net::BoundNetLog& bound_net_log, |
30 scoped_ptr<DownloadSaveInfo> save_info); | 32 scoped_ptr<DownloadSaveInfo> save_info); |
31 DownloadCreateInfo(); | 33 DownloadCreateInfo(); |
32 ~DownloadCreateInfo(); | 34 ~DownloadCreateInfo(); |
33 | 35 |
34 std::string DebugString() const; | 36 std::string DebugString() const; |
35 | 37 |
36 // The URL from which we are downloading. This is the final URL after any | 38 // The URL from which we are downloading. This is the final URL after any |
37 // redirection by the server for |url_chain|. | 39 // redirection by the server for |url_chain|. |
38 const GURL& url() const; | 40 const GURL& url() const; |
39 | 41 |
40 // The chain of redirects that leading up to and including the final URL. | 42 // The chain of redirects that leading up to and including the final URL. |
41 std::vector<GURL> url_chain; | 43 std::vector<GURL> url_chain; |
42 | 44 |
43 // The URL that referred us. | 45 // The URL that referred us. |
44 GURL referrer_url; | 46 GURL referrer_url; |
45 | 47 |
46 // The URL of the tab that started us. | 48 // The URL of the tab that started us. |
47 GURL tab_url; | 49 GURL tab_url; |
48 | 50 |
49 // The referrer URL of the tab that started us. | 51 // The referrer URL of the tab that started us. |
50 GURL tab_referrer_url; | 52 GURL tab_referrer_url; |
51 | 53 |
52 // The time when the download started. | 54 // The time when the download started. |
53 base::Time start_time; | 55 base::Time start_time; |
54 | 56 |
55 // The total download size. | 57 // The total download size. |
56 int64 total_bytes; | 58 int64_t total_bytes; |
57 | 59 |
58 // The ID of the download. | 60 // The ID of the download. |
59 uint32 download_id; | 61 uint32_t download_id; |
60 | 62 |
61 // True if the download was initiated by user action. | 63 // True if the download was initiated by user action. |
62 bool has_user_gesture; | 64 bool has_user_gesture; |
63 | 65 |
64 ui::PageTransition transition_type; | 66 ui::PageTransition transition_type; |
65 | 67 |
66 // The content-disposition string from the response header. | 68 // The content-disposition string from the response header. |
67 std::string content_disposition; | 69 std::string content_disposition; |
68 | 70 |
69 // The mime type string from the response header (may be overridden). | 71 // The mime type string from the response header (may be overridden). |
(...skipping 26 matching lines...) Expand all Loading... |
96 // download item's. | 98 // download item's. |
97 const net::BoundNetLog request_bound_net_log; | 99 const net::BoundNetLog request_bound_net_log; |
98 | 100 |
99 private: | 101 private: |
100 DISALLOW_COPY_AND_ASSIGN(DownloadCreateInfo); | 102 DISALLOW_COPY_AND_ASSIGN(DownloadCreateInfo); |
101 }; | 103 }; |
102 | 104 |
103 } // namespace content | 105 } // namespace content |
104 | 106 |
105 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 107 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
OLD | NEW |