diff options
Diffstat (limited to 'content/browser/download/download_item.h')
-rw-r--r-- | content/browser/download/download_item.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/content/browser/download/download_item.h b/content/browser/download/download_item.h index 07c43fe..7a81aa0 100644 --- a/content/browser/download/download_item.h +++ b/content/browser/download/download_item.h @@ -157,16 +157,11 @@ class CONTENT_EXPORT DownloadItem { // Received a new chunk of data void Update(int64 bytes_so_far); - // Cancel the download operation. We need to distinguish between cancels at - // exit (DownloadManager destructor) from user interface initiated cancels - // because at exit, the history system may not exist, and any updates to it - // require AddRef'ing the DownloadManager in the destructor which results in - // a DCHECK failure. Set 'update_history' to false when canceling from at - // exit to prevent this crash. This may result in a difference between the - // downloaded file's size on disk, and what the history system's last record - // of it is. At worst, we'll end up re-downloading a small portion of the file - // when resuming a download (assuming the server supports byte ranges). - void Cancel(bool update_history); + // Cancel the download operation. This may be called at any time; if + // it is called before all download attributes have been finalized and + // the download entered into the history, it will remove the download from + // the system. + void Cancel(); // Called by external code (SavePackage) using the DownloadItem interface // to display progress when the DownloadItem should be considered complete. @@ -182,10 +177,14 @@ class CONTENT_EXPORT DownloadItem { // Called when the downloaded file is removed. void OnDownloadedFileRemoved(); - // Download operation had an error. - // |size| is the amount of data received at interruption. - // |error| is the network error code that the operation received. - void Interrupted(int64 size, net::Error error); + // Download operation had an error; call to interrupt the processing. + // Note that if the download attributes haven't yet been finalized and + // the download entered into the history (which implies that it hasn't + // yet been made visible in the UI), this call will remove the + // download from the system. + // |size| is the amount of data received so far, and |net_error| is the + // error code that the operation received. + void Interrupt(int64 size, net::Error net_error); // Deletes the file from disk and removes the download from the views and // history. |user| should be true if this is the result of the user clicking @@ -357,7 +356,8 @@ class CONTENT_EXPORT DownloadItem { void StartProgressTimer(); void StopProgressTimer(); - // Call to transition state; all state transitions should go through this. + // Does the actual work of transition state; all state + // transitions should go through this. void TransitionTo(DownloadState new_state); // Called when safety_state_ should be recomputed from is_dangerous_file |