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

Issue 2877008: Rename the download to its final name only after the download is finished (Closed)

Created:
10 years, 5 months ago by kinuko
Modified:
9 years, 7 months ago
CC:
chromium-reviews, John Grabowski, ben+cc_chromium.org, Paul Godavari, pam+watch_chromium.org, brettw-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Rename the download to its final name only after the download is finished BUG=27687, 28928 TEST=DownloadManagerTest.DownloadRenameTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=53149

Patch Set 1 #

Patch Set 2 : another fix #

Patch Set 3 : .download -> .crdownload #

Patch Set 4 : remove .crdownload on cancel, added change for save_as #

Patch Set 5 : nits #

Patch Set 6 : rename twice for large files #

Total comments: 2

Patch Set 7 : rebased and fixed cancel operation #

Total comments: 2

Patch Set 8 : crdownload deletion fix and rebase #

Patch Set 9 : added unit test #

Total comments: 1

Patch Set 10 : nits fix #

Patch Set 11 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+346 lines, -51 lines) Patch
M base/file_path.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/download/download_file.h View 1 4 5 6 7 8 2 chunks +8 lines, -2 lines 0 comments Download
M chrome/browser/download/download_file.cc View 1 2 3 4 5 6 7 8 4 chunks +10 lines, -3 lines 0 comments Download
M chrome/browser/download/download_file_manager.h View 8 9 10 3 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/download/download_file_manager.cc View 8 9 10 3 chunks +55 lines, -17 lines 0 comments Download
M chrome/browser/download/download_item.h View 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/download/download_item.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/download/download_manager.h View 1 2 3 4 5 6 7 9 10 4 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/download/download_manager.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +59 lines, -23 lines 0 comments Download
M chrome/browser/download/download_manager_unittest.cc View 9 4 chunks +143 lines, -1 line 0 comments Download
M chrome/browser/download/download_util.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/download/download_util.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
kinuko
I think something like this should work. Can you take a look at it?
10 years, 5 months ago (2010-07-02 21:20:16 UTC) #1
Nico
Drive-by: ".download" is a known extension of what safari uses for its downloaded files on ...
10 years, 5 months ago (2010-07-02 21:26:24 UTC) #2
Avi (use Gerrit)
This will likely fix bug 28928. When you commit this, can you mark that as ...
10 years, 5 months ago (2010-07-02 21:44:37 UTC) #3
kinuko
On 2010/07/02 21:26:24, Nico wrote: > Drive-by: ".download" is a known extension of what safari ...
10 years, 5 months ago (2010-07-02 23:41:52 UTC) #4
Lei Zhang
On 2010/07/02 21:20:16, Kinuko Yasuda wrote: > I think something like this should work. Can ...
10 years, 5 months ago (2010-07-05 21:17:25 UTC) #5
kinuko
Thanks for your comments, On 2010/07/05 21:17:25, Lei Zhang wrote: > a) For a non-dangerous ...
10 years, 5 months ago (2010-07-08 22:47:34 UTC) #6
kinuko
On 2010/07/08 22:47:34, Kinuko Yasuda wrote: > Thanks for your comments, > > On 2010/07/05 ...
10 years, 5 months ago (2010-07-08 23:00:19 UTC) #7
Lei Zhang
On 2010/07/08 23:00:19, Kinuko Yasuda wrote: > Alternatively we can rename the file twice for ...
10 years, 5 months ago (2010-07-08 23:10:49 UTC) #8
kinuko
Updated the patch to make it rename twice. It still does create an empty .crdownload ...
10 years, 5 months ago (2010-07-09 00:37:16 UTC) #9
Lei Zhang
A few more issues: c) If I cancel a download that's in progress, it tries ...
10 years, 5 months ago (2010-07-15 01:52:14 UTC) #10
kinuko
Thanks for reviewing. On 2010/07/15 01:52:14, Lei Zhang wrote: > c) If I cancel a ...
10 years, 5 months ago (2010-07-15 22:02:43 UTC) #11
Lei Zhang
I filed bug 49220 for problem (d). http://codereview.chromium.org/2877008/diff/54001/4002 File chrome/browser/download/download_file.cc (right): http://codereview.chromium.org/2877008/diff/54001/4002#newcode131 chrome/browser/download/download_file.cc:131: FilePath crdownload ...
10 years, 5 months ago (2010-07-16 21:06:48 UTC) #12
Lei Zhang
Correction: This works for the case where the download is -finished-. But in the case ...
10 years, 5 months ago (2010-07-16 21:07:25 UTC) #13
kinuko
http://codereview.chromium.org/2877008/diff/54001/4002 File chrome/browser/download/download_file.cc (right): http://codereview.chromium.org/2877008/diff/54001/4002#newcode131 chrome/browser/download/download_file.cc:131: FilePath crdownload = download_util::GetCrDownloadPath(new_path); On 2010/07/16 21:06:48, Lei Zhang ...
10 years, 5 months ago (2010-07-16 23:30:46 UTC) #14
Nico
Drive-by On 2010/07/16 23:30:46, Kinuko Yasuda wrote: > http://codereview.chromium.org/2877008/diff/54001/4002 > File chrome/browser/download/download_file.cc (right): > > ...
10 years, 5 months ago (2010-07-16 23:32:47 UTC) #15
kinuko
On 2010/07/16 23:32:47, Nico wrote: > > 1. tmp -> foo.crdownload (is_final_rename=false, > need_delete_crdownload=false) > ...
10 years, 5 months ago (2010-07-19 21:29:37 UTC) #16
Lei Zhang
10 years, 5 months ago (2010-07-20 00:05:39 UTC) #17
LGTM

http://codereview.chromium.org/2877008/diff/75001/51012
File chrome/browser/download/download_manager_unittest.cc (right):

http://codereview.chromium.org/2877008/diff/75001/51012#newcode808
chrome/browser/download/download_manager_unittest.cc:808: // download is owned
by DownloadFileManager.
nit: |download|

Powered by Google App Engine
This is Rietveld 408576698