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

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: Moved process_handle_ initializer in DownloadItem constructor. 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
Index: chrome/browser/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 72a0b92176a75a9d30106a08755e7c12ca0e4f01..4c2fe453607e99332f0d168845434fb8be9acdd6 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -813,13 +813,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) {

Powered by Google App Engine
This is Rietveld 408576698