| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // The maximum number of attempts we will make to resume automatically. | 96 // The maximum number of attempts we will make to resume automatically. |
| 97 const int DownloadItemImpl::kMaxAutoResumeAttempts = 5; | 97 const int DownloadItemImpl::kMaxAutoResumeAttempts = 5; |
| 98 | 98 |
| 99 // Constructor for reading from the history service. | 99 // Constructor for reading from the history service. |
| 100 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, | 100 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, |
| 101 uint32 download_id, | 101 uint32 download_id, |
| 102 const base::FilePath& current_path, | 102 const base::FilePath& current_path, |
| 103 const base::FilePath& target_path, | 103 const base::FilePath& target_path, |
| 104 const std::vector<GURL>& url_chain, | 104 const std::vector<GURL>& url_chain, |
| 105 const GURL& referrer_url, | 105 const GURL& referrer_url, |
| 106 const std::string& mime_type, |
| 107 const std::string& original_mime_type, |
| 106 const base::Time& start_time, | 108 const base::Time& start_time, |
| 107 const base::Time& end_time, | 109 const base::Time& end_time, |
| 108 const std::string& etag, | 110 const std::string& etag, |
| 109 const std::string& last_modified, | 111 const std::string& last_modified, |
| 110 int64 received_bytes, | 112 int64 received_bytes, |
| 111 int64 total_bytes, | 113 int64 total_bytes, |
| 112 DownloadItem::DownloadState state, | 114 DownloadItem::DownloadState state, |
| 113 DownloadDangerType danger_type, | 115 DownloadDangerType danger_type, |
| 114 DownloadInterruptReason interrupt_reason, | 116 DownloadInterruptReason interrupt_reason, |
| 115 bool opened, | 117 bool opened, |
| 116 const net::BoundNetLog& bound_net_log) | 118 const net::BoundNetLog& bound_net_log) |
| 117 : is_save_package_download_(false), | 119 : is_save_package_download_(false), |
| 118 download_id_(download_id), | 120 download_id_(download_id), |
| 119 current_path_(current_path), | 121 current_path_(current_path), |
| 120 target_path_(target_path), | 122 target_path_(target_path), |
| 121 target_disposition_(TARGET_DISPOSITION_OVERWRITE), | 123 target_disposition_(TARGET_DISPOSITION_OVERWRITE), |
| 122 url_chain_(url_chain), | 124 url_chain_(url_chain), |
| 123 referrer_url_(referrer_url), | 125 referrer_url_(referrer_url), |
| 124 transition_type_(PAGE_TRANSITION_LINK), | 126 transition_type_(PAGE_TRANSITION_LINK), |
| 125 has_user_gesture_(false), | 127 has_user_gesture_(false), |
| 128 mime_type_(mime_type), |
| 129 original_mime_type_(original_mime_type), |
| 126 total_bytes_(total_bytes), | 130 total_bytes_(total_bytes), |
| 127 received_bytes_(received_bytes), | 131 received_bytes_(received_bytes), |
| 128 bytes_per_sec_(0), | 132 bytes_per_sec_(0), |
| 129 last_modified_time_(last_modified), | 133 last_modified_time_(last_modified), |
| 130 etag_(etag), | 134 etag_(etag), |
| 131 last_reason_(interrupt_reason), | 135 last_reason_(interrupt_reason), |
| 132 start_tick_(base::TimeTicks()), | 136 start_tick_(base::TimeTicks()), |
| 133 state_(ExternalToInternalState(state)), | 137 state_(ExternalToInternalState(state)), |
| 134 danger_type_(danger_type), | 138 danger_type_(danger_type), |
| 135 start_time_(start_time), | 139 start_time_(start_time), |
| (...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 case RESUME_MODE_USER_CONTINUE: | 1756 case RESUME_MODE_USER_CONTINUE: |
| 1753 return "USER_CONTINUE"; | 1757 return "USER_CONTINUE"; |
| 1754 case RESUME_MODE_USER_RESTART: | 1758 case RESUME_MODE_USER_RESTART: |
| 1755 return "USER_RESTART"; | 1759 return "USER_RESTART"; |
| 1756 } | 1760 } |
| 1757 NOTREACHED() << "Unknown resume mode " << mode; | 1761 NOTREACHED() << "Unknown resume mode " << mode; |
| 1758 return "unknown"; | 1762 return "unknown"; |
| 1759 } | 1763 } |
| 1760 | 1764 |
| 1761 } // namespace content | 1765 } // namespace content |
| OLD | NEW |