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

Issue 1781983002: [Downloads] Introduce GUIDs for downloads. (Closed)

Created:
4 years, 9 months ago by asanka
Modified:
4 years, 9 months ago
CC:
asanka, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, extensions-reviews_chromium.org, grt+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Downloads] Introduce GUIDs for downloads. Chrome on Android and extensions attempt to keep references to downloads across browser sessions using download IDs. This isn't safe since a subsequent browser session could reuse a download ID to refer to a different download. In order to provide a weak cross-session reference, this CL introduces GUIDs. At worst, attempting to lookup a download via a GUID will fail rather than end up referring to a different download. This assumes that there will not be any conflicts among the GUIDs, which is apparently a safe assumption to make. This CL includes the following changes: * Introduce a GetGuid() method to DownloadItem and its subclasses. * Allow DownloadItemImpl to create a new GUID for itself for new downloads using base::GenerateGuid(). * Store and retrieve GUIDs from downloads history for persisted downloads. * Generate GUIDs for downloads in the history DB which are being migrated due to a browser upgrade. * Since we are revving the history DB schema, also adds the fields for HTTP method and hash fields. Note that in order to keep the size of the CL sane, code for incorporating HTTP method and hash into the downloads system is not included in this CL. The latter is https://codereview.chromium.org/1751603002 . BUG=593020 Committed: https://crrev.com/eef62b0282ec19ebc040785d0b7ac36de398cbc1 Cr-Commit-Position: refs/heads/master@{#381071}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 10

Patch Set 6 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+668 lines, -289 lines) Patch
M chrome/browser/android/download/download_manager_service_unittest.cc View 1 2 3 4 chunks +14 lines, -140 lines 0 comments Download
M chrome/browser/download/download_history.cc View 1 2 3 4 5 5 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/download/download_history_unittest.cc View 1 2 3 4 5 6 chunks +29 lines, -39 lines 0 comments Download
M chrome/browser/download/download_ui_controller_unittest.cc View 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc View 1 2 3 4 5 2 chunks +14 lines, -7 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc View 1 2 3 4 5 3 chunks +9 lines, -4 lines 0 comments Download
M components/history/core/browser/download_database.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M components/history/core/browser/download_database.cc View 1 2 3 4 12 chunks +61 lines, -15 lines 0 comments Download
M components/history/core/browser/download_row.h View 1 2 3 4 chunks +18 lines, -0 lines 0 comments Download
M components/history/core/browser/download_row.cc View 1 2 3 4 5 5 chunks +32 lines, -1 line 0 comments Download
M components/history/core/browser/history_backend_db_unittest.cc View 1 2 3 4 5 8 chunks +246 lines, -6 lines 0 comments Download
M components/history/core/browser/history_database.cc View 1 2 3 4 2 chunks +10 lines, -1 line 0 comments Download
M components/history/core/test/history_backend_db_base_test.h View 1 chunk +4 lines, -1 line 0 comments Download
M components/history/core/test/history_backend_db_base_test.cc View 1 2 3 4 5 3 chunks +4 lines, -0 lines 0 comments Download
A + components/test/data/history/history.29.sql View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/download/download_item_factory.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/download_item_impl.h View 3 chunks +4 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 7 chunks +13 lines, -2 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 4 chunks +11 lines, -0 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 10 chunks +39 lines, -21 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 9 chunks +66 lines, -20 lines 0 comments Download
M content/public/browser/download_item.h View 1 2 3 4 5 1 chunk +11 lines, -0 lines 0 comments Download
M content/public/browser/download_manager.h View 2 chunks +7 lines, -0 lines 0 comments Download
M content/public/test/mock_download_item.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/mock_download_manager.h View 4 chunks +6 lines, -2 lines 0 comments Download
M content/public/test/mock_download_manager.cc View 1 2 3 4 5 6 chunks +34 lines, -24 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 1 chunk +15 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 20 (9 generated)
asanka
svaldez: Everything! asvitkine: tools/metrics/histograms/histograms.xml jam: content/public/* sky: chrome/browser/android/download/download_manager_service_unittest.cc chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc components/history/core/*
4 years, 9 months ago (2016-03-11 20:27:42 UTC) #4
sky
LGTM https://codereview.chromium.org/1781983002/diff/80001/chrome/browser/android/download/download_manager_service_unittest.cc File chrome/browser/android/download/download_manager_service_unittest.cc (right): https://codereview.chromium.org/1781983002/diff/80001/chrome/browser/android/download/download_manager_service_unittest.cc#newcode39 chrome/browser/android/download/download_manager_service_unittest.cc:39: ON_CALL(manager_, GetDownload(_)) UGH! gmock, UGH!
4 years, 9 months ago (2016-03-11 20:49:16 UTC) #6
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/1781983002/diff/80001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1781983002/diff/80001/tools/metrics/histograms/histograms.xml#newcode9410 tools/metrics/histograms/histograms.xml:9410: + <summary>Time taken to create a single download ...
4 years, 9 months ago (2016-03-14 15:38:41 UTC) #7
jam
On 2016/03/11 20:27:42, asanka wrote: > jam: > content/public/* lgtm
4 years, 9 months ago (2016-03-14 16:37:01 UTC) #8
svaldez
lgtm. https://codereview.chromium.org/1781983002/diff/80001/components/history/core/browser/download_row.cc File components/history/core/browser/download_row.cc (right): https://codereview.chromium.org/1781983002/diff/80001/components/history/core/browser/download_row.cc#newcode72 components/history/core/browser/download_row.cc:72: bool DownloadRow::operator==(const DownloadRow& rhs) const { Are the ...
4 years, 9 months ago (2016-03-14 16:59:51 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1781983002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1781983002/100001
4 years, 9 months ago (2016-03-14 19:18:23 UTC) #11
asanka
https://codereview.chromium.org/1781983002/diff/80001/chrome/browser/android/download/download_manager_service_unittest.cc File chrome/browser/android/download/download_manager_service_unittest.cc (right): https://codereview.chromium.org/1781983002/diff/80001/chrome/browser/android/download/download_manager_service_unittest.cc#newcode39 chrome/browser/android/download/download_manager_service_unittest.cc:39: ON_CALL(manager_, GetDownload(_)) On 2016/03/11 at 20:49:16, sky wrote: > ...
4 years, 9 months ago (2016-03-14 19:18:33 UTC) #12
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/130681)
4 years, 9 months ago (2016-03-14 20:08:55 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1781983002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1781983002/100001
4 years, 9 months ago (2016-03-14 20:35:32 UTC) #17
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 9 months ago (2016-03-14 21:23:32 UTC) #18
commit-bot: I haz the power
4 years, 9 months ago (2016-03-14 21:25:06 UTC) #20
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/eef62b0282ec19ebc040785d0b7ac36de398cbc1
Cr-Commit-Position: refs/heads/master@{#381071}

Powered by Google App Engine
This is Rietveld 408576698