| 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 #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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 std::unique_ptr<DownloadCreateInfo> | 240 std::unique_ptr<DownloadCreateInfo> |
| 241 DownloadRequestCore::CreateDownloadCreateInfo(DownloadInterruptReason result) { | 241 DownloadRequestCore::CreateDownloadCreateInfo(DownloadInterruptReason result) { |
| 242 DCHECK(!started_); | 242 DCHECK(!started_); |
| 243 started_ = true; | 243 started_ = true; |
| 244 std::unique_ptr<DownloadCreateInfo> create_info(new DownloadCreateInfo( | 244 std::unique_ptr<DownloadCreateInfo> create_info(new DownloadCreateInfo( |
| 245 base::Time::Now(), request()->net_log(), std::move(save_info_))); | 245 base::Time::Now(), request()->net_log(), std::move(save_info_))); |
| 246 | 246 |
| 247 if (result == DOWNLOAD_INTERRUPT_REASON_NONE) | 247 if (result == DOWNLOAD_INTERRUPT_REASON_NONE) |
| 248 create_info->remote_address = request()->GetSocketAddress().host(); | 248 create_info->remote_address = request()->GetSocketAddress().host(); |
| 249 create_info->method = request()->method(); |
| 249 create_info->connection_info = request()->response_info().connection_info; | 250 create_info->connection_info = request()->response_info().connection_info; |
| 250 create_info->url_chain = request()->url_chain(); | 251 create_info->url_chain = request()->url_chain(); |
| 251 create_info->referrer_url = GURL(request()->referrer()); | 252 create_info->referrer_url = GURL(request()->referrer()); |
| 252 create_info->result = result; | 253 create_info->result = result; |
| 253 create_info->download_id = download_id_; | 254 create_info->download_id = download_id_; |
| 254 create_info->transient = transient_; | 255 create_info->transient = transient_; |
| 255 create_info->response_headers = request()->response_headers(); | 256 create_info->response_headers = request()->response_headers(); |
| 256 create_info->offset = create_info->save_info->offset; | 257 create_info->offset = create_info->save_info->offset; |
| 257 return create_info; | 258 return create_info; |
| 258 } | 259 } |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 // old servers that didn't implement "If-Match" and must be ignored when | 714 // old servers that didn't implement "If-Match" and must be ignored when |
| 714 // "If-Match" presents. | 715 // "If-Match" presents. |
| 715 if (has_last_modified) { | 716 if (has_last_modified) { |
| 716 request->SetExtraRequestHeaderByName( | 717 request->SetExtraRequestHeaderByName( |
| 717 net::HttpRequestHeaders::kIfUnmodifiedSince, params->last_modified(), | 718 net::HttpRequestHeaders::kIfUnmodifiedSince, params->last_modified(), |
| 718 true); | 719 true); |
| 719 } | 720 } |
| 720 } | 721 } |
| 721 | 722 |
| 722 } // namespace content | 723 } // namespace content |
| OLD | NEW |