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

Issue 8402008: Add FilePath::FromUTF8Unsafe() and FilePath::AsUTF8Unsafe(). (Closed)

Created:
9 years, 1 month ago by satorux1
Modified:
9 years, 1 month ago
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

Add FilePath::FromUTF8Unsafe() and FilePath::AsUTF8Unsafe(). The logic is moved from value_conversions.cc. FilePath::FromUTF8Unsafe() should only be used when you are sure that the input string is UTF-8. See the function comments for why they have "Unsafe" in their names. BUG=none TEST=base_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=108246

Patch Set 1 #

Total comments: 5

Patch Set 2 : Add Unsafe to names and add more comments and tests #

Total comments: 6

Patch Set 3 : address comments #

Total comments: 2

Patch Set 4 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -27 lines) Patch
M base/file_path.h View 1 2 3 3 chunks +26 lines, -0 lines 0 comments Download
M base/file_path.cc View 1 2 3 chunks +27 lines, -0 lines 0 comments Download
M base/file_path_unittest.cc View 1 3 chunks +30 lines, -0 lines 0 comments Download
M base/value_conversions.cc View 1 2 chunks +2 lines, -27 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
satorux1
Hi Mark, Tony suggested you would be the right reviewer for this.
9 years, 1 month ago (2011-10-26 23:22:50 UTC) #1
Mark Mentovai
Read the header at the points I’ve marked and if you still think this change ...
9 years, 1 month ago (2011-10-26 23:29:13 UTC) #2
satorux1
On 2011/10/26 23:29:13, Mark Mentovai wrote: > Read the header at the points I’ve marked ...
9 years, 1 month ago (2011-10-26 23:45:47 UTC) #3
Mark Mentovai
We don’t know what encoding pathnames are in. We don’t know that it’s got anything ...
9 years, 1 month ago (2011-10-26 23:51:48 UTC) #4
satorux1
On 2011/10/26 23:51:48, Mark Mentovai wrote: > We don’t know what encoding pathnames are in. ...
9 years, 1 month ago (2011-10-27 00:04:25 UTC) #5
tony
FWIW, there are plenty of bugs in the existing codebase that assumes that filenames on ...
9 years, 1 month ago (2011-10-27 17:33:06 UTC) #6
satorux1
On 2011/10/27 17:33:06, tony wrote: > FWIW, there are plenty of bugs in the existing ...
9 years, 1 month ago (2011-10-28 16:56:24 UTC) #7
satorux1
Jungshik, could you take a look at the change as well as the code review ...
9 years, 1 month ago (2011-10-28 16:58:20 UTC) #8
jungshik at Google
On 2011/10/28 16:58:20, satorux1 wrote: > Jungshik, could you take a look at the change ...
9 years, 1 month ago (2011-10-31 21:28:13 UTC) #9
jungshik at Google
http://codereview.chromium.org/8402008/diff/1/base/file_path_unittest.cc File base/file_path_unittest.cc (right): http://codereview.chromium.org/8402008/diff/1/base/file_path_unittest.cc#newcode1054 base/file_path_unittest.cc:1054: EXPECT_EQ("foo.txt", path.AsUTF8()); Would you consider adding some non-trivial cases ...
9 years, 1 month ago (2011-10-31 21:29:03 UTC) #10
Mark Mentovai
If this is a direction we head in, can we give it an Unsafe or ...
9 years, 1 month ago (2011-10-31 21:33:52 UTC) #11
tony
glib already assumes filename encoding is utf8 unless you set G_FILENAME_ENCODING or G_BROKEN_FILENAMES. Which is ...
9 years, 1 month ago (2011-10-31 22:06:10 UTC) #12
satorux1
Thank you all for the feedback. Per Mark's comment, I've changed the file names to ...
9 years, 1 month ago (2011-11-01 17:37:16 UTC) #13
jungshik at Google
LGTM
9 years, 1 month ago (2011-11-01 20:35:14 UTC) #14
satorux1
Try results look good. Mark, please take another look. Thanks,
9 years, 1 month ago (2011-11-01 21:07:28 UTC) #15
Mark Mentovai
http://codereview.chromium.org/8402008/diff/11001/base/file_path.cc File base/file_path.cc (right): http://codereview.chromium.org/8402008/diff/11001/base/file_path.cc#newcode531 base/file_path.cc:531: return WideToUTF8(base::SysNativeMBToWide(value())); Per the comment I made in the ...
9 years, 1 month ago (2011-11-01 21:30:46 UTC) #16
satorux1
http://codereview.chromium.org/8402008/diff/11001/base/file_path.cc File base/file_path.cc (right): http://codereview.chromium.org/8402008/diff/11001/base/file_path.cc#newcode531 base/file_path.cc:531: return WideToUTF8(base::SysNativeMBToWide(value())); On 2011/11/01 21:30:46, Mark Mentovai wrote: > ...
9 years, 1 month ago (2011-11-01 21:49:55 UTC) #17
Mark Mentovai
http://codereview.chromium.org/8402008/diff/11003/base/file_path.h File base/file_path.h (right): http://codereview.chromium.org/8402008/diff/11003/base/file_path.h#newcode304 base/file_path.h:304: // SysNativeMBToWide() on POSIX systems where the file name ...
9 years, 1 month ago (2011-11-01 21:53:31 UTC) #18
satorux1
http://codereview.chromium.org/8402008/diff/11003/base/file_path.h File base/file_path.h (right): http://codereview.chromium.org/8402008/diff/11003/base/file_path.h#newcode304 base/file_path.h:304: // SysNativeMBToWide() on POSIX systems where the file name ...
9 years, 1 month ago (2011-11-01 22:00:12 UTC) #19
Mark Mentovai
9 years, 1 month ago (2011-11-01 22:01:16 UTC) #20
LGTM

Powered by Google App Engine
This is Rietveld 408576698