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

Issue 2453633006: [downloads] Move platform specific code out of DownloadTargetDeterminer. (Closed)

Created:
4 years, 1 month ago by asanka
Modified:
3 years, 6 months ago
Reviewers:
svaldez
CC:
alokp+watch_chromium.org, android-webview-reviews_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, extensions-reviews_chromium.org, grt+watch_chromium.org, halliwell+watch_chromium.org, jam, jochen+watch_chromium.org, lcwu+watch_chromium.org, mlamouri+watch-content_chromium.org, Peter Beverloo
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[downloads] Move platform specific code out of DownloadTargetDeterminer. This CL cleans up the download target determination logic so that: * DownloadTargetDeterminer provides a reason for requesting user confirmation for a download path. The caller can thus use platform specific logic to handle the confirmation request. Chromium on Android doesn't always prompt the user for a download location, and hence needs to know *why* a confirmation is requested in order to decide how to proceed. * DownloadTargetDeterminer allows the caller to return a finer grained result than a boolean following a confirmation request. Just knowing whether the user confirmed or rejected is insufficient. On Android, for example, there are cases where the platform specific code will automatically accept a confirmation request raised by the DownloadTargetDeterminer. In such cases, it is important to note whether the result indicates explicit user consent or not, which is a signal used elsewhere for determining download security. * DownloadPathReservationTracker provides a detailed result after completing target determination. The extra detail allows DownloadTargetDeterminer to indicate *why* the target determination failed rather than just the fact that it failed. This result can then be translated to an interrupt reason. * DownloadItem accepts an interrupt reason during download target determination. More things can go wrong during this stage of the download than user cancellation. Consequently, the download target conflict resolution logic can now be moved entirely into ChromeDownloadManagerDelegate. Previously the logic was split between DownloadTargetDeterminer, DownloadPathReservationTracker, and ChromeDownloadManagerDelegate on Android. BUG=334474

Patch Set 1 #

Patch Set 2 : . #

Total comments: 32

Patch Set 3 : . #

Patch Set 4 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1918 lines, -1229 lines) Patch
M android_webview/browser/aw_download_manager_delegate.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/BUILD.gn View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.h View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc View 1 2 3 4 chunks +10 lines, -8 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate.h View 1 2 4 chunks +13 lines, -7 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate.cc View 1 2 3 6 chunks +69 lines, -18 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate_unittest.cc View 1 2 3 17 chunks +292 lines, -75 lines 0 comments Download
M chrome/browser/download/download_browsertest.cc View 1 2 5 chunks +20 lines, -10 lines 0 comments Download
A chrome/browser/download/download_confirmation_reason.h View 1 2 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/download/download_confirmation_result.h View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
M chrome/browser/download/download_file_picker.h View 1 2 3 chunks +7 lines, -5 lines 0 comments Download
M chrome/browser/download/download_file_picker.cc View 1 2 3 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/download/download_path_reservation_tracker.h View 1 2 3 2 chunks +11 lines, -4 lines 0 comments Download
M chrome/browser/download/download_path_reservation_tracker.cc View 1 2 3 8 chunks +121 lines, -98 lines 0 comments Download
M chrome/browser/download/download_path_reservation_tracker_unittest.cc View 1 2 3 25 chunks +126 lines, -179 lines 0 comments Download
M chrome/browser/download/download_target_determiner.h View 1 2 3 8 chunks +30 lines, -20 lines 0 comments Download
M chrome/browser/download/download_target_determiner.cc View 1 2 3 17 chunks +117 lines, -122 lines 0 comments Download
M chrome/browser/download/download_target_determiner_delegate.h View 1 2 3 4 chunks +16 lines, -14 lines 0 comments Download
M chrome/browser/download/download_target_determiner_unittest.cc View 1 2 3 57 chunks +575 lines, -436 lines 0 comments Download
M chrome/browser/download/download_target_info.h View 1 2 3 3 chunks +8 lines, -0 lines 0 comments Download
A chrome/browser/download/download_target_info.cc View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M chrome/browser/download/download_test_file_activity_observer.cc View 1 2 1 chunk +9 lines, -7 lines 0 comments Download
M chrome/browser/lifetime/browser_close_manager_browsertest.cc View 1 2 1 chunk +8 lines, -10 lines 0 comments Download
M chromecast/browser/cast_download_manager_delegate.cc View 3 chunks +5 lines, -6 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 chunks +10 lines, -5 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 22 chunks +120 lines, -87 lines 0 comments Download
M content/browser/download/download_item_impl_delegate.h View 1 2 2 chunks +7 lines, -2 lines 0 comments Download
M content/browser/download/download_item_impl_delegate.cc View 1 chunk +3 lines, -4 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 1 2 37 chunks +196 lines, -75 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 1 chunk +3 lines, -4 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 6 chunks +11 lines, -5 lines 0 comments Download
M content/browser/download/mock_download_item_impl.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M content/public/browser/download_manager_delegate.h View 1 chunk +26 lines, -11 lines 0 comments Download
M content/shell/browser/shell_download_manager_delegate.cc View 1 2 4 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 71 (65 generated)
asanka
Let me know if this is too big. I can break it up, but didn't ...
4 years, 1 month ago (2016-10-27 19:47:31 UTC) #6
svaldez
On 2016/10/27 19:47:31, asanka wrote: > Let me know if this is too big. I ...
4 years, 1 month ago (2016-10-28 14:57:13 UTC) #7
svaldez
On 2016/10/28 14:57:13, svaldez wrote: > On 2016/10/27 19:47:31, asanka wrote: > > Let me ...
4 years, 1 month ago (2016-10-28 15:32:06 UTC) #8
svaldez
https://codereview.chromium.org/2453633006/diff/20001/chrome/browser/download/chrome_download_manager_delegate.cc File chrome/browser/download/chrome_download_manager_delegate.cc (right): https://codereview.chromium.org/2453633006/diff/20001/chrome/browser/download/chrome_download_manager_delegate.cc#newcode645 chrome/browser/download/chrome_download_manager_delegate.cc:645: case DownloadConfirmationReason::TARGET_NO_SPACE: Should this actually continue? https://codereview.chromium.org/2453633006/diff/20001/chrome/browser/download/chrome_download_manager_delegate.cc#newcode832 chrome/browser/download/chrome_download_manager_delegate.cc:832: NOTREACHED(); ...
4 years, 1 month ago (2016-10-28 17:29:36 UTC) #9
asanka
Second pass. I broke up some renames and moves into a separate CL so that ...
4 years, 1 month ago (2016-11-07 19:50:16 UTC) #20
asanka
4 years ago (2016-12-02 19:59:02 UTC) #21
Ping

Powered by Google App Engine
This is Rietveld 408576698