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

Unified Diff: base/files/file_path.cc

Issue 790903003: Generalizing conditional compilation logic for systems with native utf8 locale. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/files/file_path.cc
diff --git a/base/files/file_path.cc b/base/files/file_path.cc
index bf37be615b1a510410d63cca54e60c5e7f76822e..33d5ca1b8847f5726f74e10c39366f232de5ab4e 100644
--- a/base/files/file_path.cc
+++ b/base/files/file_path.cc
@@ -593,7 +593,7 @@ std::string FilePath::MaybeAsASCII() const {
}
std::string FilePath::AsUTF8Unsafe() const {
-#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
+#if defined(SYSTEM_NATIVE_UTF8)
return value();
#else
return WideToUTF8(SysNativeMBToWide(value()));
@@ -601,7 +601,7 @@ std::string FilePath::AsUTF8Unsafe() const {
}
string16 FilePath::AsUTF16Unsafe() const {
-#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
+#if defined(SYSTEM_NATIVE_UTF8)
return UTF8ToUTF16(value());
#else
return WideToUTF16(SysNativeMBToWide(value()));
@@ -610,7 +610,7 @@ string16 FilePath::AsUTF16Unsafe() const {
// static
FilePath FilePath::FromUTF8Unsafe(const std::string& utf8) {
-#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
+#if defined(SYSTEM_NATIVE_UTF8)
return FilePath(utf8);
#else
return FilePath(SysWideToNativeMB(UTF8ToWide(utf8)));
@@ -619,7 +619,7 @@ FilePath FilePath::FromUTF8Unsafe(const std::string& utf8) {
// static
FilePath FilePath::FromUTF16Unsafe(const string16& utf16) {
-#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
+#if defined(SYSTEM_NATIVE_UTF8)
return FilePath(UTF16ToUTF8(utf16));
#else
return FilePath(SysWideToNativeMB(UTF16ToWide(utf16)));

Powered by Google App Engine
This is Rietveld 408576698