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

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

Issue 2720613002: Downloads: Added transient flag to download item and download database (Closed)
Patch Set: fix tests Created 3 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
« no previous file with comments | « no previous file | chrome/browser/apps/guest_view/web_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/download/download_manager_service.cc
diff --git a/chrome/browser/android/download/download_manager_service.cc b/chrome/browser/android/download/download_manager_service.cc
index 8b0921a8fc6d971139b7e0cc4ef66888441b9ba4..bfef026292a0b6499d9696577750e834c0896de7 100644
--- a/chrome/browser/android/download/download_manager_service.cc
+++ b/chrome/browser/android/download/download_manager_service.cc
@@ -41,7 +41,7 @@ int kDefaultAutoResumptionLimit = 5;
const char kAutoResumptionLimitVariation[] = "AutoResumptionLimit";
bool ShouldShowDownloadItem(content::DownloadItem* item) {
- return !item->IsTemporary();
+ return !item->IsTemporary() && !item->IsTransient();
}
void UpdateNotifier(DownloadManagerService* service,
@@ -57,6 +57,7 @@ void UpdateNotifier(DownloadManagerService* service,
ScopedJavaLocalRef<jobject> CreateJavaDownloadItem(
JNIEnv* env, content::DownloadItem* item) {
+ DCHECK(!item->IsTransient());
return Java_DownloadItem_createDownloadItem(
env, DownloadManagerService::CreateJavaDownloadInfo(env, item),
item->GetStartTime().ToJavaTime(), item->GetFileExternallyRemoved());
@@ -301,6 +302,8 @@ void DownloadManagerService::OnHistoryQueryComplete() {
void DownloadManagerService::OnDownloadCreated(
content::DownloadManager* manager, content::DownloadItem* item) {
+ if (item->IsTransient())
+ return;
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_item = CreateJavaDownloadItem(env, item);
@@ -313,7 +316,7 @@ void DownloadManagerService::OnDownloadUpdated(
if (java_ref_.is_null())
return;
- if (item->IsTemporary())
+ if (item->IsTemporary() || item->IsTransient())
return;
JNIEnv* env = base::android::AttachCurrentThread();
@@ -324,7 +327,7 @@ void DownloadManagerService::OnDownloadUpdated(
void DownloadManagerService::OnDownloadRemoved(
content::DownloadManager* manager, content::DownloadItem* item) {
- if (java_ref_.is_null())
+ if (java_ref_.is_null() || item->IsTransient())
return;
JNIEnv* env = base::android::AttachCurrentThread();
« no previous file with comments | « no previous file | chrome/browser/apps/guest_view/web_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698