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

Issue 2618743006: Use previous target path when resuming a download after crash (Closed)

Created:
3 years, 11 months ago by qinmin
Modified:
3 years, 11 months ago
CC:
asanka, chromium-reviews, darin-cc_chromium.org, jam
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use previous target path when resuming a download after crash When resuming a download after browser crash, Chrome will regenerate the target path. This could reintroduce name conflict if user has resolved a conflict before the crash. This CL reuses the previous target path Chrome has already generated for the download. BUG=678835 Review-Url: https://codereview.chromium.org/2618743006 Cr-Commit-Position: refs/heads/master@{#446218} Committed: https://chromium.googlesource.com/chromium/src/+/41231a3e20197bf9499332f02c69a426186f5fbe

Patch Set 1 #

Total comments: 2

Patch Set 2 : adding a helper function to get last used target path #

Total comments: 8

Patch Set 3 : remove GetLastTargetPath function #

Total comments: 4

Patch Set 4 : nits #

Patch Set 5 : respect prompt reasons #

Patch Set 6 : move the target path logic into if(!is_forced_path) statement #

Total comments: 2

Patch Set 7 : use virtual_path_ instead #

Patch Set 8 : change conflict_action based on existing virtual path value #

Patch Set 9 : add code for test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -5 lines) Patch
M chrome/browser/download/download_target_determiner.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -4 lines 0 comments Download
M chrome/browser/download/download_target_determiner_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -1 line 0 comments Download

Messages

Total messages: 47 (29 generated)
qinmin
+asanka for OWNER and code review
3 years, 11 months ago (2017-01-06 22:10:58 UTC) #2
David Trainor- moved to gerrit
https://codereview.chromium.org/2618743006/diff/1/chrome/browser/download/download_target_determiner.cc File chrome/browser/download/download_target_determiner.cc (right): https://codereview.chromium.org/2618743006/diff/1/chrome/browser/download/download_target_determiner.cc#newcode245 chrome/browser/download/download_target_determiner.cc:245: virtual_path_ = download_->GetForcedFilePath().empty() ? Since we're using this logic ...
3 years, 11 months ago (2017-01-06 23:26:41 UTC) #3
qinmin
https://codereview.chromium.org/2618743006/diff/1/chrome/browser/download/download_target_determiner.cc File chrome/browser/download/download_target_determiner.cc (right): https://codereview.chromium.org/2618743006/diff/1/chrome/browser/download/download_target_determiner.cc#newcode245 chrome/browser/download/download_target_determiner.cc:245: virtual_path_ = download_->GetForcedFilePath().empty() ? On 2017/01/06 23:26:41, David Trainor ...
3 years, 11 months ago (2017-01-09 22:17:27 UTC) #4
qinmin
ping, asanka@, would you mind take a look? would like to merge this into M56.
3 years, 11 months ago (2017-01-10 00:06:23 UTC) #5
asanka
https://codereview.chromium.org/2618743006/diff/20001/chrome/browser/download/download_target_determiner.cc File chrome/browser/download/download_target_determiner.cc (right): https://codereview.chromium.org/2618743006/diff/20001/chrome/browser/download/download_target_determiner.cc#newcode195 chrome/browser/download/download_target_determiner.cc:195: bool has_target_path = !download_->GetLastUsedTargetPath().empty(); Implement the GetForcedFilePath() || GetTargetFilePath() ...
3 years, 11 months ago (2017-01-10 19:34:19 UTC) #6
qinmin
PTAL again https://codereview.chromium.org/2618743006/diff/20001/chrome/browser/download/download_target_determiner.cc File chrome/browser/download/download_target_determiner.cc (right): https://codereview.chromium.org/2618743006/diff/20001/chrome/browser/download/download_target_determiner.cc#newcode195 chrome/browser/download/download_target_determiner.cc:195: bool has_target_path = !download_->GetLastUsedTargetPath().empty(); On 2017/01/10 19:34:19, ...
3 years, 11 months ago (2017-01-10 22:06:29 UTC) #7
asanka
lgtm https://codereview.chromium.org/2618743006/diff/40001/content/browser/download/download_item_impl_delegate.cc File content/browser/download/download_item_impl_delegate.cc (right): https://codereview.chromium.org/2618743006/diff/40001/content/browser/download/download_item_impl_delegate.cc#newcode35 content/browser/download/download_item_impl_delegate.cc:35: base::FilePath target_path = download->GetForcedFilePath().empty() ? The changes in ...
3 years, 11 months ago (2017-01-10 22:24:03 UTC) #8
qinmin
https://codereview.chromium.org/2618743006/diff/40001/content/browser/download/download_item_impl_delegate.cc File content/browser/download/download_item_impl_delegate.cc (right): https://codereview.chromium.org/2618743006/diff/40001/content/browser/download/download_item_impl_delegate.cc#newcode35 content/browser/download/download_item_impl_delegate.cc:35: base::FilePath target_path = download->GetForcedFilePath().empty() ? On 2017/01/10 22:24:03, asanka ...
3 years, 11 months ago (2017-01-10 23:04:42 UTC) #9
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/2618743006/60001
3 years, 11 months ago (2017-01-10 23:05:47 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/97350)
3 years, 11 months ago (2017-01-10 23:49:06 UTC) #14
asanka
https://codereview.chromium.org/2618743006/diff/120001/chrome/browser/download/download_target_determiner.cc File chrome/browser/download/download_target_determiner.cc (right): https://codereview.chromium.org/2618743006/diff/120001/chrome/browser/download/download_target_determiner.cc#newcode198 chrome/browser/download/download_target_determiner.cc:198: if (!virtual_path_.empty() && HasPromptedForPath() && !is_forced_path) { Apologies. I ...
3 years, 11 months ago (2017-01-12 18:58:35 UTC) #28
qinmin
asanka@, please take another look. This change affects many unit tests as some tests incorrectly ...
3 years, 11 months ago (2017-01-13 01:08:24 UTC) #29
asanka
(I'll have a look at this later tonight).
3 years, 11 months ago (2017-01-13 21:40:50 UTC) #34
asanka
Sorry about the delay. I'll lgtm this, but with a couple of caveats. * Another ...
3 years, 11 months ago (2017-01-19 20:05:53 UTC) #35
qinmin
Thanks Asanka, the alternative looks much simpler. The patchset is now just a 2 line ...
3 years, 11 months ago (2017-01-20 19:19:13 UTC) #36
asanka
lgtm
3 years, 11 months ago (2017-01-25 21:55:05 UTC) #41
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/2618743006/180001
3 years, 11 months ago (2017-01-26 00:15:47 UTC) #44
commit-bot: I haz the power
3 years, 11 months ago (2017-01-26 03:27:11 UTC) #47
Message was sent while issue was closed.
Committed patchset #9 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/41231a3e20197bf9499332f02c69...

Powered by Google App Engine
This is Rietveld 408576698