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

Unified Diff: content/browser/download/save_package.cc

Issue 637493002: Clean up ifdef around FilePath creation in /src/content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | content/renderer/pepper/pepper_file_chooser_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/save_package.cc
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
index f857d093810135caeaf64dfa058e86d0eab71e73..4d95342d0081d1c9c4e398419db63d863affc237 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -1292,11 +1292,8 @@ const base::FilePath::CharType* SavePackage::ExtensionForMimeType(
{ FILE_PATH_LITERAL("text/plain"), FILE_PATH_LITERAL("txt") },
{ FILE_PATH_LITERAL("text/css"), FILE_PATH_LITERAL("css") },
};
-#if defined(OS_POSIX)
- base::FilePath::StringType mime_type(contents_mime_type);
-#elif defined(OS_WIN)
- base::FilePath::StringType mime_type(base::UTF8ToWide(contents_mime_type));
-#endif // OS_WIN
+base::FilePath::StringType mime_type =
+ base::FilePath::StringType::FromUTF8Unsafe(contents_mime_type);
jochen (gone - plz use gerrit) 2014/10/08 14:10:32 please clang-format this
for (uint32 i = 0; i < ARRAYSIZE_UNSAFE(extensions); ++i) {
if (mime_type == extensions[i].mime_type)
return extensions[i].suggested_extension;
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_file_chooser_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698