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 // File method ordering: Methods in this file are in the same order as | 5 // File method ordering: Methods in this file are in the same order as |
6 // in download_item_impl.h, with the following exception: The public | 6 // in download_item_impl.h, with the following exception: The public |
7 // interface Start is placed in chronological order with the other | 7 // interface Start is placed in chronological order with the other |
8 // (private) routines that together define a DownloadItem's state | 8 // (private) routines that together define a DownloadItem's state |
9 // transitions as the download progresses. See "Download progression | 9 // transitions as the download progresses. See "Download progression |
10 // cascade" later in this file. | 10 // cascade" later in this file. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // The maximum number of attempts we will make to resume automatically. | 106 // The maximum number of attempts we will make to resume automatically. |
107 const int DownloadItemImpl::kMaxAutoResumeAttempts = 5; | 107 const int DownloadItemImpl::kMaxAutoResumeAttempts = 5; |
108 | 108 |
109 // Constructor for reading from the history service. | 109 // Constructor for reading from the history service. |
110 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, | 110 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, |
111 uint32 download_id, | 111 uint32 download_id, |
112 const base::FilePath& current_path, | 112 const base::FilePath& current_path, |
113 const base::FilePath& target_path, | 113 const base::FilePath& target_path, |
114 const std::vector<GURL>& url_chain, | 114 const std::vector<GURL>& url_chain, |
115 const GURL& referrer_url, | 115 const GURL& referrer_url, |
| 116 const std::string& mime_type, |
| 117 const std::string& original_mime_type, |
116 const base::Time& start_time, | 118 const base::Time& start_time, |
117 const base::Time& end_time, | 119 const base::Time& end_time, |
118 const std::string& etag, | 120 const std::string& etag, |
119 const std::string& last_modified, | 121 const std::string& last_modified, |
120 int64 received_bytes, | 122 int64 received_bytes, |
121 int64 total_bytes, | 123 int64 total_bytes, |
122 DownloadItem::DownloadState state, | 124 DownloadItem::DownloadState state, |
123 DownloadDangerType danger_type, | 125 DownloadDangerType danger_type, |
124 DownloadInterruptReason interrupt_reason, | 126 DownloadInterruptReason interrupt_reason, |
125 bool opened, | 127 bool opened, |
126 const net::BoundNetLog& bound_net_log) | 128 const net::BoundNetLog& bound_net_log) |
127 : is_save_package_download_(false), | 129 : is_save_package_download_(false), |
128 download_id_(download_id), | 130 download_id_(download_id), |
129 current_path_(current_path), | 131 current_path_(current_path), |
130 target_path_(target_path), | 132 target_path_(target_path), |
131 target_disposition_(TARGET_DISPOSITION_OVERWRITE), | 133 target_disposition_(TARGET_DISPOSITION_OVERWRITE), |
132 url_chain_(url_chain), | 134 url_chain_(url_chain), |
133 referrer_url_(referrer_url), | 135 referrer_url_(referrer_url), |
134 transition_type_(PAGE_TRANSITION_LINK), | 136 transition_type_(PAGE_TRANSITION_LINK), |
135 has_user_gesture_(false), | 137 has_user_gesture_(false), |
| 138 mime_type_(mime_type), |
| 139 original_mime_type_(original_mime_type), |
136 total_bytes_(total_bytes), | 140 total_bytes_(total_bytes), |
137 received_bytes_(received_bytes), | 141 received_bytes_(received_bytes), |
138 bytes_per_sec_(0), | 142 bytes_per_sec_(0), |
139 last_modified_time_(last_modified), | 143 last_modified_time_(last_modified), |
140 etag_(etag), | 144 etag_(etag), |
141 last_reason_(interrupt_reason), | 145 last_reason_(interrupt_reason), |
142 start_tick_(base::TimeTicks()), | 146 start_tick_(base::TimeTicks()), |
143 state_(ExternalToInternalState(state)), | 147 state_(ExternalToInternalState(state)), |
144 danger_type_(danger_type), | 148 danger_type_(danger_type), |
145 start_time_(start_time), | 149 start_time_(start_time), |
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1796 case RESUME_MODE_USER_CONTINUE: | 1800 case RESUME_MODE_USER_CONTINUE: |
1797 return "USER_CONTINUE"; | 1801 return "USER_CONTINUE"; |
1798 case RESUME_MODE_USER_RESTART: | 1802 case RESUME_MODE_USER_RESTART: |
1799 return "USER_RESTART"; | 1803 return "USER_RESTART"; |
1800 } | 1804 } |
1801 NOTREACHED() << "Unknown resume mode " << mode; | 1805 NOTREACHED() << "Unknown resume mode " << mode; |
1802 return "unknown"; | 1806 return "unknown"; |
1803 } | 1807 } |
1804 | 1808 |
1805 } // namespace content | 1809 } // namespace content |
OLD | NEW |