Chromium Code Reviews| Index: net/base/mime_util.cc |
| diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc |
| index 67c7242c815b7283ae09d8a65a3713ea9aaa10ff..7c73cd2a6937be9f8db60700c1e2d563ac428524 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(); |
|
Bernhard Bauer
2013/05/28 23:26:41
You should not take a reference here! The returned
|
| const char* mime_type; |
| mime_type = FindMimeType(primary_mappings, arraysize(primary_mappings), |