Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2837e1eaeb3d3d5e7ac3bb0535c8ef1b9ee4fddb
      
https://github.com/WebKit/WebKit/commit/2837e1eaeb3d3d5e7ac3bb0535c8ef1b9ee4fddb
  Author: Jon Butler <[email protected]>
  Date:   2025-11-04 (Tue, 04 Nov 2025)

  Changed paths:
    A LayoutTests/ipc/get-error-string-expected.txt
    A LayoutTests/ipc/get-error-string.html
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources.make
    M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp
    M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h
    M Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
    M Source/WebKit/Platform/IPC/Connection.cpp
    M Source/WebKit/Platform/IPC/Connection.h
    M Source/WebKit/Platform/IPC/Decoder.h
    M Source/WebKit/Platform/IPC/StreamServerConnection.cpp
    M Source/WebKit/Platform/IPC/StreamServerConnection.h
    M Source/WebKit/Scripts/generate-serializers.py
    M Source/WebKit/Shared/API/Cocoa/RemoteObjectRegistry.mm
    M Source/WebKit/Shared/IPCTester.cpp
    M Source/WebKit/Shared/IPCTester.h
    M Source/WebKit/Shared/IPCTester.messages.in
    A Source/WebKit/Shared/IPCTester.serialization.in
    A Source/WebKit/Shared/TestParameter.h
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Source/WebKit/UIProcess/WebProcessProxy.messages.in
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp
    M Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp

  Log Message:
  -----------
  Implement IPC error string reporting in testing for IPC::Connection
rdar://163035367
https://bugs.webkit.org/show_bug.cgi?id=301095

Reviewed by Kimmo Kinnunen.

This patch introduces the first part of a feature to enable error reporting 
over IPC for validation failures and MESSAGE_CHECKs. This feature currently 
only supports the base IPC::Connection, and not stream connections at this time.

It adds error string tracking to the IPC Decoder and Connection, and propagates 
these during decoding. Error strings are stored until they are read by 
WebContent by calling the appropriate TakeInvalidMessageStringForTesting 
message on the underlying IPC connection. This allows tests to trigger specific 
error conditions and check the resulting string to make sure the expected 
condition was reached.

This patch also adds the IPCTester.CheckTestParameter method and the 
ipc/get-error-string.html test to demonstrate the use of this feature.

This feature is only enabled for builds using the IPC Testing API.

Tests: ipc/get-error-string.html
       Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp
       Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp

* LayoutTests/ipc/get-error-string-expected.txt: Added.
* LayoutTests/ipc/get-error-string.html: Added.
* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::takeInvalidMessageStringForTesting):
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h:
* Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in:
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::takeInvalidMessageStringForTesting):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h:
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* Source/WebKit/Platform/IPC/Connection.cpp:
(IPC::Connection::dispatchMessageReceiverMessage):
(IPC::Connection::dispatchMessage):
* Source/WebKit/Platform/IPC/Connection.h:
(IPC::Connection::hasErrorString const):
(IPC::Connection::setErrorString):
(IPC::Connection::takeErrorString):
(IPC::Connection::markCurrentlyDispatchedMessageAsInvalid):
(IPC::markCurrentlyDispatchedMessageAsInvalid):
* Source/WebKit/Platform/IPC/Decoder.h:
(IPC::Decoder::hasErrorString const):
(IPC::Decoder::setErrorString):
(IPC::Decoder::takeErrorString):
* Source/WebKit/Platform/IPC/StreamServerConnection.cpp:
(IPC::StreamServerConnection::markCurrentlyDispatchedMessageAsInvalid):
* Source/WebKit/Platform/IPC/StreamServerConnection.h:
(IPC::markCurrentlyDispatchedMessageAsInvalid):
* Source/WebKit/Scripts/generate-serializers.py:
(decode_type):
* Source/WebKit/Shared/API/Cocoa/RemoteObjectRegistry.mm:
(WebKit::RemoteObjectRegistry::callReplyBlock):
* Source/WebKit/Shared/IPCTester.cpp:
(WebKit::IPCTester::checkTestParameter):
* Source/WebKit/Shared/IPCTester.h:
* Source/WebKit/Shared/IPCTester.messages.in:
* Source/WebKit/Shared/IPCTester.serialization.in: Added.
* Source/WebKit/Shared/TestParameter.h: Added.
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::takeInvalidMessageStringForTesting):
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Source/WebKit/UIProcess/WebProcessProxy.messages.in:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp:
* Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp:

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



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

Reply via email to