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

Issue 12212010: Truncate the download file name if it exceeds the filesystem limit. (Closed)

Created:
7 years, 10 months ago by kinaba
Modified:
7 years, 9 months ago
CC:
chromium-reviews, benjhayden+dwatch_chromium.org, erikwright+watch_chromium.org, rdsmith+dwatch_chromium.org, sail+watch_chromium.org, tfarina
Visibility:
Public.

Description

Truncate the download file name if it exceeds the filesystem limit. BUG=162734 TEST=Manually tested (Rename a file on Google Drive to >300 characters, and download). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=183727

Patch Set 1 : #

Total comments: 6

Patch Set 2 : Partially addressed review comments (#3). #

Total comments: 8

Patch Set 3 : Rebase + review fix (#5,#6). #

Patch Set 4 : Add Windows (UTF-16) support. #

Total comments: 6

Patch Set 5 : Move to file_util, care about MAX_PATH, uniquification #

Total comments: 3

Patch Set 6 : GetVolumePathName(). #

Total comments: 6

Patch Set 7 : Review fix (#14), rebase. #

Total comments: 10

Patch Set 8 : Add test. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+219 lines, -14 lines) Patch
M base/file_util.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M base/file_util_posix.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M base/file_util_win.cc View 1 2 3 4 5 6 7 2 chunks +25 lines, -0 lines 0 comments Download
M chrome/browser/download/download_path_reservation_tracker.cc View 1 2 3 4 5 6 7 5 chunks +94 lines, -14 lines 1 comment Download
M chrome/browser/download/download_path_reservation_tracker_unittest.cc View 1 2 3 4 5 6 7 3 chunks +91 lines, -0 lines 1 comment Download

Messages

Total messages: 25 (0 generated)
kinaba
+asanka, +rdsmith, could you take a look from download people's perspective? (after I could be ...
7 years, 10 months ago (2013-02-07 09:16:20 UTC) #1
kinaba
(Oops, I'll take care of the android failure later...)
7 years, 10 months ago (2013-02-07 09:16:52 UTC) #2
Randy Smith (Not in Mondays)
I think this basic approach makes sense. There are some nits I'd like to pick ...
7 years, 10 months ago (2013-02-07 19:12:03 UTC) #3
kinaba
+mark for the changes in base/. Could you take a look? Primary use of the ...
7 years, 10 months ago (2013-02-08 10:46:57 UTC) #4
Mark Mentovai
https://codereview.chromium.org/12212010/diff/5016/base/sys_info_posix.cc File base/sys_info_posix.cc (right): https://codereview.chromium.org/12212010/diff/5016/base/sys_info_posix.cc#newcode56 base/sys_info_posix.cc:56: if (!path.IsAbsolute()) I don’t think this is relevant to ...
7 years, 10 months ago (2013-02-08 18:14:02 UTC) #5
Mark Mentovai
https://codereview.chromium.org/12212010/diff/5016/base/sys_info_win.cc File base/sys_info_win.cc (right): https://codereview.chromium.org/12212010/diff/5016/base/sys_info_win.cc#newcode71 base/sys_info_win.cc:71: if (!path.IsAbsolute()) Same.
7 years, 10 months ago (2013-02-08 18:14:42 UTC) #6
kinaba
Thanks for the comments! https://codereview.chromium.org/12212010/diff/5016/base/sys_info_posix.cc File base/sys_info_posix.cc (right): https://codereview.chromium.org/12212010/diff/5016/base/sys_info_posix.cc#newcode56 base/sys_info_posix.cc:56: if (!path.IsAbsolute()) On 2013/02/08 18:14:02, ...
7 years, 10 months ago (2013-02-12 05:51:29 UTC) #7
Mark Mentovai
LGTM
7 years, 10 months ago (2013-02-12 13:43:28 UTC) #8
asanka
https://codereview.chromium.org/12212010/diff/3005/base/sys_info.h File base/sys_info.h (right): https://codereview.chromium.org/12212010/diff/3005/base/sys_info.h#newcode40 base/sys_info.h:40: static int GetMaximumPathComponentLength(const FilePath& path); Why in sys_info.h? Have ...
7 years, 10 months ago (2013-02-12 20:20:12 UTC) #9
kinaba
Revised the patch. Mark, could you take another look? I felt better to move the ...
7 years, 10 months ago (2013-02-14 04:52:46 UTC) #10
Mark Mentovai
https://codereview.chromium.org/12212010/diff/24002/base/file_util_win.cc File base/file_util_win.cc (right): https://codereview.chromium.org/12212010/diff/24002/base/file_util_win.cc#newcode963 base/file_util_win.cc:963: PathStripToRootW(&root[0]); Looking at http://msdn.microsoft.com/en-us/library/windows/desktop/bb773757(v=vs.85).aspx , it recommends PathCchStripToRoot because ...
7 years, 10 months ago (2013-02-14 13:40:57 UTC) #11
asanka
https://codereview.chromium.org/12212010/diff/24002/base/file_util_win.cc File base/file_util_win.cc (right): https://codereview.chromium.org/12212010/diff/24002/base/file_util_win.cc#newcode963 base/file_util_win.cc:963: PathStripToRootW(&root[0]); On 2013/02/14 13:40:58, Mark Mentovai wrote: > Looking ...
7 years, 10 months ago (2013-02-14 16:06:52 UTC) #12
kinaba
Thanks for pointing out the essentials! Changed the code to use GetVolumePathName as suggested. Some ...
7 years, 10 months ago (2013-02-15 06:34:53 UTC) #13
Mark Mentovai
https://codereview.chromium.org/12212010/diff/6051/base/file_util_win.cc File base/file_util_win.cc (right): https://codereview.chromium.org/12212010/diff/6051/base/file_util_win.cc#newcode958 base/file_util_win.cc:958: MAX_PATH)) { arraysize(volume_path) https://codereview.chromium.org/12212010/diff/6051/base/file_util_win.cc#newcode970 base/file_util_win.cc:970: int whole_path_limit = std::max(0, ...
7 years, 10 months ago (2013-02-15 13:49:41 UTC) #14
kinaba
Updated. https://codereview.chromium.org/12212010/diff/6051/base/file_util_win.cc File base/file_util_win.cc (right): https://codereview.chromium.org/12212010/diff/6051/base/file_util_win.cc#newcode958 base/file_util_win.cc:958: MAX_PATH)) { On 2013/02/15 13:49:42, Mark Mentovai wrote: ...
7 years, 10 months ago (2013-02-18 03:30:20 UTC) #15
Mark Mentovai
LGTM in base.
7 years, 10 months ago (2013-02-18 23:49:03 UTC) #16
kinaba
Thank you for the review, Mark. asanka, could you please take one more round of ...
7 years, 10 months ago (2013-02-19 06:14:50 UTC) #17
asanka
Apologies for the delay. I have a couple of nits for the current patchset. Could ...
7 years, 10 months ago (2013-02-19 17:59:15 UTC) #18
kinaba
Added some test coverage. I'd like to tackle the file_util::GetUniquePathNumber() part separately (thanks for letting ...
7 years, 10 months ago (2013-02-20 13:57:40 UTC) #19
asanka
Sounds good. Thank you! chrome/browser/download LGTM
7 years, 10 months ago (2013-02-20 16:49:03 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kinaba@chromium.org/12212010/42001
7 years, 10 months ago (2013-02-20 22:28:38 UTC) #21
commit-bot: I haz the power
Change committed as 183727
7 years, 10 months ago (2013-02-21 03:24:10 UTC) #22
Nico
https://chromiumcodereview.appspot.com/12212010/diff/42001/chrome/browser/download/download_path_reservation_tracker_unittest.cc File chrome/browser/download/download_path_reservation_tracker_unittest.cc (right): https://chromiumcodereview.appspot.com/12212010/diff/42001/chrome/browser/download/download_path_reservation_tracker_unittest.cc#newcode456 chrome/browser/download/download_path_reservation_tracker_unittest.cc:456: #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_CHROMEOS) It's OS_MACOSX ( ...
7 years, 9 months ago (2013-03-13 23:25:00 UTC) #23
kinaba
On 2013/03/13 23:25:00, Nico wrote: > https://chromiumcodereview.appspot.com/12212010/diff/42001/chrome/browser/download/download_path_reservation_tracker_unittest.cc > File chrome/browser/download/download_path_reservation_tracker_unittest.cc > (right): > > https://chromiumcodereview.appspot.com/12212010/diff/42001/chrome/browser/download/download_path_reservation_tracker_unittest.cc#newcode456 ...
7 years, 9 months ago (2013-03-13 23:34:54 UTC) #24
tfarina
7 years, 9 months ago (2013-03-14 16:00:48 UTC) #25
Message was sent while issue was closed.
https://codereview.chromium.org/12212010/diff/42001/chrome/browser/download/d...
File chrome/browser/download/download_path_reservation_tracker.cc (right):

https://codereview.chromium.org/12212010/diff/42001/chrome/browser/download/d...
chrome/browser/download/download_path_reservation_tracker.cc:34: static const
size_t kTruncatedNameLengthLowerbound = 5;
nit: you are already in unnamed namespace, static is redundant here.

Powered by Google App Engine
This is Rietveld 408576698