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

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

Issue 2379333003: UTF-16 Decoder: Convert unpaired surrogates to replacement characters (Closed)
Patch Set: Rebase, switch test to testharness Created 4 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
Index: third_party/WebKit/Source/wtf/text/TextCodecUTF16.h
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecUTF16.h b/third_party/WebKit/Source/wtf/text/TextCodecUTF16.h
index b080325fa10132815ba04d1cd6b65e463a00cad4..06ed917b923316500219bf7f30128fa59c2af01f 100644
--- a/third_party/WebKit/Source/wtf/text/TextCodecUTF16.h
+++ b/third_party/WebKit/Source/wtf/text/TextCodecUTF16.h
@@ -35,8 +35,7 @@ class TextCodecUTF16 final : public TextCodec {
static void registerEncodingNames(EncodingNameRegistrar);
static void registerCodecs(TextCodecRegistrar);
- TextCodecUTF16(bool littleEndian)
- : m_littleEndian(littleEndian), m_haveBufferedByte(false) {}
+ TextCodecUTF16(bool littleEndian) : m_littleEndian(littleEndian) {}
String decode(const char*,
size_t length,
@@ -48,8 +47,10 @@ class TextCodecUTF16 final : public TextCodec {
private:
bool m_littleEndian;
- bool m_haveBufferedByte;
- unsigned char m_bufferedByte;
+ bool m_haveLeadByte = false;
+ unsigned char m_leadByte;
+ bool m_haveLeadSurrogate = false;
+ UChar m_leadSurrogate;
};
} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698