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

Unified Diff: third_party/WebKit/Source/core/editing/BackspaceStateMachine.h

Issue 1839753005: Move state machines to state_machines subdir (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds DCHECK Created 4 years, 9 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/core/editing/BackspaceStateMachine.h
diff --git a/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h b/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h
index 140442cd7414bda02ebee0db8f437c3f997ab467..7043af79e44818985efc51dfe50941d26b5893eb 100644
--- a/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h
+++ b/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h
@@ -16,15 +16,24 @@ class CORE_EXPORT BackspaceStateMachine {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(BackspaceStateMachine);
public:
+ enum class State {
+ Unknown, // Indicates the state machine is in unknown state.
+ NeedMoreCodeUnit, // Indicates the state machine needs more code units to transit the state.
+ NeedFollowingCodeUnit, // Indicates the state machine needs following code units to transit the state.
+ Finished, // Indicates the state machine found a boundary.
+ };
BackspaceStateMachine() = default;
- // Returns true when the state machine has stopped.
- bool updateState(UChar codeUnit);
+ // Prepares by feeding preceding text.
+ // This method must not be called after feedFollowingCodeUnit().
+ State feedPrecedingCodeUnit(UChar codeUnit);
yosin_UTC9 2016/03/30 04:44:27 BTW, how do we specify no preceding characters, e.
Seigo Nonaka 2016/03/30 06:58:57 Yes this is the reason why I can't put NOTREACHED
- // Finalize the state machine and returns the code unit count to be deleted.
- // If the state machine hasn't finished, this method finishes the state
- // machine first.
- int finalizeAndGetCodeUnitCountToBeDeleted();
+ // Find boundary offset by feeding following text.
+ // This method must be called after feedPrecedingCodeUnit() returns PreparationDone.
yosin_UTC9 2016/03/30 01:58:41 |enum class State| doesn't have member |Preparatio
Seigo Nonaka 2016/03/30 06:58:57 Done.
+ State feedFollowingCodeUnit(UChar codeUnit);
+
+ // Returns the next boundary offset. This method finalizes the state machine if it is not finished.
+ int finalizeAndGetBoundaryOffset();
// Resets the internal state to the initial state.
void reset();

Powered by Google App Engine
This is Rietveld 408576698