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

Unified Diff: content/child/simple_webmimeregistry_impl.cc

Issue 1686263008: Add utility method for WebString to base::FilePath conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase! Created 4 years, 10 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 | « base/files/file_path.cc ('k') | content/child/web_url_request_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/simple_webmimeregistry_impl.cc
diff --git a/content/child/simple_webmimeregistry_impl.cc b/content/child/simple_webmimeregistry_impl.cc
index d65a0ccfe4ecee3c0d60a32c422e80ceec49df9d..9b837040a9550b6493edd870a69e385aaf5e4753 100644
--- a/content/child/simple_webmimeregistry_impl.cc
+++ b/content/child/simple_webmimeregistry_impl.cc
@@ -10,6 +10,7 @@
#include "base/strings/utf_string_conversions.h"
#include "components/mime_util/mime_util.h"
#include "net/base/mime_util.h"
+#include "third_party/WebKit/public/platform/FilePathConversion.h"
#include "third_party/WebKit/public/platform/WebString.h"
using blink::WebString;
@@ -87,7 +88,7 @@ WebString SimpleWebMimeRegistryImpl::mimeTypeForExtension(
const WebString& file_extension) {
std::string mime_type;
net::GetMimeTypeFromExtension(
- base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type);
+ blink::WebStringToFilePath(file_extension).value(), &mime_type);
return WebString::fromUTF8(mime_type);
}
@@ -95,7 +96,7 @@ WebString SimpleWebMimeRegistryImpl::wellKnownMimeTypeForExtension(
const WebString& file_extension) {
std::string mime_type;
net::GetWellKnownMimeTypeFromExtension(
- base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type);
+ blink::WebStringToFilePath(file_extension).value(), &mime_type);
return WebString::fromUTF8(mime_type);
}
« no previous file with comments | « base/files/file_path.cc ('k') | content/child/web_url_request_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698