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

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

Issue 8404049: Added member data to classes to support download resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 9 years, 1 month 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"
(...skipping 11 matching lines...) Expand all
22 url_chain(1, url), 22 url_chain(1, url),
23 path_uniquifier(0), 23 path_uniquifier(0),
24 start_time(start_time), 24 start_time(start_time),
25 received_bytes(received_bytes), 25 received_bytes(received_bytes),
26 total_bytes(total_bytes), 26 total_bytes(total_bytes),
27 state(state), 27 state(state),
28 download_id(download_id), 28 download_id(download_id),
29 has_user_gesture(has_user_gesture), 29 has_user_gesture(has_user_gesture),
30 transition_type(transition_type), 30 transition_type(transition_type),
31 db_handle(0), 31 db_handle(0),
32 continued_download(false),
33 server_interrupt_reason(DOWNLOAD_INTERRUPT_REASON_NONE),
32 prompt_user_for_save_location(false) { 34 prompt_user_for_save_location(false) {
33 } 35 }
34 36
35 DownloadCreateInfo::DownloadCreateInfo() 37 DownloadCreateInfo::DownloadCreateInfo()
36 : path_uniquifier(0), 38 : path_uniquifier(0),
37 received_bytes(0), 39 received_bytes(0),
38 total_bytes(0), 40 total_bytes(0),
39 state(-1), 41 state(-1),
40 download_id(-1), 42 download_id(-1),
41 has_user_gesture(false), 43 has_user_gesture(false),
42 transition_type(content::PAGE_TRANSITION_LINK), 44 transition_type(content::PAGE_TRANSITION_LINK),
43 db_handle(0), 45 db_handle(0),
46 continued_download(false),
47 server_interrupt_reason(DOWNLOAD_INTERRUPT_REASON_NONE),
44 prompt_user_for_save_location(false) { 48 prompt_user_for_save_location(false) {
45 } 49 }
46 50
47 DownloadCreateInfo::~DownloadCreateInfo() { 51 DownloadCreateInfo::~DownloadCreateInfo() {
48 } 52 }
49 53
50 std::string DownloadCreateInfo::DebugString() const { 54 std::string DownloadCreateInfo::DebugString() const {
51 return base::StringPrintf("{" 55 return base::StringPrintf("{"
52 " download_id = %d" 56 " download_id = %d"
53 " url = \"%s\"" 57 " url = \"%s\""
54 " path = \"%" PRFilePath "\"" 58 " path = \"%" PRFilePath "\""
55 " received_bytes = %" PRId64 59 " received_bytes = %" PRId64
56 " total_bytes = %" PRId64 60 " total_bytes = %" PRId64
57 " prompt_user_for_save_location = %c" 61 " prompt_user_for_save_location = %c"
58 " }", 62 " }",
59 download_id, 63 download_id,
60 url().spec().c_str(), 64 url().spec().c_str(),
61 path.value().c_str(), 65 path.value().c_str(),
62 received_bytes, 66 received_bytes,
63 total_bytes, 67 total_bytes,
64 prompt_user_for_save_location ? 'T' : 'F'); 68 prompt_user_for_save_location ? 'T' : 'F');
65 } 69 }
66 70
67 const GURL& DownloadCreateInfo::url() const { 71 const GURL& DownloadCreateInfo::url() const {
68 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); 72 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back();
69 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698