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

Issue 2705283003: Added last_access_time to DownloadItem and History DB (Closed)

Created:
3 years, 10 months ago by shaktisahu
Modified:
3 years, 9 months ago
CC:
chromium-reviews, asanka, jam, darin-cc_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Added last_access_time to DownloadItem and History DB Added the last access time for a download item. If the item has not been accessed yet, it should default to 0. This involves adding a column to the History DB and migrating the older versions to have the same default value for this field. Download home and DownloadSnackbarController currently open the download item directly. Since they use the filename to open the file directly, the native DownloadItem::Open() is not called from android. So a public method UpdateLastAccessTime was added to DownloadItem and hence DownloadServiceManager to directly update last access time. Probably we should change all the download open paths to use native DownloadItem::Open in future. BUG=689981 Review-Url: https://codereview.chromium.org/2705283003 Cr-Commit-Position: refs/heads/master@{#454548} Committed: https://chromium.googlesource.com/chromium/src/+/60eb97fc48ad3a8df63c8b17aacb30985af52dd1

Patch Set 1 #

Patch Set 2 : Fix tests #

Patch Set 3 : Fix tests #

Patch Set 4 : Fix tests #

Total comments: 12

Patch Set 5 : Fix tests #

Patch Set 6 : comments #

Total comments: 2

Patch Set 7 : cleanup #

Patch Set 8 : rebase + Java accessor #

Total comments: 2

Patch Set 9 : changed base::Time args to be passed by value #

Patch Set 10 : rebase origin/master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+282 lines, -135 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java View 1 2 3 4 5 6 7 7 chunks +22 lines, -7 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java View 1 2 3 4 6 3 chunks +15 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/download/ui/BackendProvider.java View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryItemWrapper.java View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/download/ui/StubbedProvider.java View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/android/download/download_manager_service.h View 1 2 3 4 6 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/android/download/download_manager_service.cc View 1 2 3 4 5 6 7 2 chunks +17 lines, -1 line 0 comments Download
M chrome/browser/apps/guest_view/web_view_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/browsing_data/downloads_counter_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -21 lines 0 comments Download
M chrome/browser/download/download_history.cc View 1 2 3 4 5 6 7 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/download/download_history_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +36 lines, -32 lines 0 comments Download
M chrome/browser/download/download_ui_controller_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ntp_snippets/fake_download_item.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ntp_snippets/fake_download_item.cc View 1 2 3 4 5 6 7 8 4 chunks +11 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/history/core/browser/download_database.h View 1 chunk +3 lines, -0 lines 0 comments Download
M components/history/core/browser/download_database.cc View 8 chunks +19 lines, -8 lines 0 comments Download
M components/history/core/browser/download_row.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -2 lines 0 comments Download
M components/history/core/browser/download_row.cc View 1 2 3 4 5 6 7 8 4 chunks +5 lines, -2 lines 0 comments Download
M components/history/core/browser/history_backend_db_unittest.cc View 1 2 3 4 11 chunks +22 lines, -15 lines 0 comments Download
M components/history/core/browser/history_database.cc View 2 chunks +10 lines, -1 line 0 comments Download
M components/history/core/test/history_backend_db_base_test.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/download/download_browsertest.cc View 1 2 3 4 5 6 7 7 chunks +7 lines, -7 lines 0 comments Download
M content/browser/download/download_item_factory.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 4 5 6 7 8 9 4 chunks +8 lines, -2 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 4 5 6 7 8 9 6 chunks +14 lines, -2 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 6 chunks +9 lines, -6 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +7 lines, -5 lines 0 comments Download
M content/browser/download/mock_download_item_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/mock_download_item_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/download_item.h View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M content/public/browser/download_manager.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M content/public/test/mock_download_item.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/test/mock_download_manager.h View 1 2 3 4 5 6 7 8 5 chunks +7 lines, -4 lines 0 comments Download
M content/public/test/mock_download_manager.cc View 1 2 3 4 5 6 7 8 7 chunks +10 lines, -5 lines 0 comments Download

Messages

