diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-04 20:41:33 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-04 20:41:33 +0000 |
commit | 8a205c0f534bf8e5f17a531182dee38aaacd46e6 (patch) | |
tree | 1b1bab965f71658393dccdda1590d59711689962 /chrome/common/zip.cc | |
parent | 58023bea8fa444c4ac08c12c825dcc79b5954abe (diff) | |
download | chromium_src-8a205c0f534bf8e5f17a531182dee38aaacd46e6.zip chromium_src-8a205c0f534bf8e5f17a531182dee38aaacd46e6.tar.gz chromium_src-8a205c0f534bf8e5f17a531182dee38aaacd46e6.tar.bz2 |
FilePath: Remove much of ToWStringHack, adding a LossyDisplayName()
The reason we don't want a free conversion between FilePaths and Unicode
is that it can be lossy. But when displaying a string to the user,
we're ok if it's lossy when we have no other option.
This change introduces a LossyDisplayName() method that returns a
string16, and converts many of the users of ToWStringHack to use it.
BUG=69467
Review URL: http://codereview.chromium.org/6246036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73840 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/zip.cc')
-rw-r--r-- | chrome/common/zip.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/common/zip.cc b/chrome/common/zip.cc index 3e24b53..d5ff5d0 100644 --- a/chrome/common/zip.cc +++ b/chrome/common/zip.cc @@ -206,7 +206,7 @@ static bool AddFileToZip(zipFile zip_file, const FilePath& src_dir) { int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; if (stream.Open(src_dir, flags) != 0) { LOG(ERROR) << "Could not open stream for path " - << WideToASCII(src_dir.ToWStringHack()); + << src_dir.value(); return false; } @@ -217,7 +217,7 @@ static bool AddFileToZip(zipFile zip_file, const FilePath& src_dir) { if (num_bytes > 0) { if (ZIP_OK != zipWriteInFileInZip(zip_file, buf, num_bytes)) { LOG(ERROR) << "Could not write data to zip for path " - << WideToASCII(src_dir.ToWStringHack()); + << src_dir.value(); return false; } } @@ -296,7 +296,7 @@ bool Zip(const FilePath& src_dir, const FilePath& dest_file, file_util::FileEnumerator::DIRECTORIES)); for (FilePath path = file_enumerator.Next(); !path.value().empty(); path = file_enumerator.Next()) { - if (!include_hidden_files && path.BaseName().ToWStringHack()[0] == L'.') + if (!include_hidden_files && path.BaseName().value()[0] == '.') continue; if (!AddEntryToZip(zip_file, path, src_dir)) { |