[webkit-changes] [WebKit/WebKit] 47dfb6: IPC stream buffer cannot be tested without the con...

Kimmo Kinnunen noreply at github.com
Tue Jan 17 05:55:29 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 47dfb60d326b5d2004e4642fcc2b49f138df2b9c
      https://github.com/WebKit/WebKit/commit/47dfb60d326b5d2004e4642fcc2b49f138df2b9c
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-01-17 (Tue, 17 Jan 2023)

  Changed paths:
    M Source/WebKit/Platform/IPC/StreamClientConnection.cpp
    M Source/WebKit/Platform/IPC/StreamClientConnection.h
    A Source/WebKit/Platform/IPC/StreamClientConnectionBuffer.h
    M Source/WebKit/Platform/IPC/StreamConnectionBuffer.cpp
    M Source/WebKit/Platform/IPC/StreamConnectionBuffer.h
    M Source/WebKit/Platform/IPC/StreamServerConnection.cpp
    M Source/WebKit/Platform/IPC/StreamServerConnection.h
    A Source/WebKit/Platform/IPC/StreamServerConnectionBuffer.h
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp
    M Tools/TestWebKitAPI/Tests/IPC/StreamConnectionBufferTests.cpp

  Log Message:
  -----------
  IPC stream buffer cannot be tested without the connection
https://bugs.webkit.org/show_bug.cgi?id=250704
rdar://104325129

Reviewed by Antti Koivisto.

The logic to manipulate IPC stream buffer was partly inline
in Stream{Client,Server}Connection. This made both the
connection code harder to understand and the buffer code
harder to understand and modify.

Move the buffer code to Stream{Client,Server}ConnectionBuffer
classes which are subclasses of StreamConnectionBuffer.
The goal is to be able to test the buffer implementation in
isolation. Also, in the future some of the duplicated functionality
should be moved to the base class.

Removes custom Stream{Client,Server}Connection::Span and uses normal
WTF::Span<uint8_t>.

No intended change in functionality.

* Source/WebKit/Platform/IPC/StreamClientConnection.cpp:
(IPC::StreamClientConnection::create):
(IPC::StreamClientConnection::StreamClientConnection):
(IPC::StreamClientConnection::setSemaphores):
(IPC::StreamClientConnection::hasSemaphores const):
(IPC::StreamClientConnection::setMaxBatchSize):
(IPC::StreamClientConnection::wakeUpServer):
(IPC::StreamClientConnection::bufferForTesting):
* Source/WebKit/Platform/IPC/StreamClientConnection.h:
(IPC::StreamClientConnection::send):
(IPC::StreamClientConnection::sendWithAsyncReply):
(IPC::StreamClientConnection::trySendStream):
(IPC::StreamClientConnection::sendSync):
(IPC::StreamClientConnection::trySendSyncStream):
(IPC::StreamClientConnection::trySendDestinationIDIfNeeded):
(IPC::StreamClientConnection::sendProcessOutOfStreamMessage):
(IPC::StreamClientConnection::tryAcquire): Deleted.
(IPC::StreamClientConnection::tryAcquireAll): Deleted.
(IPC::StreamClientConnection::release): Deleted.
(IPC::StreamClientConnection::alignedSpan): Deleted.
(IPC::StreamClientConnection::size): Deleted.
(IPC::StreamClientConnection::toLimit const): Deleted.
* Source/WebKit/Platform/IPC/StreamClientConnectionBuffer.h: Added.
(IPC::StreamClientConnectionBuffer::hasSemaphores const):
(IPC::StreamClientConnectionBuffer::alignOffset const):
(IPC::StreamClientConnectionBuffer::sharedClientOffset):
(IPC::StreamClientConnectionBuffer::sharedClientLimit):
(IPC::StreamClientConnectionBuffer::createMemory):
(IPC::StreamClientConnectionBuffer::StreamClientConnectionBuffer):
(IPC::StreamClientConnectionBuffer::tryAcquire):
(IPC::StreamClientConnectionBuffer::tryAcquireAll):
(IPC::StreamClientConnectionBuffer::release):
(IPC::StreamClientConnectionBuffer::resetClientOffset):
(IPC::StreamClientConnectionBuffer::alignedSpan):
(IPC::StreamClientConnectionBuffer::size):
(IPC::StreamClientConnectionBuffer::toLimit const):
(IPC::StreamClientConnectionBuffer::setSemaphores):
(IPC::StreamClientConnectionBuffer::wakeUpServer):
* Source/WebKit/Platform/IPC/StreamConnectionBuffer.cpp:
(IPC::createMemory): Deleted.
(IPC::StreamConnectionBuffer::map): Deleted.
* Source/WebKit/Platform/IPC/StreamConnectionBuffer.h:
* Source/WebKit/Platform/IPC/StreamServerConnection.cpp:
(IPC::StreamServerConnection::create):
(IPC::StreamServerConnection::StreamServerConnection):
(IPC::StreamServerConnection::dispatchStreamMessages):
(IPC::StreamServerConnection::processSetStreamDestinationID):
(IPC::StreamServerConnection::dispatchStreamMessage):
(IPC::StreamServerConnection::dispatchOutOfStreamMessage):
(IPC::StreamServerConnection::tryAcquire): Deleted.
(IPC::StreamServerConnection::acquireAll): Deleted.
(IPC::StreamServerConnection::release): Deleted.
(IPC::StreamServerConnection::releaseAll): Deleted.
(IPC::StreamServerConnection::alignedSpan): Deleted.
(IPC::StreamServerConnection::size): Deleted.
(IPC::StreamServerConnection::clampedLimit const): Deleted.
* Source/WebKit/Platform/IPC/StreamServerConnection.h:
(IPC::StreamServerConnection::sendSyncReply):
* Source/WebKit/Platform/IPC/StreamServerConnectionBuffer.h: Added.
(IPC::StreamServerConnectionBuffer::clientWaitSemaphore):
(IPC::StreamServerConnectionBuffer::alignOffset const):
(IPC::StreamServerConnectionBuffer::sharedServerLimit):
(IPC::StreamServerConnectionBuffer::sharedServerOffset):
(IPC::StreamServerConnectionBuffer::map):
(IPC::StreamServerConnectionBuffer::tryAcquire):
(IPC::StreamServerConnectionBuffer::acquireAll):
(IPC::StreamServerConnectionBuffer::release):
(IPC::StreamServerConnectionBuffer::releaseAll):
(IPC::StreamServerConnectionBuffer::alignedSpan):
(IPC::StreamServerConnectionBuffer::size):
(IPC::StreamServerConnectionBuffer::clampedLimit const):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:
(WebKit::IPCTestingAPI::JSIPCStreamConnectionBuffer::encode const):
(WebKit::IPCTestingAPI::JSIPCStreamClientConnection::prepareToSendOutOfStreamMessage):
* Tools/TestWebKitAPI/Tests/IPC/StreamConnectionBufferTests.cpp:
(TestWebKitAPI::TEST):
(TestWebKitAPI::StreamConnectionBufferTest::bufferSizeLog2 const):
(TestWebKitAPI::StreamConnectionBufferTest::client):
(TestWebKitAPI::StreamConnectionBufferTest::server):
(TestWebKitAPI::StreamConnectionBufferTest::isValid const):
(TestWebKitAPI::fill):
(TestWebKitAPI::expectFilled):
(TestWebKitAPI::TEST_P):

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




More information about the webkit-changes mailing list