Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: content/browser/download/download_create_info.h

Issue 2809953002: Make the download's response headers available in the DownloadItem (Closed)
Patch Set: comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/download/download_create_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h"
15 #include "base/optional.h" 16 #include "base/optional.h"
16 #include "base/time/time.h" 17 #include "base/time/time.h"
17 #include "content/browser/download/download_file.h" 18 #include "content/browser/download/download_file.h"
18 #include "content/browser/download/download_request_handle.h" 19 #include "content/browser/download/download_request_handle.h"
19 #include "content/common/content_export.h" 20 #include "content/common/content_export.h"
20 #include "content/public/browser/download_interrupt_reasons.h" 21 #include "content/public/browser/download_interrupt_reasons.h"
21 #include "content/public/browser/download_save_info.h" 22 #include "content/public/browser/download_save_info.h"
22 #include "net/http/http_response_info.h" 23 #include "net/http/http_response_info.h"
23 #include "net/log/net_log_with_source.h" 24 #include "net/log/net_log_with_source.h"
24 #include "ui/base/page_transition_types.h" 25 #include "ui/base/page_transition_types.h"
25 #include "url/gurl.h" 26 #include "url/gurl.h"
26 27
28 namespace net {
29 class HttpResponseHeaders;
30 }
31
27 namespace content { 32 namespace content {
28 33
29 // Used for informing the download manager of a new download, since we don't 34 // Used for informing the download manager of a new download, since we don't
30 // want to pass |DownloadItem|s between threads. 35 // want to pass |DownloadItem|s between threads.
31 struct CONTENT_EXPORT DownloadCreateInfo { 36 struct CONTENT_EXPORT DownloadCreateInfo {
32 DownloadCreateInfo(const base::Time& start_time, 37 DownloadCreateInfo(const base::Time& start_time,
33 const net::NetLogWithSource& net_log, 38 const net::NetLogWithSource& net_log,
34 std::unique_ptr<DownloadSaveInfo> save_info); 39 std::unique_ptr<DownloadSaveInfo> save_info);
35 DownloadCreateInfo(); 40 DownloadCreateInfo();
36 ~DownloadCreateInfo(); 41 ~DownloadCreateInfo();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 76
72 // True if the download was initiated by user action. 77 // True if the download was initiated by user action.
73 bool has_user_gesture; 78 bool has_user_gesture;
74 79
75 // Whether the download should be transient. A transient download is 80 // Whether the download should be transient. A transient download is
76 // short-lived and is not shown in the UI. 81 // short-lived and is not shown in the UI.
77 bool transient; 82 bool transient;
78 83
79 base::Optional<ui::PageTransition> transition_type; 84 base::Optional<ui::PageTransition> transition_type;
80 85
86 // The HTTP response headers. This contains a nullptr when the response has
87 // not yet been received. Only for consuming headers.
88 scoped_refptr<const net::HttpResponseHeaders> response_headers;
89
81 // The remote IP address where the download was fetched from. Copied from 90 // The remote IP address where the download was fetched from. Copied from
82 // UrlRequest::GetSocketAddress(). 91 // UrlRequest::GetSocketAddress().
83 std::string remote_address; 92 std::string remote_address;
84 93
85 // If the download is initially created in an interrupted state (because the 94 // If the download is initially created in an interrupted state (because the
86 // response was in error), then |result| would be something other than 95 // response was in error), then |result| would be something other than
87 // INTERRUPT_REASON_NONE. 96 // INTERRUPT_REASON_NONE.
88 DownloadInterruptReason result; 97 DownloadInterruptReason result;
89 98
90 // The download file save info. 99 // The download file save info.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // The HTTP connection type. 136 // The HTTP connection type.
128 net::HttpResponseInfo::ConnectionInfo connection_info; 137 net::HttpResponseInfo::ConnectionInfo connection_info;
129 138
130 private: 139 private:
131 DISALLOW_COPY_AND_ASSIGN(DownloadCreateInfo); 140 DISALLOW_COPY_AND_ASSIGN(DownloadCreateInfo);
132 }; 141 };
133 142
134 } // namespace content 143 } // namespace content
135 144
136 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ 145 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_create_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698