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

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: Rebase + Address comments + Update strings 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 802fec5e6b26673d03d6173d0f42105cb001ad66..92f5110f2568b4cb7ef7522ff5b6025f3afb7bd6 100644
--- a/content/browser/download/download_file_impl.cc
+++ b/content/browser/download/download_file_impl.cc
@@ -132,29 +132,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();
-
+ 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();
}
« no previous file with comments | « content/browser/download/download_file_impl.h ('k') | content/browser/download/download_interrupt_reasons_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698