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

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

Issue 11640007: Make the UI an observer of downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use DownloadItemModel. Address Nits. Created 8 years 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 2bd324ab2d60f460b7ba2bf7d77eb2698ae09691..db47058548f5cd92ce5dfe17047fb40b10356c39 100644
--- a/content/browser/android/download_controller_android_impl.cc
+++ b/content/browser/android/download_controller_android_impl.cc
@@ -235,16 +235,18 @@ void DownloadControllerAndroidImpl::StartAndroidDownload(
}
void DownloadControllerAndroidImpl::OnPostDownloadStarted(
- WebContents* web_contents,
DownloadItem* download_item) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (!download_item->GetWebContents())
+ return;
+
JNIEnv* env = AttachCurrentThread();
// Register for updates to the DownloadItem.
download_item->AddObserver(this);
ScopedJavaLocalRef<jobject> view =
- GetContentViewCoreFromWebContents(web_contents);
+ GetContentViewCoreFromWebContents(download_item->GetWebContents());
if(view.is_null()) {
// The view went away. Can't proceed.
return;

Powered by Google App Engine
This is Rietveld 408576698