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

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

Issue 13649009: Android: Use a ResourceThrottle to intercept GET downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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: 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 2ade0d026add25efe682fd58d48c29568af5693f..d8f5d91321dff1f7163a6d693dd082daeda4d6e8 100644
--- a/content/browser/android/download_controller_android_impl.cc
+++ b/content/browser/android/download_controller_android_impl.cc
@@ -79,10 +79,8 @@ void DownloadControllerAndroidImpl::Init(JNIEnv* env, jobject obj) {
}
void DownloadControllerAndroidImpl::CreateGETDownload(
- RenderViewHost* render_view_host,
- int request_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- int render_process_id = render_view_host->GetProcess()->GetID();
+ int render_process_id, int render_view_id, int request_id) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
GlobalRequestID global_id(render_process_id, request_id);
// We are yielding the UI thread and render_view_host may go away by
@@ -91,14 +89,12 @@ void DownloadControllerAndroidImpl::CreateGETDownload(
GetDownloadInfoCB cb = base::Bind(
&DownloadControllerAndroidImpl::StartAndroidDownload,
base::Unretained(this), render_process_id,
- render_view_host->GetRoutingID());
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(
- &DownloadControllerAndroidImpl::PrepareDownloadInfo,
- base::Unretained(this), global_id,
- base::Bind(&DownloadControllerAndroidImpl::StartDownloadOnUIThread,
- base::Unretained(this), cb)));
+ render_view_id);
+
+ PrepareDownloadInfo(
+ global_id,
+ base::Bind(&DownloadControllerAndroidImpl::StartDownloadOnUIThread,
+ base::Unretained(this), cb));
}
void DownloadControllerAndroidImpl::PrepareDownloadInfo(

Powered by Google App Engine
This is Rietveld 408576698