Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a8242ccbe1fe4db7f6c673018283a06fb2465173
https://github.com/WebKit/WebKit/commit/a8242ccbe1fe4db7f6c673018283a06fb2465173
Author: Matt Woodrow <[email protected]>
Date: 2025-11-02 (Sun, 02 Nov 2025)
Changed paths:
M Source/WebKit/Platform/IPC/Connection.cpp
M Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp
Log Message:
-----------
shouldMaintainOrderingWithAsyncMessages can cause unrelated async messages to
be reordered.
https://bugs.webkit.org/show_bug.cgi?id=301678
<rdar://problem/163697393>
Reviewed by Kimmo Kinnunen.
We receive messages A, Sync (with the the
shouldMaintainOrderingWithAsyncMessages flag), B.
When A arrives, we put a callback for dispatchIncomingMessages into the
destination threads queue, and put A into m_incomingMessages.
When Sync arrives, it pulls A into the
m_messagesToDispatchWhileWaitingForSyncReply queue, along with Sync and put a
callback for dispatchSyncStateMessages into the dest thread queue.
When B arrives, it gets put into m_incomingMessages.
Then on the dest thread, dispatchIncomingMessages runs, which dispatches B.
Sometime later on dispatchSyncStateMessages runs, which dispatches A,Sync.
Add a new HashSet that tracks when we have the
shouldMaintainOrderingWithAsyncMessages, and add following messages to the sync
ordering queue as well (up until the sync message gets dispatched).
* Source/WebKit/Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::processIncomingMessage):
(IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection):
* Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp:
(TestWebKitAPI::TEST_P):
Canonical link: https://commits.webkit.org/302457@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications