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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 download_file->Cancel(); | 107 download_file->Cancel(); |
108 } | 108 } |
109 | 109 |
110 } // namespace | 110 } // namespace |
111 | 111 |
112 const char DownloadItem::kEmptyFileHash[] = ""; | 112 const char DownloadItem::kEmptyFileHash[] = ""; |
113 | 113 |
114 // Constructor for reading from the history service. | 114 // Constructor for reading from the history service. |
115 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, | 115 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, |
116 DownloadId download_id, | 116 DownloadId download_id, |
117 const FilePath& path, | 117 const FilePath& current_path, |
118 const GURL& url, | 118 const FilePath& target_path, |
| 119 const std::vector<GURL>& url_chain, |
119 const GURL& referrer_url, | 120 const GURL& referrer_url, |
120 const base::Time& start_time, | 121 const base::Time& start_time, |
121 const base::Time& end_time, | 122 const base::Time& end_time, |
122 int64 received_bytes, | 123 int64 received_bytes, |
123 int64 total_bytes, | 124 int64 total_bytes, |
124 DownloadItem::DownloadState state, | 125 DownloadItem::DownloadState state, |
| 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_(path), | 131 current_path_(current_path), |
130 target_path_(path), | 132 target_path_(target_path), |
131 target_disposition_(TARGET_DISPOSITION_OVERWRITE), | 133 target_disposition_(TARGET_DISPOSITION_OVERWRITE), |
132 url_chain_(1, url), | 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), |
136 total_bytes_(total_bytes), | 138 total_bytes_(total_bytes), |
137 received_bytes_(received_bytes), | 139 received_bytes_(received_bytes), |
138 bytes_per_sec_(0), | 140 bytes_per_sec_(0), |
139 last_reason_(DOWNLOAD_INTERRUPT_REASON_NONE), | 141 last_reason_(interrupt_reason), |
140 start_tick_(base::TimeTicks()), | 142 start_tick_(base::TimeTicks()), |
141 state_(ExternalToInternalState(state)), | 143 state_(ExternalToInternalState(state)), |
142 danger_type_(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS), | 144 danger_type_(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS), |
143 start_time_(start_time), | 145 start_time_(start_time), |
144 end_time_(end_time), | 146 end_time_(end_time), |
145 delegate_(delegate), | 147 delegate_(delegate), |
146 is_paused_(false), | 148 is_paused_(false), |
147 open_when_complete_(false), | 149 open_when_complete_(false), |
148 file_externally_removed_(false), | 150 file_externally_removed_(false), |
149 safety_state_(SAFE), | 151 safety_state_(SAFE), |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 return "CANCELLED"; | 1416 return "CANCELLED"; |
1415 case INTERRUPTED_INTERNAL: | 1417 case INTERRUPTED_INTERNAL: |
1416 return "INTERRUPTED"; | 1418 return "INTERRUPTED"; |
1417 default: | 1419 default: |
1418 NOTREACHED() << "Unknown download state " << state; | 1420 NOTREACHED() << "Unknown download state " << state; |
1419 return "unknown"; | 1421 return "unknown"; |
1420 }; | 1422 }; |
1421 } | 1423 } |
1422 | 1424 |
1423 } // namespace content | 1425 } // namespace content |
OLD | NEW |