OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/download/download_create_info.h" | 5 #include "chrome/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/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 DownloadCreateInfo::~DownloadCreateInfo() { | 46 DownloadCreateInfo::~DownloadCreateInfo() { |
47 } | 47 } |
48 | 48 |
49 std::string DownloadCreateInfo::DebugString() const { | 49 std::string DownloadCreateInfo::DebugString() const { |
50 return base::StringPrintf("{" | 50 return base::StringPrintf("{" |
51 " download_id = %d" | 51 " download_id = %d" |
52 " url = \"%s\"" | 52 " url = \"%s\"" |
53 " path = \"%" PRFilePath "\"" | 53 " path = \"%" PRFilePath "\"" |
54 " received_bytes = %" PRId64 | 54 " received_bytes = %" PRId64 |
55 " total_bytes = %" PRId64 | 55 " total_bytes = %" PRId64 |
56 " child_id = %d" | 56 " request_handle = %s" |
57 " render_view_id = %d" | |
58 " request_id = %d" | |
59 " prompt_user_for_save_location = %c" | 57 " prompt_user_for_save_location = %c" |
60 " }", | 58 " }", |
61 download_id, | 59 download_id, |
62 url().spec().c_str(), | 60 url().spec().c_str(), |
63 path.value().c_str(), | 61 path.value().c_str(), |
64 received_bytes, | 62 received_bytes, |
65 total_bytes, | 63 total_bytes, |
66 process_handle.child_id(), | 64 request_handle.DebugString().c_str(), |
67 process_handle.render_view_id(), | |
68 process_handle.request_id(), | |
69 prompt_user_for_save_location ? 'T' : 'F'); | 65 prompt_user_for_save_location ? 'T' : 'F'); |
70 } | 66 } |
71 | 67 |
72 const GURL& DownloadCreateInfo::url() const { | 68 const GURL& DownloadCreateInfo::url() const { |
73 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); | 69 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); |
74 } | 70 } |
OLD | NEW |