diff options
-rw-r--r-- | net/base/mime_util.cc | 7 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_stream.cc | 6 |
2 files changed, 3 insertions, 10 deletions
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc index 3212b5c..0e2613e 100644 --- a/net/base/mime_util.cc +++ b/net/base/mime_util.cc @@ -219,11 +219,8 @@ bool MimeUtil::GetMimeTypeFromExtensionHelper( // Finally, we scan a secondary hard-coded list to catch types that we can // deduce but that we also want to allow the OS to override. -#if defined(OS_WIN) - string ext_narrow_str = WideToUTF8(ext); -#elif defined(OS_POSIX) - const string& ext_narrow_str = ext; -#endif + base::FilePath path_ext(ext); + const string ext_narrow_str = path_ext.AsUTF8Unsafe(); const char* mime_type; mime_type = FindMimeType(primary_mappings, arraysize(primary_mappings), diff --git a/webkit/plugins/npapi/plugin_stream.cc b/webkit/plugins/npapi/plugin_stream.cc index 1769b68..44fc224 100644 --- a/webkit/plugins/npapi/plugin_stream.cc +++ b/webkit/plugins/npapi/plugin_stream.cc @@ -83,11 +83,7 @@ bool PluginStream::Open(const std::string& mime_type, } else { GURL gurl(stream_.url); -#if defined(OS_WIN) - base::FilePath path(UTF8ToWide(gurl.path())); -#elif defined(OS_POSIX) - base::FilePath path(gurl.path()); -#endif + base::FilePath path = base::FilePath::FromUTF8Unsafe(gurl.path()); if (net::GetMimeTypeFromFile(path, &temp_mime_type)) char_mime_type = temp_mime_type.c_str(); } |