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

Unified Diff: sky/engine/wtf/text/WTFString.h

Issue 678683004: HTMLImportLoader should talk directly to mojo::NetworkService (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address reviewer comments 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 | « sky/engine/wtf/text/CString.h ('k') | sky/engine/wtf/text/WTFString.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/wtf/text/WTFString.h
diff --git a/sky/engine/wtf/text/WTFString.h b/sky/engine/wtf/text/WTFString.h
index d76742abb4383fcd6894b5028de7fb92cdd0980c..62c7a25fa7ff970bed3b70308b0954902704183c 100644
--- a/sky/engine/wtf/text/WTFString.h
+++ b/sky/engine/wtf/text/WTFString.h
@@ -179,6 +179,9 @@ public:
CString latin1() const;
CString utf8(UTF8ConversionMode = LenientUTF8Conversion) const;
+ // We should replace CString with std::string.
+ std::string toUTF8() const;
+
UChar operator[](unsigned index) const
{
if (!m_impl || index >= m_impl->length())
@@ -400,6 +403,7 @@ public:
static String fromUTF8(const char* s, size_t length) { return fromUTF8(reinterpret_cast<const LChar*>(s), length); };
static String fromUTF8(const char* s) { return fromUTF8(reinterpret_cast<const LChar*>(s)); };
static String fromUTF8(const CString&);
+ static String fromUTF8(const std::string& s) { return fromUTF8(s.data(), s.size()); }
// Tries to convert the passed in string to UTF-8, but will fall back to Latin-1 if the string is not valid UTF-8.
static String fromUTF8WithLatin1Fallback(const LChar*, size_t);
« no previous file with comments | « sky/engine/wtf/text/CString.h ('k') | sky/engine/wtf/text/WTFString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698