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

Unified Diff: content/browser/download/download_item_impl.cc

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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_item_impl.cc
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index fb6ff4a01339ddf4acc7ed3bbd155e1603e2a7e6..966bbae3807574f5ff580ccdaecb4a680d5046b7 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -57,6 +57,7 @@
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_features.h"
#include "content/public/common/referrer.h"
+#include "net/http/http_response_headers.h"
#include "net/log/net_log.h"
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_parameters_callback.h"
@@ -217,6 +218,7 @@ DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate,
transition_type_(info.transition_type ? info.transition_type.value()
: ui::PAGE_TRANSITION_LINK),
has_user_gesture_(info.has_user_gesture),
+ response_headers_(info.response_headers),
content_disposition_(info.content_disposition),
mime_type_(info.mime_type),
original_mime_type_(info.original_mime_type),
@@ -605,6 +607,11 @@ std::string DownloadItemImpl::GetSuggestedFilename() const {
return suggested_filename_;
}
+const scoped_refptr<const net::HttpResponseHeaders>&
+DownloadItemImpl::GetResponseHeaders() const {
+ return response_headers_;
+}
+
std::string DownloadItemImpl::GetContentDisposition() const {
return content_disposition_;
}
@@ -1043,6 +1050,7 @@ void DownloadItemImpl::UpdateValidatorsOnResumption(
url_chain_.end(), chain_iter, new_create_info.url_chain.end());
etag_ = new_create_info.etag;
last_modified_time_ = new_create_info.last_modified;
+ response_headers_ = new_create_info.response_headers;
content_disposition_ = new_create_info.content_disposition;
// It is possible that the previous download attempt failed right before the
// response is received. Need to reset the MIME type.
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698