<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[260764] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/260764">260764</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2020-04-27 10:13:19 -0700 (Mon, 27 Apr 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>Reduce use of WebPageProxy::VoidCallback
https://bugs.webkit.org/show_bug.cgi?id=210944

Patch by Alex Christensen <achristensen@webkit.org> on 2020-04-27
Reviewed by Darin Adler.

Use sendWithAsyncReply and CompletionHandler<void()> instead.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _executeEditCommand:argument:completion:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::becomeFirstResponder):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setInitialFocus):
(WebKit::WebPageProxy::executeEditCommand):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::focusNextFocusedElement):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView pasteWithCompletionHandler:]):
(-[WKContentView moveByOffset:]):
(-[WKContentView _selectPositionAtPoint:stayingWithinFocusedElement:completionHandler:]):
(-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
(-[WKContentView moveSelectionAtBoundary:inDirection:completionHandler:]):
(-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView accessoryTab:]):
(-[WKContentView executeEditCommandWithCallback:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::moveSelectionByOffset):
(WebKit::WebPageProxy::focusNextFocusedElement):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::executeEditCommandWithCallback):
(WebKit::WebPage::setInitialFocus):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::moveSelectionByOffset):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::focusNextFocusedElement):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebViewImplmm">trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxycpp">trunk/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxyh">trunk/Source/WebKit/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagemessagesin">trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/ChangeLog       2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2020-04-27  Alex Christensen  <achristensen@webkit.org>
+
+        Reduce use of WebPageProxy::VoidCallback
+        https://bugs.webkit.org/show_bug.cgi?id=210944
+
+        Reviewed by Darin Adler.
+
+        Use sendWithAsyncReply and CompletionHandler<void()> instead.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _executeEditCommand:argument:completion:]):
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::becomeFirstResponder):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setInitialFocus):
+        (WebKit::WebPageProxy::executeEditCommand):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::focusNextFocusedElement):
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView pasteWithCompletionHandler:]):
+        (-[WKContentView moveByOffset:]):
+        (-[WKContentView _selectPositionAtPoint:stayingWithinFocusedElement:completionHandler:]):
+        (-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
+        (-[WKContentView moveSelectionAtBoundary:inDirection:completionHandler:]):
+        (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
+        (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
+        (-[WKContentView accessoryTab:]):
+        (-[WKContentView executeEditCommandWithCallback:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
+        (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
+        (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
+        (WebKit::WebPageProxy::selectPositionAtPoint):
+        (WebKit::WebPageProxy::moveSelectionByOffset):
+        (WebKit::WebPageProxy::focusNextFocusedElement):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::executeEditCommandWithCallback):
+        (WebKit::WebPage::setInitialFocus):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::moveSelectionByOffset):
+        (WebKit::WebPage::selectPositionAtPoint):
+        (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
+        (WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
+        (WebKit::WebPage::selectTextWithGranularityAtPoint):
+        (WebKit::WebPage::focusNextFocusedElement):
+
</ins><span class="cx"> 2020-04-27  Per Arne Vollan  <pvollan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed sandbox compile fix.
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm     2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm        2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -1616,9 +1616,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_executeEditCommand:(NSString *)command argument:(NSString *)argument completion:(void (^)(BOOL))completion
</span><span class="cx"> {
</span><del>-    _page->executeEditCommand(command, argument, [capturedCompletionBlock = makeBlockPtr(completion)](WebKit::CallbackBase::Error error) {
</del><ins>+    _page->executeEditCommand(command, argument, [capturedCompletionBlock = makeBlockPtr(completion)] {
</ins><span class="cx">         if (capturedCompletionBlock)
</span><del>-            capturedCompletionBlock(error == WebKit::CallbackBase::Error::None);
</del><ins>+            capturedCompletionBlock(YES);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm       2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm  2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -1581,7 +1581,7 @@
</span><span class="cx">         NSEvent *keyboardEvent = nil;
</span><span class="cx">         if ([event type] == NSEventTypeKeyDown || [event type] == NSEventTypeKeyUp)
</span><span class="cx">             keyboardEvent = event;
</span><del>-        m_page->setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, false, { }), [](WebKit::CallbackBase::Error) { });
</del><ins>+        m_page->setInitialFocus(direction == NSSelectingNext, keyboardEvent != nil, NativeWebKeyboardEvent(keyboardEvent, false, false, { }), [] { });
</ins><span class="cx">     }
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp   2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp      2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -2165,15 +2165,16 @@
</span><span class="cx">     return pageClient().viewSize();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& keyboardEvent, WTF::Function<void (CallbackBase::Error)>&& callbackFunction)
</del><ins>+void WebPageProxy::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& keyboardEvent, CompletionHandler<void()>&& callbackFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRunningProcess()) {
</span><del>-        callbackFunction(CallbackBase::Error::OwnerWasInvalidated);
</del><ins>+        callbackFunction();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::setInitialFocus"_s));
-    send(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent, callbackID));
</del><ins>+    sendWithAsyncReply(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::setInitialFocus"_s)] () mutable {
+        callbackFunction();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::clearSelection()
</span><span class="lines">@@ -2299,10 +2300,10 @@
</span><span class="cx">     return pasteCommandNames->contains(commandName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
</del><ins>+void WebPageProxy::executeEditCommand(const String& commandName, const String& argument, CompletionHandler<void()>&& callbackFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRunningProcess()) {
</span><del>-        callbackFunction(CallbackBase::Error::Unknown);
</del><ins>+        callbackFunction();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2309,8 +2310,9 @@
</span><span class="cx">     if (isPasteCommandName(commandName))
</span><span class="cx">         willPerformPasteCommand();
</span><span class="cx"> 
</span><del>-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::executeEditCommand"_s));
-    send(Messages::WebPage::ExecuteEditCommandWithCallback(commandName, argument, callbackID));
</del><ins>+    sendWithAsyncReply(Messages::WebPage::ExecuteEditCommandWithCallback(commandName, argument), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::executeEditCommand"_s)] () mutable {
+        callbackFunction();
+    });
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void WebPageProxy::executeEditCommand(const String& commandName, const String& argument)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h     2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h        2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -641,7 +641,7 @@
</span><span class="cx">     void viewWillStartLiveResize();
</span><span class="cx">     void viewWillEndLiveResize();
</span><span class="cx"> 
</span><del>-    void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, WTF::Function<void (CallbackBase::Error)>&&);
</del><ins>+    void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CompletionHandler<void()>&&);
</ins><span class="cx">     
</span><span class="cx">     void clearSelection();
</span><span class="cx">     void restoreSelectionInFocusedEditableElement();
</span><span class="lines">@@ -674,6 +674,7 @@
</span><span class="cx"> 
</span><span class="cx">     void selectAll();
</span><span class="cx">     void executeEditCommand(const String& commandName, const String& argument = String());
</span><ins>+    void executeEditCommand(const String& commandName, const String& argument, CompletionHandler<void()>&&);
</ins><span class="cx">     void validateCommand(const String& commandName, WTF::Function<void (const String&, bool, int32_t, CallbackBase::Error)>&&);
</span><span class="cx"> 
</span><span class="cx">     const EditorState& editorState() const { return m_editorState; }
</span><span class="lines">@@ -701,8 +702,7 @@
</span><span class="cx">     void activateMediaStreamCaptureInPage();
</span><span class="cx">     bool isMediaStreamCaptureMuted() const { return m_mutedState & WebCore::MediaProducer::MediaStreamCaptureIsMuted; }
</span><span class="cx">     void setMediaStreamCaptureMuted(bool);
</span><del>-    void executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&&);
-        
</del><ins>+
</ins><span class="cx">     void requestFontAttributesAtSelectionStart(Function<void(const WebCore::FontAttributes&, CallbackBase::Error)>&&);
</span><span class="cx">     void fontAttributesCallback(const WebCore::FontAttributes&, CallbackID);
</span><span class="cx"> 
</span><span class="lines">@@ -756,11 +756,11 @@
</span><span class="cx">     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
</span><span class="cx">     void extendSelection(WebCore::TextGranularity);
</span><span class="cx">     void selectWordBackward();
</span><del>-    void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
-    void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
-    void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
-    void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&&);
-    void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, WTF::Function<void(CallbackBase::Error)>&&);
</del><ins>+    void moveSelectionByOffset(int32_t offset, CompletionHandler<void()>&&);
+    void selectTextWithGranularityAtPoint(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, CompletionHandler<void()>&&);
+    void selectPositionAtPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, CompletionHandler<void()>&&);
+    void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint, WebCore::TextGranularity, WebCore::SelectionDirection, bool isInteractingWithFocusedElement, CompletionHandler<void()>&&);
+    void moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity, WebCore::SelectionDirection, CompletionHandler<void()>&&);
</ins><span class="cx">     void beginSelectionInDirection(WebCore::SelectionDirection, WTF::Function<void (uint64_t, CallbackBase::Error)>&&);
</span><span class="cx">     void updateSelectionWithExtentPoint(const WebCore::IntPoint, bool isInteractingWithFocusedElement, RespectSelectionAnchor, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
</span><span class="cx">     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint, WebCore::TextGranularity, bool isInteractingWithFocusedElement, WTF::Function<void(uint64_t, CallbackBase::Error)>&&);
</span><span class="lines">@@ -778,7 +778,7 @@
</span><span class="cx">     void stopInteraction();
</span><span class="cx">     void performActionOnElement(uint32_t action);
</span><span class="cx">     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
</span><del>-    void focusNextFocusedElement(bool isForward, WTF::Function<void (CallbackBase::Error)>&& = [] (auto) { });
</del><ins>+    void focusNextFocusedElement(bool isForward, CompletionHandler<void()>&& = [] { });
</ins><span class="cx">     void setFocusedElementValue(const String&);
</span><span class="cx">     void setFocusedElementValueAsNumber(double);
</span><span class="cx">     void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm    2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm       2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -2832,7 +2832,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)pasteWithCompletionHandler:(void (^)(void))completionHandler
</span><span class="cx"> {
</span><del>-    _page->executeEditCommand("Paste"_s, { }, [completion = makeBlockPtr(completionHandler)] (auto) {
</del><ins>+    _page->executeEditCommand("Paste"_s, { }, [completion = makeBlockPtr(completionHandler)] {
</ins><span class="cx">         if (completion)
</span><span class="cx">             completion();
</span><span class="cx">     });
</span><span class="lines">@@ -3920,7 +3920,7 @@
</span><span class="cx">     
</span><span class="cx">     [self beginSelectionChange];
</span><span class="cx">     RetainPtr<WKContentView> view = self;
</span><del>-    _page->moveSelectionByOffset(offset, [view](WebKit::CallbackBase::Error) {
</del><ins>+    _page->moveSelectionByOffset(offset, [view] {
</ins><span class="cx">         [view endSelectionChange];
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="lines">@@ -4011,7 +4011,7 @@
</span><span class="cx">     UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
</span><span class="cx">     RetainPtr<WKContentView> view = self;
</span><span class="cx"> 
</span><del>-    _page->selectPositionAtPoint(WebCore::IntPoint(point), stayingWithinFocusedElement, [view, selectionHandler](WebKit::CallbackBase::Error error) {
</del><ins>+    _page->selectPositionAtPoint(WebCore::IntPoint(point), stayingWithinFocusedElement, [view, selectionHandler]() {
</ins><span class="cx">         selectionHandler();
</span><span class="cx">         view->_usingGestureForSelection = NO;
</span><span class="cx">         [selectionHandler release];
</span><span class="lines">@@ -4024,7 +4024,7 @@
</span><span class="cx">     UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
</span><span class="cx">     RetainPtr<WKContentView> view = self;
</span><span class="cx">     
</span><del>-    _page->selectPositionAtBoundaryWithDirection(WebCore::IntPoint(point), toWKTextGranularity(granularity), toWKSelectionDirection(direction), self._hasFocusedElement, [view, selectionHandler](WebKit::CallbackBase::Error error) {
</del><ins>+    _page->selectPositionAtBoundaryWithDirection(WebCore::IntPoint(point), toWKTextGranularity(granularity), toWKSelectionDirection(direction), self._hasFocusedElement, [view, selectionHandler]() {
</ins><span class="cx">         selectionHandler();
</span><span class="cx">         view->_usingGestureForSelection = NO;
</span><span class="cx">         [selectionHandler release];
</span><span class="lines">@@ -4037,7 +4037,7 @@
</span><span class="cx">     UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
</span><span class="cx">     RetainPtr<WKContentView> view = self;
</span><span class="cx">     
</span><del>-    _page->moveSelectionAtBoundaryWithDirection(toWKTextGranularity(granularity), toWKSelectionDirection(direction), [view, selectionHandler](WebKit::CallbackBase::Error error) {
</del><ins>+    _page->moveSelectionAtBoundaryWithDirection(toWKTextGranularity(granularity), toWKSelectionDirection(direction), [view, selectionHandler] {
</ins><span class="cx">         selectionHandler();
</span><span class="cx">         view->_usingGestureForSelection = NO;
</span><span class="cx">         [selectionHandler release];
</span><span class="lines">@@ -4051,7 +4051,7 @@
</span><span class="cx">     UIWKSelectionCompletionHandler selectionHandler = [completionHandler copy];
</span><span class="cx">     RetainPtr<WKContentView> view = self;
</span><span class="cx"> 
</span><del>-    _page->selectTextWithGranularityAtPoint(WebCore::IntPoint(point), toWKTextGranularity(granularity), self._hasFocusedElement, [view, selectionHandler](WebKit::CallbackBase::Error error) {
</del><ins>+    _page->selectTextWithGranularityAtPoint(WebCore::IntPoint(point), toWKTextGranularity(granularity), self._hasFocusedElement, [view, selectionHandler] {
</ins><span class="cx">         selectionHandler();
</span><span class="cx">         view->_usingGestureForSelection = NO;
</span><span class="cx">         --view->_suppressNonEditableSingleTapTextInteractionCount;
</span><span class="lines">@@ -4272,7 +4272,7 @@
</span><span class="cx"> - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler
</span><span class="cx"> {
</span><span class="cx">     constexpr bool isKeyboardEventValid = false;
</span><del>-    _page->setInitialFocus(selectingForward, isKeyboardEventValid, { }, [protectedSelf = retainPtr(self), completionHandler = makeBlockPtr(completionHandler)] (auto) {
</del><ins>+    _page->setInitialFocus(selectingForward, isKeyboardEventValid, { }, [protectedSelf = retainPtr(self), completionHandler = makeBlockPtr(completionHandler)] {
</ins><span class="cx">         completionHandler([protectedSelf becomeFirstResponder]);
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="lines">@@ -4336,7 +4336,7 @@
</span><span class="cx"> 
</span><span class="cx">     _isChangingFocusUsingAccessoryTab = YES;
</span><span class="cx">     [self beginSelectionChange];
</span><del>-    _page->focusNextFocusedElement(isNext, [protectedSelf = retainPtr(self)] (WebKit::CallbackBase::Error) {
</del><ins>+    _page->focusNextFocusedElement(isNext, [protectedSelf = retainPtr(self)] {
</ins><span class="cx">         [protectedSelf endSelectionChange];
</span><span class="cx">         [protectedSelf reloadInputViews];
</span><span class="cx">         protectedSelf->_isChangingFocusUsingAccessoryTab = NO;
</span><span class="lines">@@ -5407,7 +5407,7 @@
</span><span class="cx">     // or not to know whether to tell WebKit to treat this command as user initiated or not.
</span><span class="cx">     [self beginSelectionChange];
</span><span class="cx">     RetainPtr<WKContentView> view = self;
</span><del>-    _page->executeEditCommand(commandName, { }, [view](WebKit::CallbackBase::Error) {
</del><ins>+    _page->executeEditCommand(commandName, { }, [view] {
</ins><span class="cx">         [view endSelectionChange];
</span><span class="cx">     });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm     2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm        2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -505,48 +505,52 @@
</span><span class="cx">     return autocorrectionApplied;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::selectTextWithGranularityAtPoint(const WebCore::IntPoint point, WebCore::TextGranularity granularity, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
</del><ins>+void WebPageProxy::selectTextWithGranularityAtPoint(const WebCore::IntPoint point, WebCore::TextGranularity granularity, bool isInteractingWithFocusedElement, CompletionHandler<void()>&& callbackFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRunningProcess()) {
</span><del>-        callbackFunction(CallbackBase::Error::Unknown);
</del><ins>+        callbackFunction();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::selectTextWithGranularityAtPoint"_s));
-    m_process->send(Messages::WebPage::SelectTextWithGranularityAtPoint(point, static_cast<uint32_t>(granularity), isInteractingWithFocusedElement, callbackID), m_webPageID);
</del><ins>+    sendWithAsyncReply(Messages::WebPage::SelectTextWithGranularityAtPoint(point, static_cast<uint32_t>(granularity), isInteractingWithFocusedElement), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::selectTextWithGranularityAtPoint"_s)] () mutable {
+        callbackFunction();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint point, WebCore::TextGranularity granularity, WebCore::SelectionDirection direction, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
</del><ins>+void WebPageProxy::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint point, WebCore::TextGranularity granularity, WebCore::SelectionDirection direction, bool isInteractingWithFocusedElement, CompletionHandler<void()>&& callbackFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRunningProcess()) {
</span><del>-        callbackFunction(CallbackBase::Error::Unknown);
</del><ins>+        callbackFunction();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::selectPositionAtBoundaryWithDirection"_s));
-    m_process->send(Messages::WebPage::SelectPositionAtBoundaryWithDirection(point, static_cast<uint32_t>(granularity), static_cast<uint32_t>(direction), isInteractingWithFocusedElement, callbackID), m_webPageID);
</del><ins>+    sendWithAsyncReply(Messages::WebPage::SelectPositionAtBoundaryWithDirection(point, static_cast<uint32_t>(granularity), static_cast<uint32_t>(direction), isInteractingWithFocusedElement), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::selectPositionAtBoundaryWithDirection"_s)] () mutable {
+        callbackFunction();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity granularity, WebCore::SelectionDirection direction, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
</del><ins>+void WebPageProxy::moveSelectionAtBoundaryWithDirection(WebCore::TextGranularity granularity, WebCore::SelectionDirection direction, CompletionHandler<void()>&& callbackFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRunningProcess()) {
</span><del>-        callbackFunction(CallbackBase::Error::Unknown);
</del><ins>+        callbackFunction();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::moveSelectionAtBoundaryWithDirection"_s));
-    m_process->send(Messages::WebPage::MoveSelectionAtBoundaryWithDirection(static_cast<uint32_t>(granularity), static_cast<uint32_t>(direction), callbackID), m_webPageID);
</del><ins>+    sendWithAsyncReply(Messages::WebPage::MoveSelectionAtBoundaryWithDirection(static_cast<uint32_t>(granularity), static_cast<uint32_t>(direction)), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::moveSelectionAtBoundaryWithDirection"_s)] () mutable {
+        callbackFunction();
+    });
</ins><span class="cx"> }
</span><span class="cx">     
</span><del>-void WebPageProxy::selectPositionAtPoint(const WebCore::IntPoint point, bool isInteractingWithFocusedElement, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
</del><ins>+void WebPageProxy::selectPositionAtPoint(const WebCore::IntPoint point, bool isInteractingWithFocusedElement, CompletionHandler<void()>&& callbackFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRunningProcess()) {
</span><del>-        callbackFunction(CallbackBase::Error::Unknown);
</del><ins>+        callbackFunction();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::selectPositionAtPoint"_s));
-    m_process->send(Messages::WebPage::SelectPositionAtPoint(point, isInteractingWithFocusedElement, callbackID), m_webPageID);
</del><ins>+    sendWithAsyncReply(Messages::WebPage::SelectPositionAtPoint(point, isInteractingWithFocusedElement), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::selectPositionAtPoint"_s)] () mutable {
+        callbackFunction();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::beginSelectionInDirection(WebCore::SelectionDirection direction, WTF::Function<void (uint64_t, CallbackBase::Error)>&& callbackFunction)
</span><span class="lines">@@ -795,15 +799,16 @@
</span><span class="cx">     m_process->send(Messages::WebPage::CancelAutoscroll(), m_webPageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&& callbackFunction)
</del><ins>+void WebPageProxy::moveSelectionByOffset(int32_t offset, CompletionHandler<void()>&& callbackFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRunningProcess()) {
</span><del>-        callbackFunction(CallbackBase::Error::Unknown);
</del><ins>+        callbackFunction();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::moveSelectionByOffset"_s));
-    m_process->send(Messages::WebPage::MoveSelectionByOffset(offset, callbackID), m_webPageID);
</del><ins>+    sendWithAsyncReply(Messages::WebPage::MoveSelectionByOffset(offset), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::moveSelectionByOffset"_s)] () mutable {
+        callbackFunction();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::interpretKeyEvent(const EditorState& state, bool isCharEvent, CompletionHandler<void(bool)>&& completionHandler)
</span><span class="lines">@@ -1050,15 +1055,16 @@
</span><span class="cx">     pageClient().disableInspectorNodeSearch();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::focusNextFocusedElement(bool isForward, WTF::Function<void(CallbackBase::Error)>&& callbackFunction)
</del><ins>+void WebPageProxy::focusNextFocusedElement(bool isForward, CompletionHandler<void()>&& callbackFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (!hasRunningProcess()) {
</span><del>-        callbackFunction(CallbackBase::Error::Unknown);
</del><ins>+        callbackFunction();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::focusNextFocusedElement"_s));
-    process().send(Messages::WebPage::FocusNextFocusedElement(isForward, callbackID), m_webPageID);
</del><ins>+    sendWithAsyncReply(Messages::WebPage::FocusNextFocusedElement(isForward), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::focusNextFocusedElement"_s)] () mutable {
+        callbackFunction();
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::setFocusedElementValue(const String& value)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -1119,10 +1119,10 @@
</span><span class="cx">         frame.editor().applyStyleToSelection(changes.createEditingStyle(), EditAction::SetFont, Editor::ColorFilterMode::InvertColor);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::executeEditCommandWithCallback(const String& commandName, const String& argument, CallbackID callbackID)
</del><ins>+void WebPage::executeEditCommandWithCallback(const String& commandName, const String& argument, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     executeEditCommand(commandName, argument);
</span><del>-    send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+    completionHandler();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::selectAll()
</span><span class="lines">@@ -3142,10 +3142,10 @@
</span><span class="cx">         view->willEndLiveResize();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& event, CallbackID callbackID)
</del><ins>+void WebPage::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& event, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_page)
</span><del>-        return;
</del><ins>+        return completionHandler();
</ins><span class="cx"> 
</span><span class="cx">     SetForScope<bool> userIsInteractingChange { m_userIsInteracting, true };
</span><span class="cx"> 
</span><span class="lines">@@ -3156,13 +3156,12 @@
</span><span class="cx">         PlatformKeyboardEvent platformEvent(platform(event));
</span><span class="cx">         platformEvent.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown);
</span><span class="cx">         m_page->focusController().setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, &KeyboardEvent::create(platformEvent, &frame.windowProxy()).get());
</span><del>-
-        send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+        completionHandler();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_page->focusController().setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, nullptr);
</span><del>-    send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+    completionHandler();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::setCanStartMediaTimerFired()
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -641,7 +641,7 @@
</span><span class="cx"> 
</span><span class="cx">     void disabledAdaptationsDidChange(const OptionSet<WebCore::DisabledAdaptations>&);
</span><span class="cx">     void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
</span><del>-    void executeEditCommandWithCallback(const String&, const String& argument, CallbackID);
</del><ins>+    void executeEditCommandWithCallback(const String&, const String& argument, CompletionHandler<void()>&&);
</ins><span class="cx">     void selectAll();
</span><span class="cx"> 
</span><span class="cx">     void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebCore::ElementContext>&)>&&);
</span><span class="lines">@@ -689,11 +689,11 @@
</span><span class="cx">     void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
</span><span class="cx">     void extendSelection(uint32_t granularity);
</span><span class="cx">     void selectWordBackward();
</span><del>-    void moveSelectionByOffset(int32_t offset, CallbackID);
-    void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
-    void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CallbackID);
-    void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CallbackID);
-    void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, CallbackID);
</del><ins>+    void moveSelectionByOffset(int32_t offset, CompletionHandler<void()>&&);
+    void selectTextWithGranularityAtPoint(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CompletionHandler<void()>&&);
+    void selectPositionAtBoundaryWithDirection(const WebCore::IntPoint&, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CompletionHandler<void()>&&);
+    void moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CompletionHandler<void()>&&);
+    void selectPositionAtPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, CompletionHandler<void()>&&);
</ins><span class="cx">     void beginSelectionInDirection(uint32_t direction, CallbackID);
</span><span class="cx">     void updateSelectionWithExtentPoint(const WebCore::IntPoint&, bool isInteractingWithFocusedElement, RespectSelectionAnchor, CallbackID);
</span><span class="cx">     void updateSelectionWithExtentPointAndBoundary(const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID);
</span><span class="lines">@@ -710,7 +710,7 @@
</span><span class="cx">     void startInteractionWithElementContextOrPosition(Optional<WebCore::ElementContext>&&, WebCore::IntPoint&&);
</span><span class="cx">     void stopInteraction();
</span><span class="cx">     void performActionOnElement(uint32_t action);
</span><del>-    void focusNextFocusedElement(bool isForward, CallbackID);
</del><ins>+    void focusNextFocusedElement(bool isForward, CompletionHandler<void()>&&);
</ins><span class="cx">     void autofillLoginCredentials(const String&, const String&);
</span><span class="cx">     void setFocusedElementValue(const String&);
</span><span class="cx">     void setFocusedElementValueAsNumber(double);
</span><span class="lines">@@ -1429,7 +1429,7 @@
</span><span class="cx">     void reload(uint64_t navigationID, uint32_t reloadOptions, SandboxExtension::Handle&&);
</span><span class="cx">     void goToBackForwardItem(uint64_t navigationID, const WebCore::BackForwardItemIdentifier&, WebCore::FrameLoadType, WebCore::ShouldTreatAsContinuingLoad, Optional<WebsitePoliciesData>&&);
</span><span class="cx">     void tryRestoreScrollPosition();
</span><del>-    void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CallbackID);
</del><ins>+    void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, CompletionHandler<void()>&&);
</ins><span class="cx">     void updateIsInWindow(bool isInitialState = false);
</span><span class="cx">     void visibilityDidChange();
</span><span class="cx">     void setActivityState(OptionSet<WebCore::ActivityState::Flag>, ActivityStateChangeID, const Vector<CallbackID>& callbackIDs);
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in       2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in  2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><span class="cx"> messages -> WebPage LegacyReceiver {
</span><del>-    SetInitialFocus(bool forward, bool isKeyboardEventValid, WebKit::WebKeyboardEvent event, WebKit::CallbackID callbackID)
</del><ins>+    SetInitialFocus(bool forward, bool isKeyboardEventValid, WebKit::WebKeyboardEvent event) -> () Async
</ins><span class="cx">     SetActivityState(OptionSet<WebCore::ActivityState::Flag> activityState, WebKit::ActivityStateChangeID activityStateChangeID, Vector<WebKit::CallbackID> callbackIDs)
</span><span class="cx">     SetLayerHostingMode(enum:uint8_t WebKit::LayerHostingMode layerHostingMode)
</span><span class="cx"> 
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     ViewWillStartLiveResize()
</span><span class="cx">     ViewWillEndLiveResize()
</span><span class="cx"> 
</span><del>-    ExecuteEditCommandWithCallback(String name, String argument, WebKit::CallbackID callbackID)
</del><ins>+    ExecuteEditCommandWithCallback(String name, String argument) -> () Async
</ins><span class="cx">     KeyEvent(WebKit::WebKeyboardEvent event)
</span><span class="cx">     MouseEvent(WebKit::WebMouseEvent event)
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="lines">@@ -68,11 +68,11 @@
</span><span class="cx">     SelectWithTwoTouches(WebCore::IntPoint from, WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WebKit::CallbackID callbackID)
</span><span class="cx">     ExtendSelection(uint32_t granularity)
</span><span class="cx">     SelectWordBackward()
</span><del>-    MoveSelectionByOffset(int32_t offset, WebKit::CallbackID callbackID)
-    SelectTextWithGranularityAtPoint(WebCore::IntPoint point, uint32_t granularity, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
-    SelectPositionAtBoundaryWithDirection(WebCore::IntPoint point, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
-    MoveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, WebKit::CallbackID callbackID)
-    SelectPositionAtPoint(WebCore::IntPoint point, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
</del><ins>+    MoveSelectionByOffset(int32_t offset) -> () Async
+    SelectTextWithGranularityAtPoint(WebCore::IntPoint point, uint32_t granularity, bool isInteractingWithFocusedElement) -> () Async
+    SelectPositionAtBoundaryWithDirection(WebCore::IntPoint point, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement) -> () Async
+    MoveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction) -> () Async
+    SelectPositionAtPoint(WebCore::IntPoint point, bool isInteractingWithFocusedElement) -> () Async
</ins><span class="cx">     BeginSelectionInDirection(uint32_t direction, WebKit::CallbackID callbackID)
</span><span class="cx">     UpdateSelectionWithExtentPoint(WebCore::IntPoint point, bool isInteractingWithFocusedElement, enum:bool WebKit::RespectSelectionAnchor respectSelectionAnchor, WebKit::CallbackID callbackID)
</span><span class="cx">     UpdateSelectionWithExtentPointAndBoundary(WebCore::IntPoint point, uint32_t granularity, bool isInteractingWithFocusedElement, WebKit::CallbackID callbackID)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">     StartInteractionWithElementContextOrPosition(Optional<WebCore::ElementContext> elementContext, WebCore::IntPoint point)
</span><span class="cx">     StopInteraction()
</span><span class="cx">     PerformActionOnElement(uint32_t action)
</span><del>-    FocusNextFocusedElement(bool isForward, WebKit::CallbackID callbackID)
</del><ins>+    FocusNextFocusedElement(bool isForward) -> () Async
</ins><span class="cx">     SetFocusedElementValue(String value)
</span><span class="cx">     AutofillLoginCredentials(String username, String password)
</span><span class="cx">     SetFocusedElementValueAsNumber(double value)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (260763 => 260764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2020-04-27 17:05:09 UTC (rev 260763)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm    2020-04-27 17:13:19 UTC (rev 260764)
</span><span class="lines">@@ -1836,7 +1836,7 @@
</span><span class="cx">         frame.selection().setSelectedRange(Range::create(*frame.document(), startPosition, position).ptr(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::moveSelectionByOffset(int32_t offset, CallbackID callbackID)
</del><ins>+void WebPage::moveSelectionByOffset(int32_t offset, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     Frame& frame = m_page->focusController().focusedOrMainFrame();
</span><span class="cx">     
</span><span class="lines">@@ -1852,7 +1852,7 @@
</span><span class="cx">     }
</span><span class="cx">     if (position.isNotNull() && startPosition != position)
</span><span class="cx">         frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</span><del>-    send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+    completionHandler();
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void WebPage::startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow)
</span><span class="lines">@@ -2073,7 +2073,7 @@
</span><span class="cx">     return frame.visiblePositionForPoint(constrainedPoint);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::selectPositionAtPoint(const WebCore::IntPoint& point, bool isInteractingWithFocusedElement, CallbackID callbackID)
</del><ins>+void WebPage::selectPositionAtPoint(const WebCore::IntPoint& point, bool isInteractingWithFocusedElement, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     SetForScope<bool> userIsInteractingChange { m_userIsInteracting, true };
</span><span class="cx"> 
</span><span class="lines">@@ -2084,10 +2084,10 @@
</span><span class="cx">     
</span><span class="cx">     if (position.isNotNull())
</span><span class="cx">         frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</span><del>-    send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+    completionHandler();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint& point, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CallbackID callbackID)
</del><ins>+void WebPage::selectPositionAtBoundaryWithDirection(const WebCore::IntPoint& point, uint32_t granularity, uint32_t direction, bool isInteractingWithFocusedElement, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     auto& frame = m_page->focusController().focusedOrMainFrame();
</span><span class="cx">     VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement);
</span><span class="lines">@@ -2097,10 +2097,10 @@
</span><span class="cx">         if (position.isNotNull())
</span><span class="cx">             frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</span><span class="cx">     }
</span><del>-    send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+    completionHandler();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CallbackID callbackID)
</del><ins>+void WebPage::moveSelectionAtBoundaryWithDirection(uint32_t granularity, uint32_t direction, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     Frame& frame = m_page->focusController().focusedOrMainFrame();
</span><span class="cx">     
</span><span class="lines">@@ -2111,7 +2111,7 @@
</span><span class="cx">         if (position.isNotNull())
</span><span class="cx">             frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), isForward? UPSTREAM : DOWNSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</span><span class="cx">     }
</span><del>-    send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+    completionHandler();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<Range> WebPage::rangeForGranularityAtPoint(Frame& frame, const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithFocusedElement)
</span><span class="lines">@@ -2157,7 +2157,7 @@
</span><span class="cx">         m_page->focusController().setFocusedFrame(result.innerNodeFrame());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::selectTextWithGranularityAtPoint(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID callbackID)
</del><ins>+void WebPage::selectTextWithGranularityAtPoint(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithFocusedElement, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     setFocusedFrameBeforeSelectingTextAtLocation(point);
</span><span class="cx"> 
</span><span class="lines">@@ -2166,7 +2166,7 @@
</span><span class="cx">     if (range)
</span><span class="cx">         frame.selection().setSelectedRange(range.get(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</span><span class="cx">     m_initialSelection = range;
</span><del>-    send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+    completionHandler();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::beginSelectionInDirection(uint32_t direction, CallbackID callbackID)
</span><span class="lines">@@ -3068,7 +3068,7 @@
</span><span class="cx">     return nextElement;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::focusNextFocusedElement(bool isForward, CallbackID callbackID)
</del><ins>+void WebPage::focusNextFocusedElement(bool isForward, CompletionHandler<void()>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     Element* nextElement = nextAssistableElement(m_focusedElement.get(), *m_page, isForward);
</span><span class="cx">     m_userIsInteracting = true;
</span><span class="lines">@@ -3075,7 +3075,7 @@
</span><span class="cx">     if (nextElement)
</span><span class="cx">         nextElement->focus();
</span><span class="cx">     m_userIsInteracting = false;
</span><del>-    send(Messages::WebPageProxy::VoidCallback(callbackID));
</del><ins>+    completionHandler();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::getFocusedElementInformation(FocusedElementInformation& information)
</span></span></pre>
</div>
</div>

</body>
</html>