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

Issue 151065: Fix the local file listing and FTP file listing. For the former, use the OS f... (Closed)

Created:
11 years, 5 months ago by jungshik at Google
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, willchan no longer on Chromium
Visibility:
Public.

Description

Fix the local directory listing, FTP directory listing and the local file handling (drag'n'drop and opening from the file list). For the local file listing, use the OS file system encoding. For the FTP directory listing, use ICU's encoding detector.GetDirectoryListingEntry and GetDirectoryLisingHeader were changed to accept string16 for file/directory names. To the former, a new parameter (|raw_bytes|) was added. It can be used to make a FTP request to a file with a non-ASCII name encoded in a legacy encoding. For the local file handling on Windows, get rid of the code for 'doubly converted' UTF-8 in FileURLToFilePath, which led to issue 4619 and add a few cases to NetUtil*.FileURLConversion* test. In addition, add CodepageToUTF16 and UTF16ToCodepage along with a new unittest (ConvertBetweenCodepageAndUTF16) that shares the same set of case as ConvertBetweenCodepageAndWide. The test cases were expanded and revised a bit. BUG=2939, 13229, 4619 http://crbug.com/2939 http://crbug.com/13229 http://crbug.com/4619 TEST=1. Pass URLRequest*.FTP* (net_unittests) 2. Pass StringUtiltTest.ConvertBetweenCode* 3. Pass NetUtil*.GetDirectoryLis* (net_unittests) 4. Open a local directory containing files with non-ASCII names and they're displayed correctly in the directory list. On Windows and Mac OS X, it should always work. On Linux, your locale encoding (as returned by nl_langinfo(CODESET)) should match the actual encoding used in your filename. 5a. Pass NetUtil*.FileURL* (net_unittests) with the default codepage set to 1252 and 932. 5b. Make a file named 'café.txt' on Windows and see if it can be opened both by clicking in the directory listing page of Chrome and by drag'n'drop. Test this with the default OS code pages set to Windows-1252, Windows-1251 (Russian) and Windows-932 (Japanese). Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20331

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Total comments: 24

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Patch Set 18 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+647 lines, -253 lines) Patch
M base/string_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +38 lines, -1 line 1 comment Download
M base/string_util_icu.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 8 chunks +202 lines, -80 lines 1 comment Download
M base/string_util_unittest.cc View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +203 lines, -98 lines 1 comment Download
M net/base/net_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +19 lines, -6 lines 0 comments Download
M net/base/net_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +10 lines, -4 lines 0 comments Download
M net/base/net_util_unittest.cc View 10 11 12 13 14 15 16 17 4 chunks +47 lines, -19 lines 0 comments Download
M net/base/net_util_win.cc View 11 12 13 14 15 16 17 1 chunk +7 lines, -27 lines 0 comments Download
M net/url_request/url_request_file_dir_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +13 lines, -4 lines 0 comments Download
M net/url_request/url_request_ftp_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +24 lines, -7 lines 0 comments Download
MM net/url_request/url_request_new_ftp_job.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
MM net/url_request/url_request_new_ftp_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +83 lines, -7 lines 1 comment Download

Messages

Total messages: 8 (0 generated)
jungshik at Google
Asking for review before going further. Currently, I haven't been able to test with --new-ftp ...
11 years, 5 months ago (2009-07-02 15:02:02 UTC) #1
brettw
http://codereview.chromium.org/151065/diff/1087/128 File base/string_util.h (right): http://codereview.chromium.org/151065/diff/1087/128#newcode186 Line 186: #define LITERAL_UTF16(s) ASCIIToUTF16(s) I think somebody tried to ...
11 years, 5 months ago (2009-07-02 21:37:22 UTC) #2
jungshik at Google
Thank you for the review. I've addressed all your concerns except for CodepageToUTF16/UTF16ToCodepage that I'm ...
11 years, 5 months ago (2009-07-06 18:09:45 UTC) #3
jungshik at Google
Brett, can you take another look? Thanks
11 years, 5 months ago (2009-07-07 06:36:42 UTC) #4
jungshik at Google
On 2009/07/07 06:36:42, Jungshik Shin wrote: > Brett, can you take another look? Thanks Patch ...
11 years, 5 months ago (2009-07-07 19:26:31 UTC) #5
brettw
LGTM http://codereview.chromium.org/151065/diff/2113/3080 File base/string_util.h (right): http://codereview.chromium.org/151065/diff/2113/3080#newcode263 Line 263: inline bool WideToCodepage(const std::wstring& wide, I think ...
11 years, 5 months ago (2009-07-07 19:59:48 UTC) #6
jungshik at Google
Brett, Thank you for the review. I've addressed your concerns locally (not uploaded a new ...
11 years, 5 months ago (2009-07-07 23:51:09 UTC) #7
wtc
11 years, 5 months ago (2009-07-15 23:53:23 UTC) #8
http://codereview.chromium.org/151065/diff/2113/3077
File net/url_request/url_request_new_ftp_job.cc (right):

http://codereview.chromium.org/151065/diff/2113/3077#newcode29
Line 29: std::string DetectEncoding(const char*input, size_t len) {
Nit: add a space before 'input'.

Powered by Google App Engine
This is Rietveld 408576698