Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: content/browser/download/download_item_impl.cc

Issue 13044019: Clean up entries left by crashes in the DownloadDB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Shift cleanup to DownloadDatabase. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 const DownloadCreateInfo& info, 143 const DownloadCreateInfo& info,
147 const net::BoundNetLog& bound_net_log) 144 const net::BoundNetLog& bound_net_log)
148 : is_save_package_download_(false), 145 : is_save_package_download_(false),
149 download_id_(info.download_id), 146 download_id_(info.download_id),
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 case RESUME_MODE_USER_CONTINUE: 1672 case RESUME_MODE_USER_CONTINUE:
1676 return "USER_CONTINUE"; 1673 return "USER_CONTINUE";
1677 case RESUME_MODE_USER_RESTART: 1674 case RESUME_MODE_USER_RESTART:
1678 return "USER_RESTART"; 1675 return "USER_RESTART";
1679 } 1676 }
1680 NOTREACHED() << "Unknown resume mode " << mode; 1677 NOTREACHED() << "Unknown resume mode " << mode;
1681 return "unknown"; 1678 return "unknown";
1682 } 1679 }
1683 1680
1684 } // namespace content 1681 } // namespace content
OLDNEW
« chrome/browser/history/history_unittest.cc ('K') | « chrome/browser/history/history_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698