| 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/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 save_info(std::move(save_info)), | 23 save_info(std::move(save_info)), |
| 24 request_bound_net_log(bound_net_log) {} | 24 request_bound_net_log(bound_net_log) {} |
| 25 | 25 |
| 26 DownloadCreateInfo::DownloadCreateInfo() | 26 DownloadCreateInfo::DownloadCreateInfo() |
| 27 : DownloadCreateInfo(base::Time(), | 27 : DownloadCreateInfo(base::Time(), |
| 28 net::BoundNetLog(), | 28 net::BoundNetLog(), |
| 29 make_scoped_ptr(new DownloadSaveInfo)) {} | 29 make_scoped_ptr(new DownloadSaveInfo)) {} |
| 30 | 30 |
| 31 DownloadCreateInfo::~DownloadCreateInfo() {} | 31 DownloadCreateInfo::~DownloadCreateInfo() {} |
| 32 | 32 |
| 33 std::string DownloadCreateInfo::DebugString() const { | |
| 34 return base::StringPrintf( | |
| 35 "{" | |
| 36 " download_id = %u" | |
| 37 " url = \"%s\"" | |
| 38 " request_handle = %s" | |
| 39 " total_bytes = %" PRId64 " }", | |
| 40 download_id, url().spec().c_str(), request_handle->DebugString().c_str(), | |
| 41 total_bytes); | |
| 42 } | |
| 43 | |
| 44 const GURL& DownloadCreateInfo::url() const { | 33 const GURL& DownloadCreateInfo::url() const { |
| 45 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); | 34 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); |
| 46 } | 35 } |
| 47 | 36 |
| 48 } // namespace content | 37 } // namespace content |
| OLD | NEW |