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

Unified Diff: chrome/browser/android/download/download_controller.cc

Issue 2334603002: Fix SSLUITest.TestBadHTTPSDownload with PlzNavigate. (Closed)
Patch Set: fix android temporarily Created 4 years, 3 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/android/download/download_controller.cc
diff --git a/chrome/browser/android/download/download_controller.cc b/chrome/browser/android/download/download_controller.cc
index e32795881ba2a73973a479050f40e7497c08defc..dd2f655b2d158742f3caeb6ca2943ad405924afa 100644
--- a/chrome/browser/android/download/download_controller.cc
+++ b/chrome/browser/android/download/download_controller.cc
@@ -235,7 +235,8 @@ bool DownloadController::HasFileAccessPermission(
}
void DownloadController::CreateGETDownload(
- int render_process_id, int render_view_id, bool must_download,
+ const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
+ bool must_download,
const DownloadInfo& info) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -246,15 +247,15 @@ void DownloadController::CreateGETDownload(
BrowserThread::UI, FROM_HERE,
base::Bind(&DownloadController::StartAndroidDownload,
base::Unretained(this),
- render_process_id, render_view_id, must_download, info));
+ wc_getter, must_download, info));
}
void DownloadController::StartAndroidDownload(
- int render_process_id, int render_view_id, bool must_download,
- const DownloadInfo& info) {
+ const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
+ bool must_download, const DownloadInfo& info) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- WebContents* web_contents = GetWebContents(render_process_id, render_view_id);
+ WebContents* web_contents = wc_getter.Run();
if (!web_contents) {
// The view went away. Can't proceed.
LOG(ERROR) << "Download failed on URL:" << info.url.spec();
@@ -264,18 +265,17 @@ void DownloadController::StartAndroidDownload(
AcquireFileAccessPermission(
web_contents,
base::Bind(&DownloadController::StartAndroidDownloadInternal,
- base::Unretained(this), render_process_id, render_view_id,
- must_download, info));
+ base::Unretained(this), wc_getter, must_download, info));
}
void DownloadController::StartAndroidDownloadInternal(
- int render_process_id, int render_view_id, bool must_download,
- const DownloadInfo& info, bool allowed) {
+ const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
+ bool must_download, const DownloadInfo& info, bool allowed) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!allowed)
return;
- WebContents* web_contents = GetWebContents(render_process_id, render_view_id);
+ WebContents* web_contents = wc_getter.Run();
// The view went away. Can't proceed.
if (!web_contents)
return;
« no previous file with comments | « chrome/browser/android/download/download_controller.h ('k') | chrome/browser/android/download/download_controller_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698