[webkit-changes] [WebKit/WebKit] 0fea03: IPC::Connection per instance async reply handler m...

Kimmo Kinnunen noreply at github.com
Tue Dec 6 22:46:58 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0fea03a077b9e700898f706dd3c9d57981e371ff
      https://github.com/WebKit/WebKit/commit/0fea03a077b9e700898f706dd3c9d57981e371ff
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M Source/WebKit/Platform/IPC/Connection.cpp
    M Source/WebKit/Platform/IPC/Connection.h
    M Source/WebKit/Platform/IPC/HandleMessage.h
    M Source/WebKit/Platform/IPC/MessageSender.h
    M Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/ios/WKContentView.mm
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
    M Source/WebKit/UIProcess/mac/WKPrintingView.h
    M Source/WebKit/UIProcess/mac/WKPrintingView.mm
    M Source/WebKit/WebProcess/Notifications/WebNotificationManager.cpp
    M Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp

  Log Message:
  -----------
  IPC::Connection per instance async reply handler map is not accessible to stream connections
https://bugs.webkit.org/show_bug.cgi?id=248611
rdar://problem/102865370

Reviewed by Alex Christensen.

Expose the functions to maintain async reply handlers in Connection private
section. The StreamClientConnection is a friend and will use the internal
implementation to implement the feature for stream connections. The async
replies will be delivered by the dedicated Connection of StreamClientConnection.

At the same time, do two clarifying changes:
- Before, the async reply id was uint64_t. Make it a AsyncReplyID type object
  identifier type.
- Before, the handler map was stored in hash map that was stored
  per-connection in a global hash map. Instead, make the map a normal instance
  variable.

* Source/WebKit/Platform/IPC/Connection.cpp:
(IPC::Connection::~Connection):
(IPC::Connection::invalidate):
(IPC::Connection::sendMessageWithAsyncReply):
(IPC::Connection::dispatchMessage):
(IPC::Connection::addAsyncReplyHandler):
(IPC::Connection::cancelAsyncReplyHandlers):
(IPC::CompletionHandler<void):
(IPC::WTF_REQUIRES_LOCK): Deleted.
(IPC::addAsyncReplyHandler): Deleted.
(IPC::nextAsyncReplyHandlerID): Deleted.
(IPC::clearAsyncReplyHandlers): Deleted.
* Source/WebKit/Platform/IPC/Connection.h:
(IPC::Connection::sendWithAsyncReply):
(IPC::Connection::waitForAsyncCallbackAndDispatchImmediately):
(IPC::Connection::makeAsyncReplyHandler):
* Source/WebKit/Platform/IPC/HandleMessage.h:
(IPC::handleMessageAsync):
(IPC::handleMessageAsyncWantsConnection):
* Source/WebKit/Platform/IPC/MessageSender.h:
(IPC::MessageSender::sendWithAsyncReply):
* Source/WebKit/UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::computePagesForPrinting):
(WebKit::WebPageProxy::drawRectToImage):
(WebKit::WebPageProxy::drawPagesToPDF):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKContentView.mm:
(-[WKContentView _resetPrintingState]):
(-[WKContentView _wk_pageCountForPrintFormatter:]):
(-[WKContentView _waitForDrawToPDFCallbackForPrintFormatterIfNeeded:]):
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::drawToPDFiOS):
* Source/WebKit/UIProcess/mac/WKPrintingView.h:
* Source/WebKit/UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _expectedPreviewCallbackForRect:]):
(pageDidDrawToImage):
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
(pageDidComputePageRects):
(-[WKPrintingView _drawPreview:]):
(-[WKPrintingView endDocument]):
* Source/WebKit/WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::sendNotificationMessageWithAsyncReply):
* Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:
(WebKit::IPCTestingAPI::sendMessageWithJSArguments):
(WebKit::IPCTestingAPI::JSMessageListener::jsDescriptionFromDecoder):

Canonical link: https://commits.webkit.org/257458@main




More information about the webkit-changes mailing list