| 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) {
|
|
|