Make WebPage::ForceRepaint use CompletionHandler instead of VoidCallback
Created attachment 400060 [details] Patch
Comment on attachment 400060 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400060&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:4270 > + callAfterNextPresentationUpdate([completionHandler = WTFMove(completionHandler)] (auto) mutable { We could probably take the background activity here since sendWithAsyncReply should take a background activity anyway. > Source/WebKit/WebProcess/WebPage/DrawingArea.h:86 > + virtual bool forceRepaintAsync(CompletionHandler<void()>&) { return false; } Seems strange to pass a CompletionHandler<void()>&, CompletionHandler<void()>&& os probably more appropriate. Also we should probably call the completion handler here or make it virtual pure. > Source/WebKit/WebProcess/WebPage/WebPage.cpp:3611 > + if (m_drawingArea->forceRepaintAsync(completionHandler)) { This API seems a bit weird. I guess sometimes we move the completionHandler and we return true and sometimes we do not move completionHandler and we return false. It seem we could move the completionHandler and check whether null afterwards here. forceRepaintAsync would then return void. Or we could split it in two APIs: bool canForceRepaint() and void forceRepainAsync(CompletionHandler<void()>&&). Or we could have m_drawingArea::forceRepaintAsync try to force repaint async and do the fallback itself of forRepaint(). This way, we could write it here as: m_drawingArea->forceRepaintAsync(WTFMove(completionHandler)) Last approach seems best to me.
Comment on attachment 400060 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400060&action=review >> Source/WebKit/UIProcess/WebPageProxy.cpp:4270 >> + callAfterNextPresentationUpdate([completionHandler = WTFMove(completionHandler)] (auto) mutable { > > We could probably take the background activity here since sendWithAsyncReply should take a background activity anyway. callAfterNextPresentationUpdate takes a background activity, so both are unnecessary now.
Created attachment 416723 [details] Patch
Created attachment 416724 [details] Patch
Created attachment 416726 [details] Patch
Committed r271171: <https://trac.webkit.org/changeset/271171> All reviewed patches have been landed. Closing bug and clearing flags on attachment 416726 [details].
<rdar://problem/72824993>