| 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_create_info.h" | 5 #include "content/browser/download/download_create_info.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "net/http/http_response_headers.h" | 12 #include "net/http/http_response_headers.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 DownloadCreateInfo::DownloadCreateInfo( | 16 DownloadCreateInfo::DownloadCreateInfo( |
| 17 const base::Time& start_time, | 17 const base::Time& start_time, |
| 18 const net::NetLogWithSource& net_log, | 18 const net::NetLogWithSource& net_log, |
| 19 std::unique_ptr<DownloadSaveInfo> save_info) | 19 std::unique_ptr<DownloadSaveInfo> save_info) |
| 20 : download_id(DownloadItem::kInvalidId), | 20 : download_id(DownloadItem::kInvalidId), |
| 21 start_time(start_time), | 21 start_time(start_time), |
| 22 total_bytes(0), | 22 total_bytes(0), |
| 23 offset(0), | 23 offset(0), |
| 24 has_user_gesture(false), | 24 has_user_gesture(false), |
| 25 transient(false), | 25 transient(false), |
| 26 result(DOWNLOAD_INTERRUPT_REASON_NONE), | 26 result(DOWNLOAD_INTERRUPT_REASON_NONE), |
| 27 save_info(std::move(save_info)), | 27 save_info(std::move(save_info)), |
| 28 request_net_log(net_log), | 28 request_net_log(net_log), |
| 29 accept_range(false), | 29 accept_range(false), |
| 30 connection_info(net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN) {} | 30 connection_info(net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN), |
| 31 method("GET") {} |
| 31 | 32 |
| 32 DownloadCreateInfo::DownloadCreateInfo() | 33 DownloadCreateInfo::DownloadCreateInfo() |
| 33 : DownloadCreateInfo(base::Time(), | 34 : DownloadCreateInfo(base::Time(), |
| 34 net::NetLogWithSource(), | 35 net::NetLogWithSource(), |
| 35 base::WrapUnique(new DownloadSaveInfo)) {} | 36 base::WrapUnique(new DownloadSaveInfo)) {} |
| 36 | 37 |
| 37 DownloadCreateInfo::~DownloadCreateInfo() {} | 38 DownloadCreateInfo::~DownloadCreateInfo() {} |
| 38 | 39 |
| 39 const GURL& DownloadCreateInfo::url() const { | 40 const GURL& DownloadCreateInfo::url() const { |
| 40 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); | 41 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 } // namespace content | 44 } // namespace content |
| OLD | NEW |