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

Unified Diff: third_party/WebKit/Source/core/editing/commands/UndoStep.cpp

Issue 2639483002: Add sequence number to undo steps (Closed)
Patch Set: Fri Feb 17 13:12:45 PST 2017 Created 3 years, 10 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/commands/UndoStep.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/UndoStep.cpp b/third_party/WebKit/Source/core/editing/commands/UndoStep.cpp
index bbc47d2ad5d3750119842c5ce9b93e9867679904..837955ea8e8f9928fb78b2ee5fc161135c25c969 100644
--- a/third_party/WebKit/Source/core/editing/commands/UndoStep.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/UndoStep.cpp
@@ -9,6 +9,11 @@
namespace blink {
+namespace {
+
yosin_UTC9 2017/02/20 06:17:50 nit: Get rid this extra blank line or add a blank
Xiaocheng 2017/02/22 02:47:32 |git cl format| did this. I'll remove the blank l
+uint64_t s_nextSequenceNumber = 0;
yosin_UTC9 2017/02/20 06:17:50 nit:s/nextSequneceNumber/currentSequenceNumber/ Si
Xiaocheng 2017/02/22 02:47:32 Done.
+}
+
UndoStep* UndoStep::create(Document* document,
const VisibleSelection& startingSelection,
const VisibleSelection& endingSelection,
@@ -25,7 +30,8 @@ UndoStep::UndoStep(Document* document,
m_endingSelection(endingSelection),
m_startingRootEditableElement(startingSelection.rootEditableElement()),
m_endingRootEditableElement(endingSelection.rootEditableElement()),
- m_inputType(inputType) {}
+ m_inputType(inputType),
+ m_sequenceNumber(++s_nextSequenceNumber) {}
void UndoStep::unapply() {
DCHECK(m_document);

Powered by Google App Engine
This is Rietveld 408576698