Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/commands/UndoStack.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp b/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp |
| index 7f435982f87767a5c40c03c6590b17436a7cefc5..e492b81869c1569e2f3a0c67e283336a46c2a1ea 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/UndoStack.cpp |
| @@ -38,7 +38,7 @@ namespace blink { |
| // into a single action. |
| static const size_t maximumUndoStackDepth = 1000; |
| -UndoStack::UndoStack() : m_inRedo(false) {} |
| +UndoStack::UndoStack() : m_maxSequence(0), m_inRedo(false) {} |
| UndoStack* UndoStack::create() { |
| return new UndoStack(); |
| @@ -47,8 +47,10 @@ UndoStack* UndoStack::create() { |
| void UndoStack::registerUndoStep(UndoStep* step) { |
| if (m_undoStack.size() == maximumUndoStackDepth) |
| m_undoStack.removeFirst(); // drop oldest item off the far end |
| - if (!m_inRedo) |
| + if (!m_inRedo) { |
| m_redoStack.clear(); |
| + step->setSequence(++m_maxSequence); |
|
yosin_UTC9
2017/01/17 08:13:29
Usage of |m_maxSequence| isn't clear. Why incremen
Xiaocheng
2017/01/17 09:04:02
This is the place where a new undo step is pushed
|
| + } |
| m_undoStack.append(step); |
| } |