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

Unified Diff: content/browser/download/download_file_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: Fix Android 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_file_impl.cc
diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc
index c01859972fc80793d8da752b159cbd5b997fba19..44afb7b85ca8a8cfea5d3348c70e9c8ef4d37199 100644
--- a/content/browser/download/download_file_impl.cc
+++ b/content/browser/download/download_file_impl.cc
@@ -134,29 +134,24 @@ void DownloadFileImpl::Rename(const FilePath& full_path,
base::Bind(callback, reason, new_path));
}
-void DownloadFileImpl::Detach(base::Closure callback) {
+void DownloadFileImpl::Detach(const DetachCompletionCallback& callback) {
// Doing the annotation here leaves a small window during
// which the file has the final name but hasn't been marked with the
// Mark Of The Web. However, it allows anti-virus scanners on Windows
// to actually see the data (http://crbug.com/127999), and the Window
// is pretty small (round trip to the UI thread).
- AnnotateWithSourceInformation();
-
+ content::DownloadInterruptReason interrupt_reason =
+ file_.AnnotateWithSourceInformation();
file_.Detach();
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(callback, interrupt_reason));
}
void DownloadFileImpl::Cancel() {
file_.Cancel();
}
-void DownloadFileImpl::AnnotateWithSourceInformation() {
- bound_net_log_.BeginEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED);
- file_.AnnotateWithSourceInformation();
- bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED);
-}
-
FilePath DownloadFileImpl::FullPath() const {
return file_.full_path();
}

Powered by Google App Engine
This is Rietveld 408576698