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

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..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),
« 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