[webkit-changes] [WebKit/WebKit] b43d92: IPC::MessageSender::sendWithAsyncReply is not cons...
Kimmo Kinnunen
noreply at github.com
Wed Oct 26 04:31:11 PDT 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b43d9276ab01200f23cc6e40dabda2d7b767396d
https://github.com/WebKit/WebKit/commit/b43d9276ab01200f23cc6e40dabda2d7b767396d
Author: Kimmo Kinnunen <kkinnunen at apple.com>
Date: 2022-10-26 (Wed, 26 Oct 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.cpp
M Source/WebKit/Platform/IPC/MessageSender.h
M Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp
M Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
M Source/WebKit/UIProcess/DrawingAreaProxy.cpp
M Source/WebKit/UIProcess/DrawingAreaProxy.h
M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
M Source/WebKit/UIProcess/ProvisionalPageProxy.h
M Source/WebKit/UIProcess/SuspendedPageProxy.cpp
M Source/WebKit/UIProcess/SuspendedPageProxy.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
M Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp
A Tools/TestWebKitAPI/Tests/IPC/IPCTestUtilities.cpp
A Tools/TestWebKitAPI/Tests/IPC/IPCTestUtilities.h
A Tools/TestWebKitAPI/Tests/IPC/MessageSenderTests.cpp
Log Message:
-----------
IPC::MessageSender::sendWithAsyncReply is not consistent with send failures
https://bugs.webkit.org/show_bug.cgi?id=246457
rdar://problem/101124692
Reviewed by Chris Dumez.
The MessageSender would add the async reply handler to the connection
regardless of whether the message send failed or not. This was a
result of exposing Connection-internal addAsyncReplyHandler() function.
Move the addAsyncReplyHandler() out of the Connection interface and
handle the send failures inside Connection. This is possible by
changing the async message format: first encode the arguments in
the message-specific template and then and inside
message agnostic Connection::sendMessageWithAsyncReply
encode the pre-allocated replyID. The replyID must be preallocated
at the moment as AuxiliaryProcessProxy delays the commit of the
reply handler.
This is a requirement for fix other concurrency bugs between
connection thread calling invalidate() and another thread
calling sendWithAsyncReply(). These fixes will be made in
future commits.
* Source/WebKit/Platform/IPC/Connection.cpp:
(IPC::addAsyncReplyHandler):
(IPC::Connection::sendMessageWithAsyncReply):
* Source/WebKit/Platform/IPC/Connection.h:
(IPC::Connection::makeAsyncReplyHandler):
(IPC::Connection::sendWithAsyncReply):
* Source/WebKit/Platform/IPC/HandleMessage.h:
(IPC::handleMessageAsync):
(IPC::handleMessageAsyncWantsConnection):
* Source/WebKit/Platform/IPC/MessageSender.cpp:
(IPC::MessageSender::sendMessage):
(IPC::MessageSender::sendMessageWithAsyncReply):
* Source/WebKit/Platform/IPC/MessageSender.h:
* Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::sendMessage):
(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
(WebKit::AuxiliaryProcessProxy::replyToPendingMessages):
* Source/WebKit/UIProcess/AuxiliaryProcessProxy.h:
(WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
* Source/WebKit/UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::sendMessage):
(WebKit::DrawingAreaProxy::sendMessageWithAsyncReply):
* Source/WebKit/UIProcess/DrawingAreaProxy.h:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::sendMessage):
(WebKit::ProvisionalPageProxy::sendMessageWithAsyncReply):
* Source/WebKit/UIProcess/ProvisionalPageProxy.h:
* Source/WebKit/UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::sendMessage):
(WebKit::SuspendedPageProxy::sendMessageWithAsyncReply):
* Source/WebKit/UIProcess/SuspendedPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sendMessage):
(WebKit::WebPageProxy::sendMessageWithAsyncReply):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:
(WebKit::IPCTestingAPI::sendMessageWithJSArguments):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp:
(): Deleted.
(TestWebKitAPI::PrintTo): Deleted.
(TestWebKitAPI::OpenedConnectionTest::serverIsA const): Deleted.
(TestWebKitAPI::OpenedConnectionTest::SetUp): Deleted.
(TestWebKitAPI::OpenedConnectionTest::TearDown): Deleted.
(TestWebKitAPI::OpenedConnectionTest::openA): Deleted.
(TestWebKitAPI::OpenedConnectionTest::openB): Deleted.
(TestWebKitAPI::OpenedConnectionTest::openBoth): Deleted.
(TestWebKitAPI::OpenedConnectionTest::a): Deleted.
(TestWebKitAPI::OpenedConnectionTest::aClient): Deleted.
(TestWebKitAPI::OpenedConnectionTest::b): Deleted.
(TestWebKitAPI::OpenedConnectionTest::bClient): Deleted.
(TestWebKitAPI::OpenedConnectionTest::deleteA): Deleted.
(TestWebKitAPI::OpenedConnectionTest::deleteB): Deleted.
Canonical link: https://commits.webkit.org/256008@main
More information about the webkit-changes
mailing list