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

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

Issue 6932046: Added DownloadProcessHandle class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments. Created 9 years, 7 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 | « chrome/browser/download/download_util.h ('k') | chrome/browser/history/download_create_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 720d03ada869e36bdb2244d3985127b9072779e4..6652490969e3cdccec6c5f55cc1926ab0f60363a 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -814,13 +814,24 @@ void DownloadUrl(
context);
}
-void CancelDownloadRequest(ResourceDispatcherHost* rdh,
- int render_process_id,
- int request_id) {
+static void CancelDownloadRequestOnIOThread(
+ ResourceDispatcherHost* rdh, DownloadProcessHandle process_handle) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// |rdh| may be NULL in unit tests.
- if (rdh)
- rdh->CancelRequest(render_process_id, request_id, false);
+ if (!rdh)
+ return;
+
+ rdh->CancelRequest(process_handle.child_id(),
+ process_handle.request_id(),
+ false);
+}
+
+void CancelDownloadRequest(ResourceDispatcherHost* rdh,
+ DownloadProcessHandle process_handle) {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableFunction(&download_util::CancelDownloadRequestOnIOThread,
+ rdh, process_handle));
}
void NotifyDownloadInitiated(int render_process_id, int render_view_id) {
« no previous file with comments | « chrome/browser/download/download_util.h ('k') | chrome/browser/history/download_create_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698