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

Side by Side Diff: content/browser/download/download_request_core.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 unified diff | Download patch
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 #include "content/browser/download/download_request_core.h" 5 #include "content/browser/download/download_request_core.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 base::Time::Now(), request()->net_log(), std::move(save_info_))); 227 base::Time::Now(), request()->net_log(), std::move(save_info_)));
228 228
229 if (result == DOWNLOAD_INTERRUPT_REASON_NONE) 229 if (result == DOWNLOAD_INTERRUPT_REASON_NONE)
230 create_info->remote_address = request()->GetSocketAddress().host(); 230 create_info->remote_address = request()->GetSocketAddress().host();
231 create_info->connection_info = request()->response_info().connection_info; 231 create_info->connection_info = request()->response_info().connection_info;
232 create_info->url_chain = request()->url_chain(); 232 create_info->url_chain = request()->url_chain();
233 create_info->referrer_url = GURL(request()->referrer()); 233 create_info->referrer_url = GURL(request()->referrer());
234 create_info->result = result; 234 create_info->result = result;
235 create_info->download_id = download_id_; 235 create_info->download_id = download_id_;
236 create_info->transient = transient_; 236 create_info->transient = transient_;
237 create_info->response_headers = request()->response_headers();
237 create_info->offset = create_info->save_info->offset; 238 create_info->offset = create_info->save_info->offset;
238 return create_info; 239 return create_info;
239 } 240 }
240 241
241 bool DownloadRequestCore::OnResponseStarted( 242 bool DownloadRequestCore::OnResponseStarted(
242 const std::string& override_mime_type) { 243 const std::string& override_mime_type) {
243 DCHECK_CURRENTLY_ON(BrowserThread::IO); 244 DCHECK_CURRENTLY_ON(BrowserThread::IO);
244 DVLOG(20) << __func__ << "() " << DebugString(); 245 DVLOG(20) << __func__ << "() " << DebugString();
245 download_start_time_ = base::TimeTicks::Now(); 246 download_start_time_ = base::TimeTicks::Now();
246 247
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 // old servers that didn't implement "If-Match" and must be ignored when 676 // old servers that didn't implement "If-Match" and must be ignored when
676 // "If-Match" presents. 677 // "If-Match" presents.
677 if (has_last_modified) { 678 if (has_last_modified) {
678 request->SetExtraRequestHeaderByName( 679 request->SetExtraRequestHeaderByName(
679 net::HttpRequestHeaders::kIfUnmodifiedSince, params->last_modified(), 680 net::HttpRequestHeaders::kIfUnmodifiedSince, params->last_modified(),
680 true); 681 true);
681 } 682 }
682 } 683 }
683 684
684 } // namespace content 685 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_item_impl_unittest.cc ('k') | content/public/browser/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698