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

Unified Diff: content/browser/download/download_item_impl.h

Issue 14955002: [Resumption 6/11] Add a RESUMING_INTERNAL state to DownloadItem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_item_impl.h
diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h
index 083a1591ab46961772d844a62fc0e199b27c90fe..2c501a993403df74aef6cba108c67cad843e6211 100644
--- a/content/browser/download/download_item_impl.h
+++ b/content/browser/download/download_item_impl.h
@@ -210,33 +210,72 @@ class CONTENT_EXPORT DownloadItemImpl
virtual void MarkAsComplete();
private:
- // Fine grained states of a download.
- enum DownloadInternalState {
- // Unless otherwise specified, state transitions are linear forward
- // in this list.
+ // Fine grained states of a download. Note that active downloads are created
+ // in IN_PROGRESS_INTERNAL state. However, downloads creates via history can
+ // be created in COMPLETE_INTERNAL, CANCELLED_INTERNAL and
+ // INTERRUPTED_INTERNAL.
- // Includes both before and after file name determination.
+ enum DownloadInternalState {
+ // Includes both before and after file name determination, and paused
+ // downloads.
// TODO(rdsmith): Put in state variable for file name determination.
+ // Transitions from:
+ // <Initial creation> Active downloads are created in this state.
+ // RESUMING_INTERNAL
+ // Transitions to:
+ // COMPLETING_INTERNAL On final rename completion.
+ // CANCELLED_INTERNAL On cancel.
+ // INTERRUPTED_INTERNAL On interrupt.
+ // COMPLETE_INTERNAL On SavePackage download completion.
IN_PROGRESS_INTERNAL,
// Between commit point (dispatch of download file release) and completed.
- // Embedder may be opening the file in this state. Note that the
- // DownloadItem may be deleted (by shutdown) or interrupted (e.g. due to a
- // failure during AnnotateWithSourceInformation()) in this state.
+ // Embedder may be opening the file in this state.
+ // Transitions from:
+ // IN_PROGRESS_INTERNAL
+ // Transitions to:
+ // COMPLETE_INTERNAL On successful completion.
COMPLETING_INTERNAL,
// After embedder has had a chance to auto-open. User may now open
// or auto-open based on extension.
+ // Transitions from:
+ // COMPLETING_INTERNAL
+ // IN_PROGRESS_INTERNAL SavePackage only.
+ // <Initial creation> Completed persisted downloads.
+ // Transitions to:
+ // <none> Terminal state.
COMPLETE_INTERNAL,
// User has cancelled the download.
- // Only incoming transition IN_PROGRESS->
+ // Transitions from:
+ // IN_PROGRESS_INTERNAL
+ // INTERRUPTED_INTERNAL
+ // RESUMING_INTERNAL
+ // <Initial creation> Canceleld persisted downloads.
+ // Transitions to:
+ // <none> Terminal state.
CANCELLED_INTERNAL,
// An error has interrupted the download.
- // Only incoming transition IN_PROGRESS->
+ // Transitions from:
+ // IN_PROGRESS_INTERNAL
+ // RESUMING_INTERNAL
+ // <Initial creation> Interrupted persisted downloads.
+ // Transitions to:
+ // RESUMING_INTERNAL On resumption.
INTERRUPTED_INTERNAL,
+ // A request to resume this interrupted download is in progress.
+ // Transitions from:
+ // INTERRUPTED_INTERNAL
+ // Transitions to:
+ // IN_PROGRESS_INTERNAL Once a server response is received from a
+ // resumption.
+ // INTERRUPTED_INTERNAL If the resumption request fails.
+ // CANCELLED_INTERNAL On cancel.
+ RESUMING_INTERNAL,
+
MAX_DOWNLOAD_INTERNAL_STATE,
};
@@ -297,6 +336,9 @@ class CONTENT_EXPORT DownloadItemImpl
// is completed.
void Completed();
+ // Callback invoked when the URLRequest for a download resumption has started.
+ void OnResumeRequestStarted(DownloadItem* item, net::Error error);
+
// Helper routines -----------------------------------------------------------
// Indicate that an error has occurred on the download.
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698