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

Issue 14773004: Move download filename determination into a separate class. (Closed)

Created:
7 years, 7 months ago by asanka
Modified:
6 years, 11 months ago
CC:
chromium-reviews, benjhayden+dwatch_chromium.org
Visibility:
Public.

Description

Move download filename determination into a separate class. [Relanding. It was reverted due to a memory leak.] * Extracts download filename determination into DownloadTargetDeterminer. The new class maintains state and observes the download. Doing so eliminates the need to pass state around as bound arguments. * Guarantees that the completion callback to DownloadManagerDelegate::DetermineDownloadTarget is always invoked, even if the download is interrupted on initialization. This is required for reliably resuming downloads. * The DownloadFilePicker always returns the virtual path for downloads to Drive. ChromeDownloadManagerDelegate can use it to keep track of the correct last selected directory for 'Save As' downloads. * Since no path subsubstituion is necessary during prompting, DownloadFilePickerChromeOS is no longer necessary. * Re-orders the sequence of events so that the user is prompted as early as possible. Expensive history database lookups won't introduce unnecssary jank. * History database lookups are only performed if the results of the lookup are necessary. * Downloads to Drive don't need the temporary local path to be determined twice when the default downloads directory is Drive. BUG=151618 BUG=104335 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=197518 Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=197578 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=197920

Patch Set 1 #

Patch Set 2 : Wait until callback is done #

Patch Set 3 : No ALLOW_THIS_IN_INITIALIZER_LIST #

Patch Set 4 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+2840 lines, -1486 lines) Patch
M chrome/browser/download/chrome_download_manager_delegate.h View 4 chunks +34 lines, -110 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate.cc View 9 chunks +132 lines, -477 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate_unittest.cc View 10 chunks +148 lines, -700 lines 0 comments Download
M chrome/browser/download/download_crx_util.cc View 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/download/download_file_picker.h View 2 chunks +31 lines, -28 lines 0 comments Download
M chrome/browser/download/download_file_picker.cc View 3 chunks +36 lines, -44 lines 0 comments Download
D chrome/browser/download/download_file_picker_chromeos.h View 1 chunk +0 lines, -37 lines 0 comments Download
D chrome/browser/download/download_file_picker_chromeos.cc View 1 chunk +0 lines, -78 lines 0 comments Download
M chrome/browser/download/download_prefs.h View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/download/download_prefs.cc View 1 chunk +7 lines, -2 lines 0 comments Download
A chrome/browser/download/download_target_determiner.h View 1 chunk +252 lines, -0 lines 0 comments Download
A chrome/browser/download/download_target_determiner.cc View 1 2 1 chunk +594 lines, -0 lines 0 comments Download
A chrome/browser/download/download_target_determiner_delegate.h View 1 chunk +110 lines, -0 lines 0 comments Download
A chrome/browser/download/download_target_determiner_unittest.cc View 1 2 3 1 chunk +1479 lines, -0 lines 1 comment Download
M chrome/browser/download/download_test_file_activity_observer.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/chrome_browser.gypi View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
asanka
Could you take a look? The only change is in tests. Originally https://codereview.chromium.org/12850002/. Patchset 1 ...
7 years, 7 months ago (2013-05-01 18:30:24 UTC) #1
Randy Smith (Not in Mondays)
What was being leaked? Got a pointer to the error?
7 years, 7 months ago (2013-05-01 18:37:20 UTC) #2
benjhayden
lgtm
7 years, 7 months ago (2013-05-01 18:38:58 UTC) #3
asanka
On 2013/05/01 18:37:20, rdsmith wrote: > What was being leaked? Got a pointer to the ...
7 years, 7 months ago (2013-05-01 18:55:59 UTC) #4
Randy Smith (Not in Mondays)
lgtm
7 years, 7 months ago (2013-05-01 19:42:12 UTC) #5
asanka
Thanks!
7 years, 7 months ago (2013-05-01 21:39:09 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asanka@chromium.org/14773004/16001
7 years, 7 months ago (2013-05-02 03:15:36 UTC) #7
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 7 months ago (2013-05-02 03:49:24 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asanka@chromium.org/14773004/38001
7 years, 7 months ago (2013-05-02 12:46:11 UTC) #9
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) googleurl_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=48360
7 years, 7 months ago (2013-05-02 13:27:54 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asanka@chromium.org/14773004/38001
7 years, 7 months ago (2013-05-02 13:34:27 UTC) #11
commit-bot: I haz the power
Change committed as 197920
7 years, 7 months ago (2013-05-02 14:57:07 UTC) #12
Nico
6 years, 11 months ago (2014-01-15 18:01:07 UTC) #13
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/14773004/diff/38001/chrome/browser/dow...
File chrome/browser/download/download_target_determiner_unittest.cc (right):

https://chromiumcodereview.appspot.com/14773004/diff/38001/chrome/browser/dow...
chrome/browser/download/download_target_determiner_unittest.cc:114: const
base::FilePath::CharType* expected_virtual_path;
This appears unused. I'll send out a CL to remove it.

Powered by Google App Engine
This is Rietveld 408576698