| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 file_externally_removed_(false), | 126 file_externally_removed_(false), |
| 127 auto_opened_(false), | 127 auto_opened_(false), |
| 128 is_temporary_(false), | 128 is_temporary_(false), |
| 129 all_data_saved_(state == COMPLETE), | 129 all_data_saved_(state == COMPLETE), |
| 130 destination_error_(content::DOWNLOAD_INTERRUPT_REASON_NONE), | 130 destination_error_(content::DOWNLOAD_INTERRUPT_REASON_NONE), |
| 131 opened_(opened), | 131 opened_(opened), |
| 132 delegate_delayed_complete_(false), | 132 delegate_delayed_complete_(false), |
| 133 bound_net_log_(bound_net_log), | 133 bound_net_log_(bound_net_log), |
| 134 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { | 134 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
| 135 delegate_->Attach(); | 135 delegate_->Attach(); |
| 136 if (state_ == IN_PROGRESS_INTERNAL) { | 136 DCHECK_NE(IN_PROGRESS_INTERNAL, state_); |
| 137 state_ = INTERRUPTED_INTERNAL; | |
| 138 last_reason_ = DOWNLOAD_INTERRUPT_REASON_CRASH; | |
| 139 } | |
| 140 Init(false /* not actively downloading */, SRC_HISTORY_IMPORT); | 137 Init(false /* not actively downloading */, SRC_HISTORY_IMPORT); |
| 141 } | 138 } |
| 142 | 139 |
| 143 // Constructing for a regular download: | 140 // Constructing for a regular download: |
| 144 DownloadItemImpl::DownloadItemImpl( | 141 DownloadItemImpl::DownloadItemImpl( |
| 145 DownloadItemImplDelegate* delegate, | 142 DownloadItemImplDelegate* delegate, |
| 146 DownloadId download_id, | 143 DownloadId download_id, |
| 147 const DownloadCreateInfo& info, | 144 const DownloadCreateInfo& info, |
| 148 const net::BoundNetLog& bound_net_log) | 145 const net::BoundNetLog& bound_net_log) |
| 149 : is_save_package_download_(false), | 146 : is_save_package_download_(false), |
| (...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 case RESUME_MODE_USER_CONTINUE: | 1673 case RESUME_MODE_USER_CONTINUE: |
| 1677 return "USER_CONTINUE"; | 1674 return "USER_CONTINUE"; |
| 1678 case RESUME_MODE_USER_RESTART: | 1675 case RESUME_MODE_USER_RESTART: |
| 1679 return "USER_RESTART"; | 1676 return "USER_RESTART"; |
| 1680 } | 1677 } |
| 1681 NOTREACHED() << "Unknown resume mode " << mode; | 1678 NOTREACHED() << "Unknown resume mode " << mode; |
| 1682 return "unknown"; | 1679 return "unknown"; |
| 1683 } | 1680 } |
| 1684 | 1681 |
| 1685 } // namespace content | 1682 } // namespace content |
| OLD | NEW |