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

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

Issue 11150027: Handle the case where IAttachmentExecute::Save() deletes a downloaded file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_item_impl.cc
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index d0984add840f7819230ee1b52fbbf8977952da43..0c814a4547b08f2da071bf46d7d38e5776fb22dc 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -821,7 +821,7 @@ void DownloadItemImpl::Interrupt(content::DownloadInterruptReason reason) {
// interrupts to race with cancels.
// Whatever happens, the first one to hit the UI thread wins.
- if (state_ != IN_PROGRESS_INTERNAL)
+ if (state_ != IN_PROGRESS_INTERNAL && state_ != COMPLETING_INTERNAL)
return;
last_reason_ = reason;
@@ -1090,7 +1090,12 @@ void DownloadItemImpl::OnDownloadRenamedToFinalName(
TransitionTo(COMPLETING_INTERNAL);
}
-void DownloadItemImpl::OnDownloadFileReleased() {
+void DownloadItemImpl::OnDownloadFileReleased(
+ content::DownloadInterruptReason reason) {
+ if (content::DOWNLOAD_INTERRUPT_REASON_NONE != reason) {
+ Interrupt(reason);
+ return;
+ }
if (delegate_->ShouldOpenDownload(this))
Completed();
else

Powered by Google App Engine
This is Rietveld 408576698