-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 273851@main (d1fb588). https://bugs.webkit.org/show_bug.c…
…gi?id=268362 Unthrottled IPC::Connection loses messages when connection is closed https://bugs.webkit.org/show_bug.cgi?id=268362 rdar://121910136 Reviewed by Matt Woodrow. When IPC::Connection::invalidate() would be called, some of the messages already sent might have been lost: 1. Unsent messages due to outgoing messages buffering 2. Messages not delivered at the recipient because message delivery would check isValid() Fix 1. by adding a blocking IPC::Connection::flushSentMessages() that will wait until send list flips to zero. The flushSentMessages() call is distinct from invalidate() to preserve the ability to call invalidate() in non-blocking manner. Fix 2. by not checking for isValid() but for m_client / m_syncState. isValid() flips immediately in the IPC receive queue when OS signals that the connection was closed. m_client, m_syncState flips to nullptr when client signals that they do not want to receive messages anymore, via invalidate(). By contract, IPC::Connection invalidates itself after Client::didClose(), too. Fixes mostly upcoming GPUP cases where one connection is closed, but not the whole per-WP session (GPUConnectionToWebProcess). The individual connections might carry important messages up until the disconnection, so all must be played back before handling the connection closing. * Source/WebKit/Platform/IPC/Connection.cpp: (IPC::Connection::flushSentMessages): (IPC::Connection::connectionDidClose): (IPC::Connection::sendOutgoingMessages): (IPC::Connection::dispatchMessage): * Source/WebKit/Platform/IPC/Connection.h: * Source/WebKit/Platform/IPC/StreamClientConnection.cpp: (IPC::StreamClientConnection::flushSentMessages): * Source/WebKit/Platform/IPC/StreamClientConnection.h: * Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp: (TestWebKitAPI::TEST_P): * Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp: (TestWebKitAPI::TEST_P): Canonical link: https://commits.webkit.org/273851@main Canonical link: https://commits.webkit.org/266719.359@webkitglib/2.42
- Loading branch information
1 parent
bc083b6
commit 6d9f342
Showing
6 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters