| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const int DownloadItemImpl::kMaxAutoResumeAttempts = 5; | 105 const int DownloadItemImpl::kMaxAutoResumeAttempts = 5; |
| 106 | 106 |
| 107 // Constructor for reading from the history service. | 107 // Constructor for reading from the history service. |
| 108 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, | 108 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, |
| 109 const std::string& guid, | 109 const std::string& guid, |
| 110 uint32_t download_id, | 110 uint32_t download_id, |
| 111 const base::FilePath& current_path, | 111 const base::FilePath& current_path, |
| 112 const base::FilePath& target_path, | 112 const base::FilePath& target_path, |
| 113 const std::vector<GURL>& url_chain, | 113 const std::vector<GURL>& url_chain, |
| 114 const GURL& referrer_url, | 114 const GURL& referrer_url, |
| 115 const GURL& tab_url, |
| 116 const GURL& tab_refererr_url, |
| 115 const std::string& mime_type, | 117 const std::string& mime_type, |
| 116 const std::string& original_mime_type, | 118 const std::string& original_mime_type, |
| 117 const base::Time& start_time, | 119 const base::Time& start_time, |
| 118 const base::Time& end_time, | 120 const base::Time& end_time, |
| 119 const std::string& etag, | 121 const std::string& etag, |
| 120 const std::string& last_modified, | 122 const std::string& last_modified, |
| 121 int64_t received_bytes, | 123 int64_t received_bytes, |
| 122 int64_t total_bytes, | 124 int64_t total_bytes, |
| 123 const std::string& hash, | 125 const std::string& hash, |
| 124 DownloadItem::DownloadState state, | 126 DownloadItem::DownloadState state, |
| 125 DownloadDangerType danger_type, | 127 DownloadDangerType danger_type, |
| 126 DownloadInterruptReason interrupt_reason, | 128 DownloadInterruptReason interrupt_reason, |
| 127 bool opened, | 129 bool opened, |
| 128 const net::BoundNetLog& bound_net_log) | 130 const net::BoundNetLog& bound_net_log) |
| 129 : guid_(base::ToUpperASCII(guid)), | 131 : guid_(base::ToUpperASCII(guid)), |
| 130 download_id_(download_id), | 132 download_id_(download_id), |
| 131 target_path_(target_path), | 133 target_path_(target_path), |
| 132 url_chain_(url_chain), | 134 url_chain_(url_chain), |
| 133 referrer_url_(referrer_url), | 135 referrer_url_(referrer_url), |
| 136 tab_url_(tab_url), |
| 137 tab_referrer_url_(tab_refererr_url), |
| 134 mime_type_(mime_type), | 138 mime_type_(mime_type), |
| 135 original_mime_type_(original_mime_type), | 139 original_mime_type_(original_mime_type), |
| 136 total_bytes_(total_bytes), | 140 total_bytes_(total_bytes), |
| 137 last_reason_(interrupt_reason), | 141 last_reason_(interrupt_reason), |
| 138 start_tick_(base::TimeTicks()), | 142 start_tick_(base::TimeTicks()), |
| 139 state_(ExternalToInternalState(state)), | 143 state_(ExternalToInternalState(state)), |
| 140 danger_type_(danger_type), | 144 danger_type_(danger_type), |
| 141 start_time_(start_time), | 145 start_time_(start_time), |
| 142 end_time_(end_time), | 146 end_time_(end_time), |
| 143 delegate_(delegate), | 147 delegate_(delegate), |
| (...skipping 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 case RESUME_MODE_USER_CONTINUE: | 2087 case RESUME_MODE_USER_CONTINUE: |
| 2084 return "USER_CONTINUE"; | 2088 return "USER_CONTINUE"; |
| 2085 case RESUME_MODE_USER_RESTART: | 2089 case RESUME_MODE_USER_RESTART: |
| 2086 return "USER_RESTART"; | 2090 return "USER_RESTART"; |
| 2087 } | 2091 } |
| 2088 NOTREACHED() << "Unknown resume mode " << mode; | 2092 NOTREACHED() << "Unknown resume mode " << mode; |
| 2089 return "unknown"; | 2093 return "unknown"; |
| 2090 } | 2094 } |
| 2091 | 2095 |
| 2092 } // namespace content | 2096 } // namespace content |
| OLD | NEW |