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

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: 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..999b407237d10c0a5877551ea84d148b2c37665a 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() == NULL)
benjhayden 2012/12/20 21:09:14 I thought the convention was if (!GetWebContents()
asanka 2012/12/20 22:41:19 Done.
+ 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