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

Unified Diff: content/browser/android/download_controller_android_impl.cc

Issue 1467563002: Use ResourceRequestInfo::GetWebContents in DownloadRequestLimiter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-contents-callback
Patch Set: Created 5 years, 1 month 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: content/browser/android/download_controller_android_impl.cc
diff --git a/content/browser/android/download_controller_android_impl.cc b/content/browser/android/download_controller_android_impl.cc
index be0b9018350d4c94026a1741fbcd453b6e6cddd1..8058f0c6e4f8b909b40395c07a608c0a1cdf1450 100644
--- a/content/browser/android/download_controller_android_impl.cc
+++ b/content/browser/android/download_controller_android_impl.cc
@@ -181,11 +181,9 @@ void DownloadControllerAndroidImpl::CancelDeferredDownload(
}
void DownloadControllerAndroidImpl::AcquireFileAccessPermission(
- int render_process_id,
- int render_view_id,
+ WebContents* web_contents,
const DownloadControllerAndroid::AcquireFileAccessPermissionCallback& cb) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- WebContents* web_contents = GetWebContents(render_process_id, render_view_id);
if (!web_contents) {
davidben 2015/11/24 15:51:16 Nit: I'd probably have moved this into the caller.
clamy 2015/11/25 14:02:02 Done. Note that the caller now run the callback sy
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE, base::Bind(cb, false));
@@ -354,7 +352,7 @@ void DownloadControllerAndroidImpl::StartAndroidDownload(
}
AcquireFileAccessPermission(
- render_process_id, render_view_id,
+ web_contents,
base::Bind(&DownloadControllerAndroidImpl::StartAndroidDownloadInternal,
base::Unretained(this), render_process_id, render_view_id,
info));
@@ -530,9 +528,8 @@ void DownloadControllerAndroidImpl::StartContextMenuDownload(
int process_id = web_contents->GetRenderProcessHost()->GetID();
int routing_id = web_contents->GetRoutingID();
AcquireFileAccessPermission(
- process_id, routing_id,
- base::Bind(&CreateContextMenuDownload, process_id, routing_id, params,
- is_link, extra_headers));
+ web_contents, base::Bind(&CreateContextMenuDownload, process_id,
+ routing_id, params, is_link, extra_headers));
}
void DownloadControllerAndroidImpl::DangerousDownloadValidated(

Powered by Google App Engine
This is Rietveld 408576698