WebUndoStep's monotonically increasing identifier should be a WebUndoStepID instead...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2019 15:34:34 +0000 (15:34 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2019 15:34:34 +0000 (15:34 +0000)
commitcebed8c411192dfc2ba1e91cc628c2868fbdc54b
tree007c0388ffb428acb65111e9a29ede5533f3ac23
parent8a7a57780e8de4d38231f9f57ba4f73d9d673ade
WebUndoStep's monotonically increasing identifier should be a WebUndoStepID instead of uint64_t
https://bugs.webkit.org/show_bug.cgi?id=193100

Reviewed by Simon Fraser.

Add a type alias, WebUndoStepID, to represent the monotonically increasing undo step ID for each undoable
editing command, and use this type alias in lieu of `uint64_t`. No change in behavior.

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::WebEditCommandProxy):
* UIProcess/WebEditCommandProxy.h:
(WebKit::WebEditCommandProxy::create):
(WebKit::WebEditCommandProxy::commandID const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::registerEditCommandForUndo):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):

Store the step ID in a temporary variable, since `webUndoStep` is now moved when calling `addWebUndoStep`.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::webUndoStep):
(WebKit::WebPage::addWebUndoStep):

Make this take a `Ref<WebUndoStep>&&` instead of a `WebUndoStep*`, and use move semantics to transfer the
given `Ref` to the table.

(WebKit::WebPage::removeWebEditCommand):
(WebKit::WebPage::unapplyEditCommand):
(WebKit::WebPage::reapplyEditCommand):

Use `auto*` in a couple of places.

(WebKit::WebPage::didRemoveEditCommand):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebUndoStep.cpp:
(WebKit::generateUndoStep):
* WebProcess/WebPage/WebUndoStep.h:
(WebKit::WebUndoStep::stepID const):
(WebKit::WebUndoStep::WebUndoStep):
* WebProcess/WebPage/WebUndoStepID.h: Copied from Source/WebKit/WebProcess/WebPage/WebUndoStep.cpp.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebEditCommandProxy.cpp
Source/WebKit/UIProcess/WebEditCommandProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebUndoStep.cpp
Source/WebKit/WebProcess/WebPage/WebUndoStep.h
Source/WebKit/WebProcess/WebPage/WebUndoStepID.h [new file with mode: 0644]