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

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

Issue 8343042: Replace NewRunnableMethod with Callback in DownloadResourceHandler. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: add missing include 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_resource_handler.cc
===================================================================
--- content/browser/download/download_resource_handler.cc (revision 107442)
+++ content/browser/download/download_resource_handler.cc (working copy)
@@ -6,6 +6,7 @@
#include <string>
+#include "base/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/metrics/stats_counters.h"
@@ -16,7 +17,6 @@
#include "content/browser/download/download_file_manager.h"
#include "content/browser/download/download_item.h"
#include "content/browser/download/download_request_handle.h"
-#include "content/browser/download/download_request_handle.h"
#include "content/browser/download/download_stats.h"
#include "content/browser/download/interrupt_reasons.h"
#include "content/browser/renderer_host/global_request_id.h"
@@ -123,9 +123,8 @@
info->save_info = save_info_;
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(
- download_file_manager_, &DownloadFileManager::StartDownload,
- info, request_handle));
+ base::Bind(&DownloadFileManager::StartDownload,
+ download_file_manager_, info, request_handle));
// We can't start saving the data before we create the file on disk.
// The request will be un-paused in DownloadFileManager::CreateDownloadFile.
@@ -176,10 +175,8 @@
if (need_update) {
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(download_file_manager_,
- &DownloadFileManager::UpdateDownload,
- download_id_,
- buffer_));
+ base::Bind(&DownloadFileManager::UpdateDownload,
+ download_file_manager_, download_id_, buffer_));
}
// We schedule a pause outside of the read loop if there is too much file
@@ -224,11 +221,8 @@
// before deletion.
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(download_file_manager_,
- &DownloadFileManager::OnResponseCompleted,
- download_id_,
- reason,
- security_info));
+ base::Bind(&DownloadFileManager::OnResponseCompleted,
+ download_file_manager_, download_id_, reason, security_info));
buffer_ = NULL; // The buffer is longer needed by |DownloadResourceHandler|.
read_buffer_ = NULL;
return true;
« 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