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

Unified Diff: base/string_util.h

Issue 40106: Make UTF8ToWide take a StringPiece, to avoid copying to a std::string. (Closed)
Patch Set: Created 11 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 | « no previous file | base/string_util_icu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.h
diff --git a/base/string_util.h b/base/string_util.h
index 3f905fe6f0a11f10f177b1c25e9c269a815ffab7..04c43229d8d1066015ffde0b85e5ee1530954983 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -14,6 +14,7 @@
#include "base/basictypes.h"
#include "base/string16.h"
+#include "base/string_piece.h" // For implicit conversions.
// Safe standard library wrappers for all platforms.
@@ -173,7 +174,7 @@ string16 ASCIIToUTF16(const std::string& ascii);
bool WideToUTF8(const wchar_t* src, size_t src_len, std::string* output);
std::string WideToUTF8(const std::wstring& wide);
bool UTF8ToWide(const char* src, size_t src_len, std::wstring* output);
-std::wstring UTF8ToWide(const std::string& utf8);
+std::wstring UTF8ToWide(const StringPiece& utf8);
bool WideToUTF16(const wchar_t* src, size_t src_len, string16* output);
string16 WideToUTF16(const std::wstring& wide);
« no previous file with comments | « no previous file | base/string_util_icu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698