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

Unified Diff: third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.cpp

Issue 2801893004: Avoid duplicate functions/code in core/editing: kUnsetCodePoint (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.cpp
diff --git a/third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.cpp b/third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.cpp
index c7873f6d02cb88a5a776d9635cc5ea86736559db..1a7d6d9c4584940cc15011c075bf92d4108e8d6c 100644
--- a/third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.cpp
+++ b/third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.cpp
@@ -12,7 +12,7 @@
namespace blink {
namespace {
-const UChar32 kInvalidCodePoint = WTF::Unicode::kMaxCodepoint + 1;
+const UChar32 kUnsetCodePoint = WTF::Unicode::kMaxCodepoint + 1;
} // namespace
#define FOR_EACH_FORWARD_GRAPHEME_BOUNDARY_STATE(V) \
@@ -52,12 +52,12 @@ std::ostream& operator<<(
}
ForwardGraphemeBoundaryStateMachine::ForwardGraphemeBoundaryStateMachine()
- : m_prevCodePoint(kInvalidCodePoint),
+ : m_prevCodePoint(kUnsetCodePoint),
m_internalState(InternalState::CountRIS) {}
TextSegmentationMachineState
ForwardGraphemeBoundaryStateMachine::feedPrecedingCodeUnit(UChar codeUnit) {
- DCHECK_EQ(m_prevCodePoint, kInvalidCodePoint);
+ DCHECK_EQ(m_prevCodePoint, kUnsetCodePoint);
DCHECK_EQ(m_boundaryOffset, 0);
switch (m_internalState) {
case InternalState::CountRIS:
@@ -106,7 +106,7 @@ ForwardGraphemeBoundaryStateMachine::feedFollowingCodeUnit(UChar codeUnit) {
<< " is returned. InternalState: " << m_internalState;
return finish();
case InternalState::StartForward:
- DCHECK_EQ(m_prevCodePoint, kInvalidCodePoint);
+ DCHECK_EQ(m_prevCodePoint, kUnsetCodePoint);
DCHECK_EQ(m_boundaryOffset, 0);
DCHECK_EQ(m_pendingCodeUnit, 0);
if (U16_IS_TRAIL(codeUnit)) {
@@ -122,7 +122,7 @@ ForwardGraphemeBoundaryStateMachine::feedFollowingCodeUnit(UChar codeUnit) {
m_boundaryOffset = 1;
return moveToNextState(InternalState::Search);
case InternalState::StartForwardWaitTrailSurrgate:
- DCHECK_EQ(m_prevCodePoint, kInvalidCodePoint);
+ DCHECK_EQ(m_prevCodePoint, kUnsetCodePoint);
DCHECK_EQ(m_boundaryOffset, 0);
DCHECK_NE(m_pendingCodeUnit, 0);
if (U16_IS_TRAIL(codeUnit)) {
@@ -135,7 +135,7 @@ ForwardGraphemeBoundaryStateMachine::feedFollowingCodeUnit(UChar codeUnit) {
m_boundaryOffset = 1;
return finish();
case InternalState::Search:
- DCHECK_NE(m_prevCodePoint, kInvalidCodePoint);
+ DCHECK_NE(m_prevCodePoint, kUnsetCodePoint);
DCHECK_NE(m_boundaryOffset, 0);
DCHECK_EQ(m_pendingCodeUnit, 0);
if (U16_IS_LEAD(codeUnit)) {
@@ -150,7 +150,7 @@ ForwardGraphemeBoundaryStateMachine::feedFollowingCodeUnit(UChar codeUnit) {
m_boundaryOffset += 1;
return staySameState();
case InternalState::SearchWaitTrailSurrogate:
- DCHECK_NE(m_prevCodePoint, kInvalidCodePoint);
+ DCHECK_NE(m_prevCodePoint, kUnsetCodePoint);
DCHECK_NE(m_boundaryOffset, 0);
DCHECK_NE(m_pendingCodeUnit, 0);
if (!U16_IS_TRAIL(codeUnit))
@@ -209,7 +209,7 @@ void ForwardGraphemeBoundaryStateMachine::reset() {
m_pendingCodeUnit = 0;
m_boundaryOffset = 0;
m_precedingRISCount = 0;
- m_prevCodePoint = kInvalidCodePoint;
+ m_prevCodePoint = kUnsetCodePoint;
m_internalState = InternalState::CountRIS;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698