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

Unified Diff: content/browser/download/download_browsertest.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
« no previous file with comments | « content/browser/download/base_file_win.cc ('k') | content/browser/download/download_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_browsertest.cc
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index 65c1d9ea6195690802640c225a6631a9678b838d..8630841ab5e9ce302e1ce48f2d3e454f5d2f7a9b 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -97,7 +97,7 @@ class DownloadFileWithDelay : public DownloadFileImpl {
// Wraps DownloadFileImpl::Detach and intercepts the return callback,
// storing it in the factory that produced this object for later
// retrieval.
- virtual void Detach(base::Closure callback) OVERRIDE;
+ virtual void Detach(const DetachCompletionCallback& callback) OVERRIDE;
private:
static void RenameCallbackWrapper(
@@ -108,7 +108,8 @@ class DownloadFileWithDelay : public DownloadFileImpl {
static void DetachCallbackWrapper(
DownloadFileWithDelayFactory* factory,
- const base::Closure& original_callback);
+ const DetachCompletionCallback& original_callback,
+ DownloadInterruptReason interrupt_reason);
// This variable may only be read on the FILE thread, and may only be
// indirected through (e.g. methods on DownloadFileWithDelayFactory called)
@@ -186,7 +187,7 @@ void DownloadFileWithDelay::Rename(const FilePath& full_path,
owner_, callback));
}
-void DownloadFileWithDelay::Detach(base::Closure callback) {
+void DownloadFileWithDelay::Detach(const DetachCompletionCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DownloadFileImpl::Detach(
base::Bind(DownloadFileWithDelay::DetachCallbackWrapper,
@@ -206,9 +207,10 @@ void DownloadFileWithDelay::RenameCallbackWrapper(
// static
void DownloadFileWithDelay::DetachCallbackWrapper(
DownloadFileWithDelayFactory* factory,
- const base::Closure& original_callback) {
+ const DetachCompletionCallback& original_callback,
+ DownloadInterruptReason interrupt_reason) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- factory->AddDetachCallback(original_callback);
+ factory->AddDetachCallback(base::Bind(original_callback, interrupt_reason));
}
DownloadFileWithDelayFactory::DownloadFileWithDelayFactory()
« no previous file with comments | « content/browser/download/base_file_win.cc ('k') | content/browser/download/download_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698