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

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

Issue 1832343002: Introduce BackspaceStateMachine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
new file mode 100644
index 0000000000000000000000000000000000000000..ae5a95906378cb942c9cdaccfd117ed34efb3bcf
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/BackspaceStateMachine.h
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BackspaceStateMachine_h
+#define BackspaceStateMachine_h
+
+#include "core/CoreExport.h"
+#include "wtf/Allocator.h"
+#include "wtf/Noncopyable.h"
+#include <stdint.h>
+
+namespace blink {
+
+class CORE_EXPORT BackspaceStateMachine {
+ STACK_ALLOCATED();
+ WTF_MAKE_NONCOPYABLE(BackspaceStateMachine);
+public:
+ BackspaceStateMachine() = default;
+
+ // Returns true when the state machine has stopped.
+ bool updateState(uint16_t codeUnit);
tkent 2016/03/29 00:06:46 uint16_t -> UChar
Seigo Nonaka 2016/03/29 04:29:05 Done.
+
+ // 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();
+
+ // Resets the internal state to the initial state.
+ void reset();
+
+private:
+ int m_codeUnitsToBeDeleted = 0;
+
+ // Used for composing supplementary code point with surrogate pairs.
+ uint16_t m_trailSurrogate = 0;
tkent 2016/03/29 00:06:46 uint16_t -> UChar
Seigo Nonaka 2016/03/29 04:29:05 Done.
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698