Reduce use of WebPageProxy::VoidCallback
Created attachment 397401 [details] Patch
Comment on attachment 397401 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397401&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:2176 > + sendWithAsyncReply(Messages::WebPage::SetInitialFocus(forward, isKeyboardEventValid, keyboardEvent), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::setInitialFocus"_s)] () mutable { Why does this need to be "mutable"? Same question about the various other similar cases below. > Source/WebKit/UIProcess/WebPageProxy.h:782 > + void focusNextFocusedElement(bool isForward, CompletionHandler<void()>&& = []() { }); I believe our coding style is to omit the () here. There are 10 or more other cases of this in this patch. I suggest removing them all.
Calling a CompletionHandler deletes its callable immediately after calling, which requires it to be non-const. Will remove unnecessary ().
Created attachment 397503 [details] Patch
Comment on attachment 397503 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397503&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:2314 > + sendWithAsyncReply(Messages::WebPage::ExecuteEditCommandWithCallback(commandName, argument), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::executeEditCommand"_s)] () mutable { One last case of () that you didn't delete yet.
Comment on attachment 397503 [details] Patch That is unfortunately necessary because of the mutable in C++ until http://wg21.link/P1102 is accepted.
Committed r260764: <https://trac.webkit.org/changeset/260764> All reviewed patches have been landed. Closing bug and clearing flags on attachment 397503 [details].
<rdar://problem/62457381>