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

Unified Diff: net/base/mime_util.cc

Issue 14680012: Clean up ifdef around FilePath creation(webkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@filepath2
Patch Set: Clean up ifdef around FilePath creation(webkit) Created 7 years, 7 months 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
« no previous file with comments | « no previous file | webkit/plugins/npapi/plugin_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_util.cc
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index 67c7242c815b7283ae09d8a65a3713ea9aaa10ff..6863c21f995f22d5c4cc980dac8ea28c5f3c67bd 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -15,6 +15,7 @@
#include "base/logging.h"
#include "base/string_util.h"
#include "base/strings/string_split.h"
+#include "base/strings/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
using std::string;
@@ -221,8 +222,10 @@ bool MimeUtil::GetMimeTypeFromExtensionHelper(
#if defined(OS_WIN)
string ext_narrow_str = WideToUTF8(ext);
-#elif defined(OS_POSIX)
+#elif defined(OS_MACOSX) || defined(OS_CHROMEOS)
const string& ext_narrow_str = ext;
+#else
+ const string& ext_narrow_str = WideToUTF8(base::SysNativeMBToWide(ext));
Bernhard Bauer 2013/05/28 21:26:14 Why don't you just use FilePath::AsUTF8Unsafe? The
mrunal 2013/05/28 21:38:47 Because FilePath::AsUTF8Unsafe() is not a static f
Bernhard Bauer 2013/05/28 22:04:00 Right, just construct a new FilePath (which copies
mrunal 2013/05/28 22:41:02 Yeah that will be bit ugly but I get your point no
#endif
const char* mime_type;
« no previous file with comments | « no previous file | webkit/plugins/npapi/plugin_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698