Chromium Code Reviews| 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 |