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

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

Issue 8413016: Replace NewRunnableMethod with Callback in DownloadItem. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_item.cc
===================================================================
--- content/browser/download/download_item.cc (revision 107442)
+++ content/browser/download/download_item.cc (working copy)
@@ -4,6 +4,9 @@
#include "content/browser/download/download_item.h"
+#include <vector>
+
+#include "base/bind.h"
#include "base/basictypes.h"
#include "base/file_util.h"
#include "base/format_macros.h"
@@ -506,7 +509,7 @@
}
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- NewRunnableFunction(&DeleteDownloadedFile, full_path_));
+ base::Bind(&DeleteDownloadedFile, full_path_));
Remove();
// We have now been deleted.
}
@@ -595,16 +598,17 @@
if (NeedsRename()) {
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(file_manager,
- &DownloadFileManager::RenameCompletingDownloadFile, global_id(),
- GetTargetFilePath(), safety_state() == SAFE));
+ base::Bind(&DownloadFileManager::RenameCompletingDownloadFile,
+ file_manager, global_id(),
+ GetTargetFilePath(), safety_state() == SAFE));
return;
}
Completed();
- BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableMethod(
- file_manager, &DownloadFileManager::CompleteDownload, global_id()));
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ base::Bind(&DownloadFileManager::CompleteDownload,
+ file_manager, global_id()));
}
void DownloadItem::OnDownloadRenamedToFinalName(const FilePath& full_path) {
@@ -724,10 +728,9 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
request_handle_.CancelRequest();
- BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(
- file_manager, &DownloadFileManager::CancelDownload, global_id()));
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ base::Bind(&DownloadFileManager::CancelDownload,
+ file_manager, global_id()));
}
void DownloadItem::Init(bool active) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698