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

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

Issue 10823203: Fix downloads db state=3 corruption using version=23 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: version=23 Created 8 years, 4 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 #include "content/browser/download/download_item_impl.h" 5 #include "content/browser/download/download_item_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 target_disposition_(TARGET_DISPOSITION_OVERWRITE), 152 target_disposition_(TARGET_DISPOSITION_OVERWRITE),
153 url_chain_(1, info.url), 153 url_chain_(1, info.url),
154 referrer_url_(info.referrer_url), 154 referrer_url_(info.referrer_url),
155 transition_type_(content::PAGE_TRANSITION_LINK), 155 transition_type_(content::PAGE_TRANSITION_LINK),
156 has_user_gesture_(false), 156 has_user_gesture_(false),
157 total_bytes_(info.total_bytes), 157 total_bytes_(info.total_bytes),
158 received_bytes_(info.received_bytes), 158 received_bytes_(info.received_bytes),
159 bytes_per_sec_(0), 159 bytes_per_sec_(0),
160 last_reason_(content::DOWNLOAD_INTERRUPT_REASON_NONE), 160 last_reason_(content::DOWNLOAD_INTERRUPT_REASON_NONE),
161 start_tick_(base::TimeTicks()), 161 start_tick_(base::TimeTicks()),
162 state_(static_cast<DownloadState>(info.state)), 162 state_(info.state),
163 danger_type_(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS), 163 danger_type_(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS),
164 start_time_(info.start_time), 164 start_time_(info.start_time),
165 end_time_(info.end_time), 165 end_time_(info.end_time),
166 db_handle_(info.db_handle), 166 db_handle_(info.db_handle),
167 delegate_(delegate), 167 delegate_(delegate),
168 is_paused_(false), 168 is_paused_(false),
169 open_when_complete_(false), 169 open_when_complete_(false),
170 file_externally_removed_(false), 170 file_externally_removed_(false),
171 safety_state_(SAFE), 171 safety_state_(SAFE),
172 auto_opened_(false), 172 auto_opened_(false),
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 std::map<const void*, ExternalData*>::iterator it = 1191 std::map<const void*, ExternalData*>::iterator it =
1192 external_data_map_.find(key); 1192 external_data_map_.find(key);
1193 1193
1194 if (it == external_data_map_.end()) { 1194 if (it == external_data_map_.end()) {
1195 external_data_map_[key] = data; 1195 external_data_map_[key] = data;
1196 } else if (it->second != data) { 1196 } else if (it->second != data) {
1197 delete it->second; 1197 delete it->second;
1198 it->second = data; 1198 it->second = data;
1199 } 1199 }
1200 } 1200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698