[webkit-changes] [WebKit/WebKit] 961097: Add generated messages that can work without using...

Brady Eidson noreply at github.com
Thu Aug 24 21:04:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 961097c5d0de061794d8ee19cb8151804c974bb5
      https://github.com/WebKit/WebKit/commit/961097c5d0de061794d8ee19cb8151804c974bb5
  Author: Brady Eidson <beidson at apple.com>
  Date:   2023-08-24 (Thu, 24 Aug 2023)

  Changed paths:
    M Source/WebKit/Platform/IPC/Connection.h
    M Source/WebKit/Platform/IPC/DaemonConnection.h
    M Source/WebKit/Platform/IPC/HandleMessage.h
    M Source/WebKit/Platform/IPC/MessageReceiver.h
    M Source/WebKit/Platform/IPC/MessageSender.cpp
    M Source/WebKit/Platform/IPC/MessageSender.h
    M Source/WebKit/Platform/IPC/MessageSenderInlines.h
    M Source/WebKit/Platform/IPC/cocoa/DaemonConnectionCocoa.mm
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Scripts/webkit/messages_unittest.py
    M Source/WebKit/Scripts/webkit/model.py
    M Source/WebKit/Scripts/webkit/parser.py
    M Source/WebKit/Scripts/webkit/tests/Makefile
    M Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp
    M Source/WebKit/Scripts/webkit/tests/MessageNames.cpp
    M Source/WebKit/Scripts/webkit/tests/MessageNames.h
    A Source/WebKit/Scripts/webkit/tests/TestWithoutUsingIPCConnection.messages.in
    A Source/WebKit/Scripts/webkit/tests/TestWithoutUsingIPCConnectionMessageReceiver.cpp
    A Source/WebKit/Scripts/webkit/tests/TestWithoutUsingIPCConnectionMessages.h

  Log Message:
  -----------
  Add generated messages that can work without using IPC::Connection
https://bugs.webkit.org/show_bug.cgi?id=260660

Reviewed by Alex Christensen and Chris Dumez.

We want to auto generated messages to our daemons, but they don't use IPC::Connection.

This patch gives generated messages and message handlers the ability to bypass using IPC::Connection.

The MessageSender implements a few new custom methods to take a completed Encoder and ship it across its
own transport, as well as create a Decoder for replies.
The MessageReceiver implements a custom method to create its own Encoder from tranport and its own reply
handler that will be called by automatically generated code.

This just lays the groundwork and exercises it using the script tests.

Coming up next will be generating messages for webpushd

