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

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

Issue 11028131: Shift passage of FileStream in downloads system to be by scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated Al's comments. Created 8 years, 2 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 5 // File method ordering: Methods in this file are in the same order
6 // as in download_item_impl.h, with the following exception: The public 6 // as in download_item_impl.h, with the following exception: The public
7 // interfaces DelayedDownloadOpened, OnDownloadTargetDetermined, and 7 // interfaces DelayedDownloadOpened, OnDownloadTargetDetermined, and
8 // OnDownloadCompleting are placed in chronological order with the other 8 // OnDownloadCompleting are placed in chronological order with the other
9 // (private) routines that together define a DownloadItem's state transitions 9 // (private) routines that together define a DownloadItem's state transitions
10 // as the download progresses. See "Download progression cascade" later in 10 // as the download progresses. See "Download progression cascade" later in
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 const DownloadCreateInfo& info, 176 const DownloadCreateInfo& info,
177 scoped_ptr<DownloadRequestHandleInterface> request_handle, 177 scoped_ptr<DownloadRequestHandleInterface> request_handle,
178 const net::BoundNetLog& bound_net_log) 178 const net::BoundNetLog& bound_net_log)
179 : request_handle_(request_handle.Pass()), 179 : request_handle_(request_handle.Pass()),
180 download_id_(info.download_id), 180 download_id_(info.download_id),
181 target_disposition_( 181 target_disposition_(
182 (info.prompt_user_for_save_location) ? 182 (info.prompt_user_for_save_location) ?
183 TARGET_DISPOSITION_PROMPT : TARGET_DISPOSITION_OVERWRITE), 183 TARGET_DISPOSITION_PROMPT : TARGET_DISPOSITION_OVERWRITE),
184 url_chain_(info.url_chain), 184 url_chain_(info.url_chain),
185 referrer_url_(info.referrer_url), 185 referrer_url_(info.referrer_url),
186 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), 186 suggested_filename_(UTF16ToUTF8(info.save_info->suggested_name)),
187 forced_file_path_(info.save_info.file_path), 187 forced_file_path_(info.save_info->file_path),
188 transition_type_(info.transition_type), 188 transition_type_(info.transition_type),
189 has_user_gesture_(info.has_user_gesture), 189 has_user_gesture_(info.has_user_gesture),
190 content_disposition_(info.content_disposition), 190 content_disposition_(info.content_disposition),
191 mime_type_(info.mime_type), 191 mime_type_(info.mime_type),
192 original_mime_type_(info.original_mime_type), 192 original_mime_type_(info.original_mime_type),
193 referrer_charset_(info.referrer_charset), 193 referrer_charset_(info.referrer_charset),
194 remote_address_(info.remote_address), 194 remote_address_(info.remote_address),
195 total_bytes_(info.total_bytes), 195 total_bytes_(info.total_bytes),
196 received_bytes_(0), 196 received_bytes_(0),
197 bytes_per_sec_(0), 197 bytes_per_sec_(0),
198 last_reason_(content::DOWNLOAD_INTERRUPT_REASON_NONE), 198 last_reason_(content::DOWNLOAD_INTERRUPT_REASON_NONE),
199 start_tick_(base::TimeTicks::Now()), 199 start_tick_(base::TimeTicks::Now()),
200 state_(IN_PROGRESS_INTERNAL), 200 state_(IN_PROGRESS_INTERNAL),
201 danger_type_(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS), 201 danger_type_(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS),
202 start_time_(info.start_time), 202 start_time_(info.start_time),
203 db_handle_(DownloadItem::kUninitializedHandle), 203 db_handle_(DownloadItem::kUninitializedHandle),
204 delegate_(delegate), 204 delegate_(delegate),
205 is_paused_(false), 205 is_paused_(false),
206 open_when_complete_(false), 206 open_when_complete_(false),
207 file_externally_removed_(false), 207 file_externally_removed_(false),
208 safety_state_(SAFE), 208 safety_state_(SAFE),
209 auto_opened_(false), 209 auto_opened_(false),
210 is_persisted_(false), 210 is_persisted_(false),
211 is_temporary_(!info.save_info.file_path.empty()), 211 is_temporary_(!info.save_info->file_path.empty()),
212 all_data_saved_(false), 212 all_data_saved_(false),
213 opened_(false), 213 opened_(false),
214 open_enabled_(true), 214 open_enabled_(true),
215 delegate_delayed_complete_(false), 215 delegate_delayed_complete_(false),
216 bound_net_log_(bound_net_log), 216 bound_net_log_(bound_net_log),
217 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { 217 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
218 delegate_->Attach(); 218 delegate_->Attach();
219 Init(true /* actively downloading */, 219 Init(true /* actively downloading */,
220 download_net_logs::SRC_NEW_DOWNLOAD); 220 download_net_logs::SRC_NEW_DOWNLOAD);
221 221
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 return "COMPLETE"; 1280 return "COMPLETE";
1281 case CANCELLED_INTERNAL: 1281 case CANCELLED_INTERNAL:
1282 return "CANCELLED"; 1282 return "CANCELLED";
1283 case INTERRUPTED_INTERNAL: 1283 case INTERRUPTED_INTERNAL:
1284 return "INTERRUPTED"; 1284 return "INTERRUPTED";
1285 default: 1285 default:
1286 NOTREACHED() << "Unknown download state " << state; 1286 NOTREACHED() << "Unknown download state " << state;
1287 return "unknown"; 1287 return "unknown";
1288 }; 1288 };
1289 } 1289 }
OLDNEW
« no previous file with comments | « content/browser/download/download_file_unittest.cc ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698