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

Unified Diff: base/files/file_path.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.h ('k') | content/child/simple_webmimeregistry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path.cc
diff --git a/base/files/file_path.cc b/base/files/file_path.cc
index fdaa46b3bbc2555030a44e05c586b6a133aa0151..de431232872f2c96fdf947b5c376ab4a84e78235 100644
--- a/base/files/file_path.cc
+++ b/base/files/file_path.cc
@@ -610,7 +610,7 @@ string16 FilePath::AsUTF16Unsafe() const {
}
// static
-FilePath FilePath::FromUTF8Unsafe(const std::string& utf8) {
+FilePath FilePath::FromUTF8Unsafe(StringPiece utf8) {
#if defined(SYSTEM_NATIVE_UTF8)
return FilePath(utf8);
#else
@@ -619,11 +619,11 @@ FilePath FilePath::FromUTF8Unsafe(const std::string& utf8) {
}
// static
-FilePath FilePath::FromUTF16Unsafe(const string16& utf16) {
+FilePath FilePath::FromUTF16Unsafe(StringPiece16 utf16) {
#if defined(SYSTEM_NATIVE_UTF8)
return FilePath(UTF16ToUTF8(utf16));
#else
- return FilePath(SysWideToNativeMB(UTF16ToWide(utf16)));
+ return FilePath(SysWideToNativeMB(UTF16ToWide(utf16.as_string())));
#endif
}
@@ -647,12 +647,12 @@ string16 FilePath::AsUTF16Unsafe() const {
}
// static
-FilePath FilePath::FromUTF8Unsafe(const std::string& utf8) {
+FilePath FilePath::FromUTF8Unsafe(StringPiece utf8) {
return FilePath(UTF8ToWide(utf8));
}
// static
-FilePath FilePath::FromUTF16Unsafe(const string16& utf16) {
+FilePath FilePath::FromUTF16Unsafe(StringPiece16 utf16) {
return FilePath(utf16);
}
#endif
« no previous file with comments | « base/files/file_path.h ('k') | content/child/simple_webmimeregistry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698