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

Unified Diff: src/unicode.h

Issue 2314663002: Rework scanner-character-streams. (Closed)
Patch Set: Add comments to document Utf8ExternalStreamingStream's internal state. Created 4 years, 3 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: src/unicode.h
diff --git a/src/unicode.h b/src/unicode.h
index 35717bca868da4e17bff98ee7012932c7149b599..bbe4209f6815e8559f55fb0f972d4ba7b8817610 100644
--- a/src/unicode.h
+++ b/src/unicode.h
@@ -141,6 +141,8 @@ class Utf8 {
// The unicode replacement character, used to signal invalid unicode
// sequences (e.g. an orphan surrogate) when converting to a UTF-8 encoding.
static const uchar kBadChar = 0xFFFD;
+ static const uchar kBufferEmpty = 0x0;
+ static const uchar kIncomplete = 0xFFFFFFFC; // any non-valid code point.
static const unsigned kMaxEncodedSize = 4;
static const unsigned kMaxOneByteChar = 0x7f;
static const unsigned kMaxTwoByteChar = 0x7ff;
@@ -156,6 +158,10 @@ class Utf8 {
static const unsigned kMax16BitCodeUnitSize = 3;
static inline uchar ValueOf(const byte* str, size_t length, size_t* cursor);
+ typedef uint32_t Utf8IncrementalBuffer;
+ static uchar ValueOfIncremental(byte next_byte,
+ Utf8IncrementalBuffer& buffer);
+
// Excludes non-characters from the set of valid code points.
static inline bool IsValidCharacter(uchar c);

Powered by Google App Engine
This is Rietveld 408576698