Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 578b578ca162593e05818162b33ff99dd3975952
      
https://github.com/WebKit/WebKit/commit/578b578ca162593e05818162b33ff99dd3975952
  Author: Ruthvik Konda <[email protected]>
  Date:   2026-07-29 (Wed, 29 Jul 2026)

  Changed paths:
    M Source/WebKit/Platform/IPC/HandleMessage.h
    M Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp
    M Source/WebKit/Scripts/webkit/tests/MessageNames.cpp
    M Source/WebKit/Scripts/webkit/tests/MessageNames.h
    M Source/WebKit/Scripts/webkit/tests/TestWithStreamSwift.messages.in
    M Source/WebKit/Scripts/webkit/tests/TestWithStreamSwiftMessageReceiver.cpp
    M Source/WebKit/Scripts/webkit/tests/TestWithStreamSwiftMessages.h

  Log Message:
  -----------
  Stream IPC message receivers can dispatch synchronous messages to Swift

https://bugs.webkit.org/show_bug.cgi?id=320481
rdar://183448505

Reviewed by Mike Wyrzykowski.

Stream IPC message receivers can now be implemented in Swift, but a
synchronous message on such a receiver does not build. 
IPC::handleMessageSynchronous
constructs the reply completion handler itself, and its StreamServerConnection
overload builds a bare CompletionHandler rather than routing it through
MethodSignatureValidation::wrapCompletionHandler, unlike the Connection overload
and handleMessageAsync. A Swift handler takes its completion handler as a
WTF::RefCountable<CompletionHandler<...>>*, because a CompletionHandler is not
itself reference counted and Swift needs an ARC-managed reference to keep it
alive until the reply is sent, so a Swift receiver with a Synchronous message
cannot be dispatched.

Wrap and unwrap the completion handler in the stream overload exactly as the
non-stream overload does. For C++ receivers wrapCompletionHandler and
unwrapCompletionHandler are std::identity, so existing stream receivers are
unaffected. This is a prerequisite for moving RemoteMesh, whose
PaintCurrentFrameToImageBuffer message is synchronous, to Swift.

Adds a Synchronous message to the TestWithStreamSwift fixture in
messages_unittest.py, giving the stream Swift receiver combination codegen
coverage. The generated output is the same either way, so the fixture does not
exercise the fix itself; that is covered when a Swift stream receiver is first
compiled.

* Source/WebKit/Platform/IPC/HandleMessage.h:
(IPC::handleMessageSynchronous):
* Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
* Source/WebKit/Scripts/webkit/tests/MessageNames.cpp:
* Source/WebKit/Scripts/webkit/tests/MessageNames.h:
* Source/WebKit/Scripts/webkit/tests/TestWithStreamSwift.messages.in:
* Source/WebKit/Scripts/webkit/tests/TestWithStreamSwiftMessageReceiver.cpp:
* Source/WebKit/Scripts/webkit/tests/TestWithStreamSwiftMessages.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to