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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 base::Time::Now(), request()->net_log(), std::move(save_info_))); | 273 base::Time::Now(), request()->net_log(), std::move(save_info_))); |
274 | 274 |
275 if (result == DOWNLOAD_INTERRUPT_REASON_NONE) | 275 if (result == DOWNLOAD_INTERRUPT_REASON_NONE) |
276 create_info->remote_address = request()->GetSocketAddress().host(); | 276 create_info->remote_address = request()->GetSocketAddress().host(); |
277 create_info->connection_info = request()->response_info().connection_info; | 277 create_info->connection_info = request()->response_info().connection_info; |
278 create_info->url_chain = request()->url_chain(); | 278 create_info->url_chain = request()->url_chain(); |
279 create_info->referrer_url = GURL(request()->referrer()); | 279 create_info->referrer_url = GURL(request()->referrer()); |
280 create_info->result = result; | 280 create_info->result = result; |
281 create_info->download_id = download_id_; | 281 create_info->download_id = download_id_; |
282 create_info->offset = create_info->save_info->offset; | 282 create_info->offset = create_info->save_info->offset; |
283 create_info->length = create_info->save_info->length; | |
284 return create_info; | 283 return create_info; |
285 } | 284 } |
286 | 285 |
287 bool DownloadRequestCore::OnResponseStarted( | 286 bool DownloadRequestCore::OnResponseStarted( |
288 const std::string& override_mime_type) { | 287 const std::string& override_mime_type) { |
289 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 288 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
290 DVLOG(20) << __func__ << "() " << DebugString(); | 289 DVLOG(20) << __func__ << "() " << DebugString(); |
291 download_start_time_ = base::TimeTicks::Now(); | 290 download_start_time_ = base::TimeTicks::Now(); |
292 | 291 |
293 DownloadInterruptReason result = | 292 DownloadInterruptReason result = |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 return DOWNLOAD_INTERRUPT_REASON_NONE; | 661 return DOWNLOAD_INTERRUPT_REASON_NONE; |
663 } | 662 } |
664 | 663 |
665 if (http_headers.response_code() == net::HTTP_PARTIAL_CONTENT) | 664 if (http_headers.response_code() == net::HTTP_PARTIAL_CONTENT) |
666 return DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT; | 665 return DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT; |
667 | 666 |
668 return DOWNLOAD_INTERRUPT_REASON_NONE; | 667 return DOWNLOAD_INTERRUPT_REASON_NONE; |
669 } | 668 } |
670 | 669 |
671 } // namespace content | 670 } // namespace content |
OLD | NEW |