Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: content/browser/download/download_create_info.cc

Issue 9351024: Clean up unused members and constructors from DownloadCreateInfo and DownloadSaveInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "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/stringprintf.h" 10 #include "base/stringprintf.h"
11 11
12 using content::DownloadId; 12 using content::DownloadId;
13 13
14 DownloadCreateInfo::DownloadCreateInfo( 14 DownloadCreateInfo::DownloadCreateInfo(const base::Time& start_time,
15 const FilePath& path, 15 int64 received_bytes,
16 const GURL& url, 16 int64 total_bytes,
17 const base::Time& start_time, 17 int32 state,
18 int64 received_bytes, 18 bool has_user_gesture,
19 int64 total_bytes, 19 content::PageTransition transition_type)
20 int32 state, 20 : start_time(start_time),
21 bool has_user_gesture,
22 content::PageTransition transition_type)
23 : path(path),
24 url_chain(1, url),
25 start_time(start_time),
26 received_bytes(received_bytes), 21 received_bytes(received_bytes),
27 total_bytes(total_bytes), 22 total_bytes(total_bytes),
28 state(state), 23 state(state),
29 download_id(DownloadId::Invalid()), 24 download_id(DownloadId::Invalid()),
30 has_user_gesture(has_user_gesture), 25 has_user_gesture(has_user_gesture),
31 transition_type(transition_type), 26 transition_type(transition_type),
32 db_handle(0), 27 db_handle(0),
33 prompt_user_for_save_location(false) { 28 prompt_user_for_save_location(false) {
34 } 29 }
35 30
36 DownloadCreateInfo::DownloadCreateInfo() 31 DownloadCreateInfo::DownloadCreateInfo()
37 : received_bytes(0), 32 : received_bytes(0),
38 total_bytes(0), 33 total_bytes(0),
39 state(-1), 34 state(-1),
40 download_id(DownloadId::Invalid()), 35 download_id(DownloadId::Invalid()),
41 has_user_gesture(false), 36 has_user_gesture(false),
42 transition_type(content::PAGE_TRANSITION_LINK), 37 transition_type(content::PAGE_TRANSITION_LINK),
43 db_handle(0), 38 db_handle(0),
44 prompt_user_for_save_location(false) { 39 prompt_user_for_save_location(false) {
45 } 40 }
46 41
47 DownloadCreateInfo::~DownloadCreateInfo() { 42 DownloadCreateInfo::~DownloadCreateInfo() {
48 } 43 }
49 44
50 std::string DownloadCreateInfo::DebugString() const { 45 std::string DownloadCreateInfo::DebugString() const {
51 return base::StringPrintf("{" 46 return base::StringPrintf("{"
52 " download_id = %s" 47 " download_id = %s"
53 " url = \"%s\"" 48 " url = \"%s\""
54 " path = \"%" PRFilePath "\"" 49 " save_info.file_path = \"%" PRFilePath "\""
55 " received_bytes = %" PRId64 50 " received_bytes = %" PRId64
56 " total_bytes = %" PRId64 51 " total_bytes = %" PRId64
57 " prompt_user_for_save_location = %c" 52 " prompt_user_for_save_location = %c"
58 " }", 53 " }",
59 download_id.DebugString().c_str(), 54 download_id.DebugString().c_str(),
60 url().spec().c_str(), 55 url().spec().c_str(),
61 path.value().c_str(), 56 save_info.file_path.value().c_str(),
62 received_bytes, 57 received_bytes,
63 total_bytes, 58 total_bytes,
64 prompt_user_for_save_location ? 'T' : 'F'); 59 prompt_user_for_save_location ? 'T' : 'F');
65 } 60 }
66 61
67 const GURL& DownloadCreateInfo::url() const { 62 const GURL& DownloadCreateInfo::url() const {
68 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); 63 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back();
69 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698