[iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Aug 2019 06:16:50 +0000 (06:16 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Aug 2019 06:16:50 +0000 (06:16 +0000)
commit677a0e1796f72afd2bc3ee98b8d39474cf8cd646
treec774f1278c12db2970c61ad4366c4d59df1982c4
parentb3d113fd5d65644985d829a106a5105252d2a1ec
[iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs
https://bugs.webkit.org/show_bug.cgi?id=199983

Reviewed by Dean Jackson.

Add TransactionID which is a MonotonicObjectIdentifier<TransactionIDType>. This is modeled
after ObjectIdentifier<>, but we can't use that because it doesn't have a guarantee of
values always increasing by 1 (all derived classes share the same value source). Also, we
need a per-RemoteLayerTreeDrawingArea set of values, but a static seed would cause values to
be incremented by all RemoteLayerTreeDrawingAreas in a WebProcess.

Replace all the bare uint64_t with TransactionID, fixing message generation codegen.

* Scripts/webkit/messages.py:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::transactionID const):
(WebKit::RemoteLayerTreeTransaction::setTransactionID):
* Shared/TransactionID.h: Added.
(WebKit::MonotonicObjectIdentifier::MonotonicObjectIdentifier):
(WebKit::MonotonicObjectIdentifier::isHashTableDeletedValue const):
(WebKit::MonotonicObjectIdentifier::encode const):
(WebKit::MonotonicObjectIdentifier::decode):
(WebKit::MonotonicObjectIdentifier::operator== const):
(WebKit::MonotonicObjectIdentifier::operator> const):
(WebKit::MonotonicObjectIdentifier::operator>= const):
(WebKit::MonotonicObjectIdentifier::operator< const):
(WebKit::MonotonicObjectIdentifier::operator<= const):
(WebKit::MonotonicObjectIdentifier::operator!= const):
(WebKit::MonotonicObjectIdentifier::increment):
(WebKit::MonotonicObjectIdentifier::next const):
(WebKit::MonotonicObjectIdentifier::toUInt64 const):
(WebKit::MonotonicObjectIdentifier::operator bool const):
(WebKit::MonotonicObjectIdentifier::loggingString const):
(WebKit::MonotonicObjectIdentifier::hashTableDeletedValue):
(WebKit::MonotonicObjectIdentifier::isValidIdentifier):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionID const):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillSwapOrDidExit]):
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
(WebKit::RemoteLayerTreeDrawingArea::nextTransactionID const):
(WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID const):
(WebKit::RemoteLayerTreeDrawingArea::takeNextTransactionID):
* WebProcess/WebPage/WebFrame.h:
(WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad const):
(WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
(WebKit::WebPage::commitPotentialTap):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Scripts/webkit/messages.py
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
Source/WebKit/Shared/TransactionID.h [new file with mode: 0644]
Source/WebKit/Shared/VisibleContentRectUpdateInfo.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h
Source/WebKit/WebProcess/WebPage/WebFrame.h
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm