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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java

Issue 2705283003: Added last_access_time to DownloadItem and History DB (Closed)
Patch Set: rebase origin/master Created 3 years, 10 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/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java
index 7588b4d945c8888e8d7ce93186a2045f1d63faa6..0e2be2ddc89effe91dba949a43b1784a1fad958e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java
@@ -32,6 +32,7 @@ public final class DownloadInfo {
private final boolean mIsOffTheRecord;
private final boolean mIsOfflinePage;
private final int mState;
+ private final long mLastAccessTime;
private DownloadInfo(Builder builder) {
mUrl = builder.mUrl;
@@ -55,6 +56,7 @@ public final class DownloadInfo {
mIsOffTheRecord = builder.mIsOffTheRecord;
mIsOfflinePage = builder.mIsOfflinePage;
mState = builder.mState;
+ mLastAccessTime = builder.mLastAccessTime;
}
public String getUrl() {
@@ -147,6 +149,10 @@ public final class DownloadInfo {
return mState;
}
+ public long getLastAccessTime() {
+ return mLastAccessTime;
+ }
+
/**
* Helper class for building the DownloadInfo object.
*/
@@ -172,6 +178,7 @@ public final class DownloadInfo {
private boolean mIsOffTheRecord;
private boolean mIsOfflinePage;
private int mState = DownloadState.IN_PROGRESS;
+ private long mLastAccessTime;
public Builder setUrl(String url) {
mUrl = url;
@@ -279,6 +286,11 @@ public final class DownloadInfo {
return this;
}
+ public Builder setLastAccessTime(long lastAccessTime) {
+ mLastAccessTime = lastAccessTime;
+ return this;
+ }
+
public DownloadInfo build() {
return new DownloadInfo(this);
}
@@ -310,17 +322,18 @@ public final class DownloadInfo {
.setIsPaused(downloadInfo.isPaused())
.setIsOffTheRecord(downloadInfo.isOffTheRecord())
.setIsOfflinePage(downloadInfo.isOfflinePage())
- .setState(downloadInfo.state());
+ .setState(downloadInfo.state())
+ .setLastAccessTime(downloadInfo.getLastAccessTime());
return builder;
}
}
@CalledByNative
- private static DownloadInfo createDownloadInfo(
- String downloadGuid, String fileName, String filePath, String url, String mimeType,
- long bytesReceived, boolean isIncognito, int state, int percentCompleted,
- boolean isPaused, boolean hasUserGesture, boolean isResumable,
- String originalUrl, String referrerUrl, long timeRemainingInMs) {
+ private static DownloadInfo createDownloadInfo(String downloadGuid, String fileName,
+ String filePath, String url, String mimeType, long bytesReceived, boolean isIncognito,
+ int state, int percentCompleted, boolean isPaused, boolean hasUserGesture,
+ boolean isResumable, String originalUrl, String referrerUrl, long timeRemainingInMs,
+ long lastAccessTime) {
String remappedMimeType = ChromeDownloadDelegate.remapGenericMimeType(
mimeType, url, fileName);
return new DownloadInfo.Builder()
@@ -339,6 +352,8 @@ public final class DownloadInfo {
.setReferrer(referrerUrl)
.setState(state)
.setTimeRemainingInMillis(timeRemainingInMs)
- .setUrl(url).build();
+ .setLastAccessTime(lastAccessTime)
+ .setUrl(url)
+ .build();
}
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698