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

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

Issue 11150027: Handle the case where IAttachmentExecute::Save() deletes a downloaded file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Address comments + Update strings Created 8 years, 1 month 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 private: 201 private:
202 // Fine grained states of a download. 202 // Fine grained states of a download.
203 enum DownloadInternalState { 203 enum DownloadInternalState {
204 // Unless otherwise specified, state transitions are linear forward 204 // Unless otherwise specified, state transitions are linear forward
205 // in this list. 205 // in this list.
206 206
207 // Includes both before and after file name determination. 207 // Includes both before and after file name determination.
208 // TODO(rdsmith): Put in state variable for file name determination. 208 // TODO(rdsmith): Put in state variable for file name determination.
209 IN_PROGRESS_INTERNAL, 209 IN_PROGRESS_INTERNAL,
210 210
211 // Between commit point (dispatch of download file release) and 211 // Between commit point (dispatch of download file release) and completed.
212 // completed. Embedder may be opening the file in this state. 212 // Embedder may be opening the file in this state. Note that the
213 // Note that the DownloadItem may be deleted (by shutdown) in this 213 // DownloadItem may be deleted (by shutdown) or interrupted (e.g. due to a
214 // state. 214 // failure during AnnotateWithSourceInformation()) in this state.
215 COMPLETING_INTERNAL, 215 COMPLETING_INTERNAL,
216 216
217 // After embedder has had a chance to auto-open. User may now open 217 // After embedder has had a chance to auto-open. User may now open
218 // or auto-open based on extension. 218 // or auto-open based on extension.
219 COMPLETE_INTERNAL, 219 COMPLETE_INTERNAL,
220 220
221 // User has cancelled the download. 221 // User has cancelled the download.
222 // Only incoming transition IN_PROGRESS-> 222 // Only incoming transition IN_PROGRESS->
223 CANCELLED_INTERNAL, 223 CANCELLED_INTERNAL,
224 224
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 // Called after the delegate has given the go-ahead to actually complete 273 // Called after the delegate has given the go-ahead to actually complete
274 // the download. 274 // the download.
275 void ReadyForDownloadCompletionDone(); 275 void ReadyForDownloadCompletionDone();
276 276
277 void OnDownloadRenamedToFinalName(DownloadInterruptReason reason, 277 void OnDownloadRenamedToFinalName(DownloadInterruptReason reason,
278 const FilePath& full_path); 278 const FilePath& full_path);
279 279
280 void ReleaseDownloadFile(); 280 void ReleaseDownloadFile();
281 281
282 void OnDownloadFileReleased(); 282 // TODO(rdsmith,asanka): Move the AnnotateWithSourceInformation() call to the
283 // final rename and eliminate the interrupt reason callback.
284 void OnDownloadFileReleased(DownloadInterruptReason reason);
283 285
284 // Called when the entire download operation (including renaming etc) 286 // Called when the entire download operation (including renaming etc)
285 // is completed. 287 // is completed.
286 void Completed(); 288 void Completed();
287 289
288 // Helper routines ----------------------------------------------------------- 290 // Helper routines -----------------------------------------------------------
289 291
290 // Cancel the DownloadFile if we have it. 292 // Cancel the DownloadFile if we have it.
291 void CancelDownloadFile(); 293 void CancelDownloadFile();
292 294
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 const net::BoundNetLog bound_net_log_; 481 const net::BoundNetLog bound_net_log_;
480 482
481 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; 483 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_;
482 484
483 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); 485 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl);
484 }; 486 };
485 487
486 } // namespace content 488 } // namespace content
487 489
488 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ 490 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_interrupt_reasons_impl.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698