summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/android/download_controller_android_impl.cc20
-rw-r--r--content/browser/android/download_controller_android_impl.h2
-rw-r--r--content/public/browser/android/download_controller_android.h5
3 files changed, 11 insertions, 16 deletions
diff --git a/content/browser/android/download_controller_android_impl.cc b/content/browser/android/download_controller_android_impl.cc
index 2ade0d0..d8f5d91 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(
diff --git a/content/browser/android/download_controller_android_impl.h b/content/browser/android/download_controller_android_impl.h
index 6dc87e2..b0917fb 100644
--- a/content/browser/android/download_controller_android_impl.h
+++ b/content/browser/android/download_controller_android_impl.h
@@ -75,7 +75,7 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid,
virtual ~DownloadControllerAndroidImpl();
// DownloadControllerAndroid implementation.
- virtual void CreateGETDownload(RenderViewHost* source,
+ virtual void CreateGETDownload(int render_process_id, int render_view_id,
int request_id) OVERRIDE;
virtual void OnPostDownloadStarted(DownloadItem* download_item) OVERRIDE;
diff --git a/content/public/browser/android/download_controller_android.h b/content/public/browser/android/download_controller_android.h
index df0470e..b413205 100644
--- a/content/public/browser/android/download_controller_android.h
+++ b/content/public/browser/android/download_controller_android.h
@@ -9,8 +9,6 @@
namespace content {
class DownloadItem;
-class RenderViewHost;
-class WebContents;
// Interface to request GET downloads and send notifications for POST
// downloads.
@@ -21,7 +19,8 @@ class CONTENT_EXPORT DownloadControllerAndroid {
// Starts a new download request with Android. Should be called on the
// UI thread.
- virtual void CreateGETDownload(RenderViewHost* source, int request_id) = 0;
+ virtual void CreateGETDownload(int render_process_id, int render_view_id,
+ int request_id) = 0;
// Should be called when a POST download is started. Notifies the embedding
// app about the download. Should be called on the UI thread.