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

Unified Diff: chrome/browser/download/download_file.cc

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications Created 11 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: chrome/browser/download/download_file.cc
===================================================================
--- chrome/browser/download/download_file.cc (revision 30037)
+++ chrome/browser/download/download_file.cc (working copy)
@@ -254,8 +254,10 @@
// about this download so we have to clean up 'info'. We need to get back
// to the IO thread to cancel the network request and CancelDownloadRequest
// on the UI thread is the safe way to do that.
- ui_loop_->PostTask(FROM_HERE,
- NewRunnableFunction(&DownloadManager::CancelDownloadRequest,
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableFunction(&DownloadManager::OnCancelDownloadRequest,
+ resource_dispatcher_host_,
info->child_id,
info->request_id));
delete info;
@@ -385,7 +387,12 @@
DownloadManager* manager = DownloadManagerFromRenderIds(info->child_id,
info->render_view_id);
if (!manager) {
- DownloadManager::CancelDownloadRequest(info->child_id, info->request_id);
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableFunction(&DownloadManager::OnCancelDownloadRequest,
+ resource_dispatcher_host_,
+ info->child_id,
+ info->request_id));
delete info;
return;
}
@@ -607,9 +614,11 @@
&DownloadManager::DownloadCancelled,
id));
} else {
- ui_loop_->PostTask(FROM_HERE,
- NewRunnableFunction(&DownloadManager::CancelDownloadRequest,
- download->child_id(),
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableFunction(&DownloadManager::OnCancelDownloadRequest,
+ resource_dispatcher_host_,
+ download->child_id(),
download->request_id()));
darin (slow to review) 2009/10/27 00:06:52 nit: indentation
jam 2009/10/27 02:38:18 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698