Total messages: 72 (55 generated)
shaktisahu
dtrainor@ - PTAL
3 years, 10 months ago (2017-02-21 21:09:11 UTC) #2
David Trainor- moved to gerrit
looking good. a few nits. https://codereview.chromium.org/2705283003/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java File chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java (right): https://codereview.chromium.org/2705283003/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java#newcode1072 chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java:1072: updateLastAccessTime(downloadInfo.getDownloadGuid()); Should this be ...
3 years, 10 months ago (2017-02-22 05:56:03 UTC) #34
shaktisahu
https://codereview.chromium.org/2705283003/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java File chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java (right): https://codereview.chromium.org/2705283003/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java#newcode1072 chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java:1072: updateLastAccessTime(downloadInfo.getDownloadGuid()); On 2017/02/22 05:56:03, David Trainor wrote: > Should ...
3 years, 10 months ago (2017-02-23 06:55:51 UTC) #39
David Trainor- moved to gerrit
lgtm! https://codereview.chromium.org/2705283003/diff/160001/chrome/browser/android/download/download_manager_service.cc File chrome/browser/android/download/download_manager_service.cc (right): https://codereview.chromium.org/2705283003/diff/160001/chrome/browser/android/download/download_manager_service.cc#newcode246 chrome/browser/android/download/download_manager_service.cc:246: jlong last_access_time, We might not need this from ...
3 years, 10 months ago (2017-02-23 21:21:21 UTC) #40
shaktisahu
cpu@ - PTAL https://codereview.chromium.org/2705283003/diff/160001/chrome/browser/android/download/download_manager_service.cc File chrome/browser/android/download/download_manager_service.cc (right): https://codereview.chromium.org/2705283003/diff/160001/chrome/browser/android/download/download_manager_service.cc#newcode246 chrome/browser/android/download/download_manager_service.cc:246: jlong last_access_time, On 2017/02/23 21:21:20, David ...
3 years, 10 months ago (2017-02-23 23:18:07 UTC) #41
shaktisahu
cpu@ - PTAL
3 years, 10 months ago (2017-02-24 00:54:27 UTC) #43
David Trainor- moved to gerrit
Shakti can we add (here or to a future CL) a way to query this ...
3 years, 10 months ago (2017-02-25 04:14:28 UTC) #44
cpu_(ooo_6.6-7.5)
Hi, what in particular you want me to review? maybe content/public/browser? if so looks good. ...
3 years, 10 months ago (2017-02-25 22:08:49 UTC) #45
shaktisahu
On 2017/02/25 22:08:49, cpu wrote: > Hi, what in particular you want me to review? ...
3 years, 10 months ago (2017-02-25 22:29:00 UTC) #46
shaktisahu
sdefresne@ - PTAL
3 years, 9 months ago (2017-02-28 05:50:18 UTC) #53
sdefresne
https://codereview.chromium.org/2705283003/diff/200001/components/history/core/browser/download_row.h File components/history/core/browser/download_row.h (right): https://codereview.chromium.org/2705283003/diff/200001/components/history/core/browser/download_row.h#newcode49 components/history/core/browser/download_row.h:49: const base::Time& last_access, base/time.h has a comment saying that ...
3 years, 9 months ago (2017-02-28 18:09:07 UTC) #54
shaktisahu
sdefresne@ - PTAL https://codereview.chromium.org/2705283003/diff/200001/components/history/core/browser/download_row.h File components/history/core/browser/download_row.h (right): https://codereview.chromium.org/2705283003/diff/200001/components/history/core/browser/download_row.h#newcode49 components/history/core/browser/download_row.h:49: const base::Time& last_access, On 2017/02/28 18:09:07, ...
3 years, 9 months ago (2017-02-28 21:07:54 UTC) #55
sdefresne
lgtm
3 years, 9 months ago (2017-02-28 21:48:12 UTC) #56
shaktisahu
On 2017/02/28 21:48:12, sdefresne wrote: > lgtm cpu@ - Can you please take a look ...
3 years, 9 months ago (2017-02-28 23:04:19 UTC) #57
cpu_(ooo_6.6-7.5)
lgtm
3 years, 9 months ago (2017-03-03 04:48:32 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2705283003/240001
3 years, 9 months ago (2017-03-03 08:49:13 UTC) #69
commit-bot: I haz the power
3 years, 9 months ago (2017-03-03 08:54:14 UTC) #72
Message was sent while issue was closed.
Committed patchset #10 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/60eb97fc48ad3a8df63c8b17aacb...

Powered by Google App Engine
This is Rietveld 408576698