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; |
283 return create_info; | 284 return create_info; |
284 } | 285 } |
285 | 286 |
286 bool DownloadRequestCore::OnResponseStarted( | 287 bool DownloadRequestCore::OnResponseStarted( |
287 const std::string& override_mime_type) { | 288 const std::string& override_mime_type) { |
288 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 289 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
289 DVLOG(20) << __func__ << "() " << DebugString(); | 290 DVLOG(20) << __func__ << "() " << DebugString(); |
290 download_start_time_ = base::TimeTicks::Now(); | 291 download_start_time_ = base::TimeTicks::Now(); |
291 | 292 |
292 DownloadInterruptReason result = | 293 DownloadInterruptReason result = |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 return DOWNLOAD_INTERRUPT_REASON_NONE; | 662 return DOWNLOAD_INTERRUPT_REASON_NONE; |
662 } | 663 } |
663 | 664 |
664 if (http_headers.response_code() == net::HTTP_PARTIAL_CONTENT) | 665 if (http_headers.response_code() == net::HTTP_PARTIAL_CONTENT) |
665 return DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT; | 666 return DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT; |
666 | 667 |
667 return DOWNLOAD_INTERRUPT_REASON_NONE; | 668 return DOWNLOAD_INTERRUPT_REASON_NONE; |
668 } | 669 } |
669 | 670 |
670 } // namespace content | 671 } // namespace content |
OLD | NEW |