[webkit-changes] [WebKit/WebKit] d76227: Clean up use of Decoder in Connection code

Alex Christensen noreply at github.com
Tue Jan 9 10:46:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d76227b56e8b367086b2eab26fa4f5894828c52f
      https://github.com/WebKit/WebKit/commit/d76227b56e8b367086b2eab26fa4f5894828c52f
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M Source/WebKit/Platform/IPC/Connection.cpp
    M Source/WebKit/Platform/IPC/Connection.h
    M Source/WebKit/Platform/IPC/Encoder.cpp
    M Source/WebKit/Platform/IPC/Encoder.h
    M Source/WebKit/Platform/IPC/MessageReceiveQueue.h
    M Source/WebKit/Platform/IPC/MessageReceiveQueues.h
    M Source/WebKit/Platform/IPC/StreamClientConnection.h
    M Source/WebKit/Platform/IPC/StreamServerConnection.cpp
    M Source/WebKit/Platform/IPC/StreamServerConnection.h
    M Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm
    M Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp
    M Source/WebKit/Platform/IPC/win/ConnectionWin.cpp
    M Source/WebKit/Shared/IPCTester.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp
    M Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp
    M Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
    M Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp
    M Source/WebKit/WebProcess/WebProcess.cpp

  Log Message:
  -----------
  Clean up use of Decoder in Connection code
https://bugs.webkit.org/show_bug.cgi?id=267240

Reviewed by Chris Dumez.

Use UniqueRef instead of unique_ptr where possible to indicate that it can't be null.
PendingSyncReply::didReceiveReply was always only set to true when replyDecoder was set
to a non-null value, so remove it as redundant state.
Use Expected for DecoderOrError and ConnectionSendSyncResult.
Remove unused Encoder::shouldDispatchMessageWhenWaitingForSyncReply.

* Source/WebKit/Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::processIncomingMessage):
(IPC::Connection::enqueueMatchingMessagesToMessageReceiveQueue):
(IPC::Connection::dispatchMessageReceiverMessage):
(IPC::Connection::sendMessage):
(IPC::Connection::waitForMessage):
(IPC::Connection::sendSyncMessage):
(IPC::Connection::waitForSyncReply):
(IPC::Connection::processIncomingSyncReply):
(IPC::Connection::processIncomingMessage):
(IPC::Connection::dispatchIncomingMessageForTesting):
(IPC::Connection::dispatchSyncMessage):
(IPC::Connection::enqueueIncomingMessage):
(IPC::Connection::dispatchMessage):
(IPC::Connection::dispatchOneIncomingMessage):
(IPC::Connection::dispatchIncomingMessages):
* Source/WebKit/Platform/IPC/Connection.h:
(IPC::ConnectionSendSyncResult::ConnectionSendSyncResult):
(IPC::ConnectionSendSyncResult::succeeded const):
(IPC::ConnectionSendSyncResult::error const):
(IPC::ConnectionSendSyncResult::reply):
(IPC::ConnectionSendSyncResult::takeReply):
(IPC::ConnectionSendSyncResult::takeReplyOr):
(IPC::Connection::sendSync):
(IPC::Connection::waitForAndDispatchImmediately):
(IPC::Connection::waitForAsyncReplyAndDispatchImmediately):
(IPC::Connection::DecoderOrError::DecoderOrError): Deleted.
* Source/WebKit/Platform/IPC/Encoder.cpp:
(IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply const): Deleted.
* Source/WebKit/Platform/IPC/Encoder.h:
* Source/WebKit/Platform/IPC/MessageReceiveQueue.h:
* Source/WebKit/Platform/IPC/MessageReceiveQueues.h:
* Source/WebKit/Platform/IPC/StreamClientConnection.h:
(IPC::StreamClientConnection::trySendSyncStream):
* Source/WebKit/Platform/IPC/StreamServerConnection.cpp:
(IPC::StreamServerConnection::enqueueMessage):
(IPC::StreamServerConnection::dispatchOutOfStreamMessage):
* Source/WebKit/Platform/IPC/StreamServerConnection.h:
* Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm:
(IPC::Connection::receiveSourceEventHandler):
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.cpp:
(WebKit::RemoteImageBufferProxy::sendSync):
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp:
(WebKit::RemoteImageBufferSetProxy::sendSync):
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::sendSync):
* Source/WebKit/WebProcess/WebProcess.cpp:
(WebKit::getNetworkProcessConnection):

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




More information about the webkit-changes mailing list