Clean up ifdef around FilePath creation(webkit)

Splitting from the original patch here, crrev.com/14942008
to only include 'webkit' specific changes

BUG=102853

Review URL: https://chromiumcodereview.appspot.com/14680012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203002 0039d316-1c4b-4281-b951-d872f2087c98
parent 33286c9c
...@@ -219,11 +219,8 @@ bool MimeUtil::GetMimeTypeFromExtensionHelper( ...@@ -219,11 +219,8 @@ bool MimeUtil::GetMimeTypeFromExtensionHelper(
// Finally, we scan a secondary hard-coded list to catch types that we can // 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. // deduce but that we also want to allow the OS to override.
#if defined(OS_WIN) base::FilePath path_ext(ext);
string ext_narrow_str = WideToUTF8(ext); const string ext_narrow_str = path_ext.AsUTF8Unsafe();
#elif defined(OS_POSIX)
const string& ext_narrow_str = ext;
#endif
const char* mime_type; const char* mime_type;
mime_type = FindMimeType(primary_mappings, arraysize(primary_mappings), mime_type = FindMimeType(primary_mappings, arraysize(primary_mappings),
......
...@@ -83,11 +83,7 @@ bool PluginStream::Open(const std::string& mime_type, ...@@ -83,11 +83,7 @@ bool PluginStream::Open(const std::string& mime_type,
} else { } else {
GURL gurl(stream_.url); GURL gurl(stream_.url);
#if defined(OS_WIN) base::FilePath path = base::FilePath::FromUTF8Unsafe(gurl.path());
base::FilePath path(UTF8ToWide(gurl.path()));
#elif defined(OS_POSIX)
base::FilePath path(gurl.path());
#endif
if (net::GetMimeTypeFromFile(path, &temp_mime_type)) if (net::GetMimeTypeFromFile(path, &temp_mime_type))
char_mime_type = temp_mime_type.c_str(); char_mime_type = temp_mime_type.c_str();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment