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

Unified Diff: third_party/WebKit/public/platform/WebString.h

Issue 2629573002: Allow WebString.utf8() to take UTF8ConversionMode (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/WebString.h
diff --git a/third_party/WebKit/public/platform/WebString.h b/third_party/WebKit/public/platform/WebString.h
index 5c1c5406f5af30f85631655cc9ba0340752e8d1c..b9db337d61221ddcfb96e65b79f43b950f2f0025 100644
--- a/third_party/WebKit/public/platform/WebString.h
+++ b/third_party/WebKit/public/platform/WebString.h
@@ -79,6 +79,12 @@ namespace blink {
//
class WebString {
public:
+ enum UTF8ConversionMode {
jochen (gone - plz use gerrit) 2017/01/13 08:42:31 nit. why not an enum class? constants should start
kinuko 2017/01/17 07:15:49 Done.
+ LenientUTF8Conversion,
+ StrictUTF8Conversion,
+ StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD
+ };
+
~WebString() { reset(); }
WebString() {}
@@ -104,7 +110,8 @@ class WebString {
bool isEmpty() const { return !length(); }
bool isNull() const { return m_private.isNull(); }
- BLINK_COMMON_EXPORT std::string utf8() const;
+ BLINK_COMMON_EXPORT std::string utf8(
+ UTF8ConversionMode = LenientUTF8Conversion) const;
BLINK_COMMON_EXPORT static WebString fromUTF8(const char* data,
size_t length);
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698