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

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

Issue 1839753005: Move state machines to state_machines subdir (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix style errr 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/state_machines/BackspaceStateMachine.h
diff --git a/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h b/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.h
similarity index 51%
rename from third_party/WebKit/Source/core/editing/BackspaceStateMachine.h
rename to third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.h
index 140442cd7414bda02ebee0db8f437c3f997ab467..e72e74a7be67177d2924ffe65d2152e56741d968 100644
--- a/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h
+++ b/third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.h
@@ -6,6 +6,7 @@
#define BackspaceStateMachine_h
#include "core/CoreExport.h"
+#include "core/editing/state_machines/TextSegmentationMachineState.h"
#include "wtf/Allocator.h"
#include "wtf/Noncopyable.h"
#include "wtf/text/Unicode.h"
@@ -18,13 +19,19 @@ class CORE_EXPORT BackspaceStateMachine {
public:
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().
+ TextSegmentationMachineState feedPrecedingCodeUnit(UChar codeUnit);
- // 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();
+ // Tells the end of preceding text to the state machine.
+ TextSegmentationMachineState tellEndOfPrecedingText();
+
+ // Find boundary offset by feeding following text.
+ // This method must be called after feedPrecedingCodeUnit() returns NeedsFollowingCodeUnit.
+ TextSegmentationMachineState 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