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

Unified Diff: third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h

Issue 2629573002: Allow WebString.utf8() to take UTF8ConversionMode (Closed)
Patch Set: comment fix Created 3 years, 11 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
Index: third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
diff --git a/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h b/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
index 9eeb3bacea8a7aab1a081fe3662c107a03e983a8..1aa0897f500a609a7d1505cb27f3c5d37cf26647 100644
--- a/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
+++ b/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
@@ -46,7 +46,9 @@ class StringUTF8Adaptor final {
DISALLOW_NEW();
public:
- explicit StringUTF8Adaptor(const String& string) : m_data(0), m_length(0) {
+ StringUTF8Adaptor(const String& string,
+ UTF8ConversionMode mode = LenientUTF8Conversion)
+ : m_data(0), m_length(0) {
if (string.isEmpty())
return;
// Unfortunately, 8 bit WTFStrings are encoded in Latin-1 and GURL uses
@@ -57,7 +59,7 @@ class StringUTF8Adaptor final {
m_data = reinterpret_cast<const char*>(string.characters8());
m_length = string.length();
} else {
- m_utf8Buffer = string.utf8();
+ m_utf8Buffer = string.utf8(mode);
m_data = m_utf8Buffer.data();
m_length = m_utf8Buffer.length();
}
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebStringTest.cpp ('k') | third_party/WebKit/public/platform/WebString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698