* Source/WebKit/Platform/IPC/Connection.h:
* Source/WebKit/Platform/IPC/DaemonConnection.h:
(WebKit::Daemon::Connection::initializeConnectionIfNeeded const):
* Source/WebKit/Platform/IPC/HandleMessage.h:
(IPC::handleMessageWithoutUsingIPCConnection):
(IPC::handleMessageAsyncWithoutUsingIPCConnection):
* Source/WebKit/Platform/IPC/MessageReceiver.h:
(IPC::MessageReceiver::didReceiveMessageWithReplyHandler):
* Source/WebKit/Platform/IPC/MessageSender.cpp:
(IPC::MessageSender::performSendWithoutUsingIPCConnection):
(IPC::MessageSender::performSendWithAsyncReplyWithoutUsingIPCConnection):
* Source/WebKit/Platform/IPC/MessageSender.h:
* Source/WebKit/Platform/IPC/MessageSenderInlines.h:
(IPC::MessageSender::sendWithoutUsingIPCConnection):
(IPC::MessageSender::sendWithAsyncReplyWithoutUsingIPCConnection):
* Source/WebKit/Platform/IPC/cocoa/DaemonConnectionCocoa.mm:
(WebKit::Daemon::Connection::sendWithReply const):
(WebKit::Daemon::ConnectionToMachService<Traits>::initializeConnectionIfNeeded const):
* Source/WebKit/Scripts/webkit/messages.py:
(async_message_statement):
(generate_message_handler):
* Source/WebKit/Scripts/webkit/model.py:
(MessageReceiver.__init__):
(generate_global_model):
* Source/WebKit/Scripts/webkit/parser.py:
(parse):
* Source/WebKit/Scripts/webkit/tests/Makefile:
* Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
(IPC::jsValueForArguments):
(IPC::jsValueForReplyArguments):
(IPC::messageArgumentDescriptions):
(IPC::messageReplyArgumentDescriptions):
* Source/WebKit/Scripts/webkit/tests/MessageNames.cpp:
* Source/WebKit/Scripts/webkit/tests/MessageNames.h:
* Source/WebKit/Scripts/webkit/tests/TestWithoutUsingIPCConnection.messages.in: Added.
* Source/WebKit/Scripts/webkit/tests/TestWithoutUsingIPCConnectionMessageReceiver.cpp: Added.
(WebKit::TestWithoutUsingIPCConnection::didReceiveMessageWithReplyHandler):
(IPC::jsValueForDecodedMessage<MessageName::TestWithoutUsingIPCConnection_MessageWithoutArgument>):
(IPC::jsValueForDecodedMessage<MessageName::TestWithoutUsingIPCConnection_MessageWithoutArgumentAndEmptyReply>):
(IPC::jsValueForDecodedMessageReply<MessageName::TestWithoutUsingIPCConnection_MessageWithoutArgumentAndEmptyReply>):
(IPC::jsValueForDecodedMessage<MessageName::TestWithoutUsingIPCConnection_MessageWithoutArgumentAndReplyWithArgument>):
(IPC::jsValueForDecodedMessageReply<MessageName::TestWithoutUsingIPCConnection_MessageWithoutArgumentAndReplyWithArgument>):
(IPC::jsValueForDecodedMessage<MessageName::TestWithoutUsingIPCConnection_MessageWithArgument>):
(IPC::jsValueForDecodedMessage<MessageName::TestWithoutUsingIPCConnection_MessageWithArgumentAndEmptyReply>):
(IPC::jsValueForDecodedMessageReply<MessageName::TestWithoutUsingIPCConnection_MessageWithArgumentAndEmptyReply>):
(IPC::jsValueForDecodedMessage<MessageName::TestWithoutUsingIPCConnection_MessageWithArgumentAndReplyWithArgument>):
(IPC::jsValueForDecodedMessageReply<MessageName::TestWithoutUsingIPCConnection_MessageWithArgumentAndReplyWithArgument>):
* Source/WebKit/Scripts/webkit/tests/TestWithoutUsingIPCConnectionMessages.h: Added.
(Messages::TestWithoutUsingIPCConnection::messageReceiverName):
(Messages::TestWithoutUsingIPCConnection::MessageWithoutArgument::name):
(Messages::TestWithoutUsingIPCConnection::MessageWithoutArgument::arguments):
(Messages::TestWithoutUsingIPCConnection::MessageWithoutArgumentAndEmptyReply::name):
(Messages::TestWithoutUsingIPCConnection::MessageWithoutArgumentAndEmptyReply::asyncMessageReplyName):
(Messages::TestWithoutUsingIPCConnection::MessageWithoutArgumentAndEmptyReply::arguments):
(Messages::TestWithoutUsingIPCConnection::MessageWithoutArgumentAndReplyWithArgument::name):
(Messages::TestWithoutUsingIPCConnection::MessageWithoutArgumentAndReplyWithArgument::asyncMessageReplyName):
(Messages::TestWithoutUsingIPCConnection::MessageWithoutArgumentAndReplyWithArgument::arguments):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgument::name):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgument::MessageWithArgument):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgument::arguments):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgumentAndEmptyReply::name):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgumentAndEmptyReply::asyncMessageReplyName):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgumentAndEmptyReply::MessageWithArgumentAndEmptyReply):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgumentAndEmptyReply::arguments):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgumentAndReplyWithArgument::name):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgumentAndReplyWithArgument::asyncMessageReplyName):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgumentAndReplyWithArgument::MessageWithArgumentAndReplyWithArgument):
(Messages::TestWithoutUsingIPCConnection::MessageWithArgumentAndReplyWithArgument::arguments):

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




More information about the webkit-changes mailing list