Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 70dba30bd03c14d661efe268d25e418018fdc9d9
      
https://github.com/WebKit/WebKit/commit/70dba30bd03c14d661efe268d25e418018fdc9d9
  Author: Brady Eidson <[email protected]>
  Date:   2023-09-10 (Sun, 10 Sep 2023)

  Changed paths:
    M Source/WebKit/CMakeLists.txt
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources-output.xcfilelist
    M Source/WebKit/DerivedSources.make
    M 
Source/WebKit/NetworkProcess/Notifications/Cocoa/WebPushDaemonConnectionCocoa.mm
    M Source/WebKit/NetworkProcess/Notifications/NetworkNotificationManager.cpp
    M Source/WebKit/NetworkProcess/Notifications/NetworkNotificationManager.h
    M Source/WebKit/NetworkProcess/Notifications/WebPushDaemonConnection.h
    M Source/WebKit/Platform/IPC/DaemonCoders.cpp
    M Source/WebKit/Platform/IPC/MessageSender.cpp
    M Source/WebKit/Platform/IPC/MessageSender.h
    M Source/WebKit/Platform/IPC/MessageSenderInlines.h
    M Source/WebKit/Scripts/webkit/messages.py
    M 
Source/WebKit/Scripts/webkit/tests/TestWithoutUsingIPCConnectionMessageReceiver.cpp
    M Source/WebKit/Shared/API/Cocoa/WKMain.mm
    M Source/WebKit/Shared/Daemon/DaemonUtilities.h
    M Source/WebKit/Shared/Daemon/DaemonUtilities.mm
    M Source/WebKit/Shared/WTFArgumentCoders.serialization.in
    M Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.h
    M Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.serialization.in
    M Source/WebKit/Shared/WebPushDaemonConstants.h
    M Source/WebKit/Sources.txt
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/webpushd/PushClientConnection.h
    A Source/WebKit/webpushd/PushClientConnection.messages.in
    M Source/WebKit/webpushd/PushClientConnection.mm
    M Source/WebKit/webpushd/WebPushDaemon.h
    M Source/WebKit/webpushd/WebPushDaemon.mm
    M Source/WebKit/webpushd/WebPushDaemonMain.h
    M Source/WebKit/webpushd/WebPushDaemonMain.mm
    M Source/WebKit/webpushd/webpushtool/WebPushToolConnection.h
    M Source/WebKit/webpushd/webpushtool/WebPushToolConnection.mm
    M Tools/TestWebKitAPI/Configurations/TestIPC.xcconfig
    M Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm

  Log Message:
  -----------
  Switch webpushd over to using generated IPC encoder/decoder
https://bugs.webkit.org/show_bug.cgi?id=261361
rdar://114886414

Reviewed by Chris Dumez.

All of these hand rolled and hand maintained messages and related macros and 
templates are... fragile.
Let's generate them, greatly improving the ability to hack on webpushd related 
stuff quickly.

This patch:
- Generates messages/serializers for PushClientConnection stuff
- Removes all of the raw xpc messaging to webpushd
- Exposes these messages and ArgumentCoders to TestWebKitAPI and webpushtool
- Adapts TestWebKitAPI and webpushtool to these changes

* Source/WebKit/CMakeLists.txt:
* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources-output.xcfilelist:
* Source/WebKit/DerivedSources.make:
* 
Source/WebKit/NetworkProcess/Notifications/Cocoa/WebPushDaemonConnectionCocoa.mm:
(WebKit::WebPushD::Connection::newConnectionWasInitialized const):
(WebKit::WebPushD::messageDictionaryFromEncoder):
(WebKit::WebPushD::Connection::performSendWithoutUsingIPCConnection const):
(WebKit::WebPushD::Connection::performSendWithAsyncReplyWithoutUsingIPCConnection
 const):
(WebKit::WebPushD::addVersionAndEncodedMessageToDictionary): Deleted.
(WebKit::WebPushD::handleWebPushDaemonMessage): Deleted.
(WebKit::WebPushD::Connection::connectionReceivedEvent): Deleted.
(WebKit::WebPushD::Connection::dictionaryFromMessage const): Deleted.
* Source/WebKit/NetworkProcess/Notifications/NetworkNotificationManager.cpp:
(WebKit::NetworkNotificationManager::setPushAndNotificationsEnabledForOrigin):
(WebKit::NetworkNotificationManager::deletePushAndNotificationRegistration):
(WebKit::NetworkNotificationManager::getPendingPushMessages):
(WebKit::NetworkNotificationManager::subscribeToPushService):
(WebKit::NetworkNotificationManager::unsubscribeFromPushService):
(WebKit::NetworkNotificationManager::getPushSubscription):
(WebKit::NetworkNotificationManager::getPushPermissionState):
(WebKit::NetworkNotificationManager::incrementSilentPushCount):
(WebKit::NetworkNotificationManager::removeAllPushSubscriptions):
(WebKit::NetworkNotificationManager::removePushSubscriptionsForOrigin):
(WebKit::NetworkNotificationManager::sendMessage const): Deleted.
(WebKit::ReplyCaller<>::callReply): Deleted.
(WebKit::ReplyCaller<String>::callReply): Deleted.
(): Deleted.
(WebKit::ReplyCaller<bool>::callReply): Deleted.
(WebKit::ReplyCaller<unsigned>::callReply): Deleted.
(WebKit::ReplyCaller<Vector<String>::callReply): Deleted.
(WebKit::ReplyCaller<Vector<WebPushMessage>::callReply): Deleted.
(WebKit::NetworkNotificationManager::sendMessageWithReply const): Deleted.
* Source/WebKit/NetworkProcess/Notifications/NetworkNotificationManager.h:
* Source/WebKit/NetworkProcess/Notifications/WebPushDaemonConnection.h:
* Source/WebKit/Platform/IPC/DaemonCoders.cpp:
* Source/WebKit/Platform/IPC/MessageSender.cpp:
(IPC::MessageSender::performSendWithoutUsingIPCConnection const):
(IPC::MessageSender::performSendWithAsyncReplyWithoutUsingIPCConnection const):
(IPC::MessageSender::performSendWithoutUsingIPCConnection): Deleted.
(IPC::MessageSender::performSendWithAsyncReplyWithoutUsingIPCConnection): 
Deleted.
* Source/WebKit/Platform/IPC/MessageSender.h:
* Source/WebKit/Platform/IPC/MessageSenderInlines.h:
(IPC::MessageSender::sendWithoutUsingIPCConnection const):
(IPC::MessageSender::sendWithAsyncReplyWithoutUsingIPCConnection const):
(IPC::MessageSender::sendWithoutUsingIPCConnection): Deleted.
(IPC::MessageSender::sendWithAsyncReplyWithoutUsingIPCConnection): Deleted.
* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
(generate_message_handler):
* 
Source/WebKit/Scripts/webkit/tests/TestWithoutUsingIPCConnectionMessageReceiver.cpp:
(WebKit::TestWithoutUsingIPCConnection::didReceiveMessageWithReplyHandler):
* Source/WebKit/Shared/Daemon/DaemonUtilities.h:
* Source/WebKit/Shared/Daemon/DaemonUtilities.mm:
(WebKit::encoderToXPCData):
* Source/WebKit/Shared/WTFArgumentCoders.serialization.in:
* Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.h:
(WebKit::WebPushD::WebPushDaemonConnectionConfiguration::encode const): Deleted.
(WebKit::WebPushD::WebPushDaemonConnectionConfiguration::decode): Deleted.
* Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.serialization.in:
* Source/WebKit/Shared/WebPushDaemonConstants.h:
(WebKit::WebPushD::messageTypeSendsReply): Deleted.
(WebKit::WebPushD::daemonMessageTypeSendsReply): Deleted.
* Source/WebKit/Sources.txt:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/webpushd/PushClientConnection.h:
* Source/WebKit/webpushd/PushClientConnection.messages.in: Added.
* Source/WebKit/webpushd/PushClientConnection.mm:
(WebPushD::PushClientConnection::updateConnectionConfiguration):
(WebPushD::PushClientConnection::getPushTopicsForTesting):
(WebPushD::PushClientConnection::sendDebugMessage):
(WebPushD::PushClientConnection::setPushAndNotificationsEnabledForOrigin):
(WebPushD::PushClientConnection::deletePushAndNotificationRegistration):
(WebPushD::PushClientConnection::injectPushMessageForTesting):
(WebPushD::PushClientConnection::injectEncryptedPushMessageForTesting):
(WebPushD::PushClientConnection::getPendingPushMessages):
(WebPushD::PushClientConnection::subscribeToPushService):
(WebPushD::PushClientConnection::unsubscribeFromPushService):
(WebPushD::PushClientConnection::getPushSubscription):
(WebPushD::PushClientConnection::incrementSilentPushCount):
(WebPushD::PushClientConnection::removeAllPushSubscriptions):
(WebPushD::PushClientConnection::removePushSubscriptionsForOrigin):
(WebPushD::PushClientConnection::setPublicTokenForTesting):
(WebPushD::PushClientConnection::getPushPermissionState):
(WebPushD::PushClientConnection::sendDaemonMessage const): Deleted.
* Source/WebKit/webpushd/WebPushDaemon.h:
* Source/WebKit/webpushd/WebPushDaemon.mm:
(WebPushD::tryCloseRequestConnection):
(WebPushD::WebPushDaemon::connectionEventHandler):
(WebPushD::WebPushDaemon::setPushAndNotificationsEnabledForOrigin):
(WebPushD::WebPushDaemon::deletePushAndNotificationRegistration):
(WebPushD::WebPushDaemon::injectPushMessageForTesting):
(WebPushD::WebPushDaemon::injectEncryptedPushMessageForTesting):
(WebPushD::WebPushDaemon::getPendingPushMessages):
(WebPushD::WebPushDaemon::getPushTopicsForTesting):
(WebPushD::WebPushDaemon::subscribeToPushService):
(WebPushD::WebPushDaemon::unsubscribeFromPushService):
(WebPushD::WebPushDaemon::getPushSubscription):
(WebPushD::WebPushDaemon::incrementSilentPushCount):
(WebPushD::WebPushDaemon::removeAllPushSubscriptions):
(WebPushD::WebPushDaemon::removePushSubscriptionsForOrigin):
(WebPushD::WebPushDaemon::setPublicTokenForTesting):
(WebPushD::WebPushDaemon::canRegisterForNotifications):
(WebPushD::MessageInfo::echoTwice::encodeReply): Deleted.
(WebPushD::MessageInfo::deletePushAndNotificationRegistration::encodeReply): 
Deleted.
(WebPushD::MessageInfo::injectPushMessageForTesting::encodeReply): Deleted.
(WebPushD::MessageInfo::injectEncryptedPushMessageForTesting::encodeReply): 
Deleted.
(WebPushD::MessageInfo::getPendingPushMessages::encodeReply): Deleted.
(WebPushD::MessageInfo::subscribeToPushService::encodeReply): Deleted.
(WebPushD::MessageInfo::unsubscribeFromPushService::encodeReply): Deleted.
(WebPushD::MessageInfo::getPushSubscription::encodeReply): Deleted.
(WebPushD::MessageInfo::getPushPermissionState::encodeReply): Deleted.
(WebPushD::MessageInfo::incrementSilentPushCount::encodeReply): Deleted.
(WebPushD::MessageInfo::removeAllPushSubscriptions::encodeReply): Deleted.
(WebPushD::MessageInfo::removePushSubscriptionsForOrigin::encodeReply): Deleted.
(WebPushD::handleWebPushDMessageWithReply): Deleted.
(WebPushD::handleWebPushDMessage): Deleted.
(WebPushD::CompletionHandler<void): Deleted.
(WebPushD::WebPushDaemon::decodeAndHandleRawXPCMessage): Deleted.
(WebPushD::WebPushDaemon::decodeAndHandleMessage): Deleted.
(WebPushD::WebPushDaemon::echoTwice): Deleted.
(WebPushD::WebPushDaemon::setDebugModeIsEnabled): Deleted.
(WebPushD::WebPushDaemon::updateConnectionConfiguration): Deleted.
(WebPushD::toXPCArray): Deleted.
(WebPushD::WebPushDaemon::getPushPermissionState): Deleted.
* Source/WebKit/webpushd/webpushtool/WebPushToolConnection.h:
* Source/WebKit/webpushd/webpushtool/WebPushToolConnection.mm:
(WebPushTool::Connection::sendPushMessage):
(WebPushTool::Connection::startDebugStreamAction):
(WebPushTool::Connection::sendAuditToken):
(WebPushTool::messageDictionaryFromEncoder):
(WebPushTool::Connection::performSendWithoutUsingIPCConnection const):
(WebPushTool::Connection::performSendWithAsyncReplyWithoutUsingIPCConnection 
const):
* Tools/TestWebKitAPI/Configurations/TestIPC.xcconfig:
* Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::WebPushXPCConnectionMessageSender::WebPushXPCConnectionMessageSender):
(TestWebKitAPI::WebPushXPCConnectionMessageSender::incrementProtocolVersionForTesting):
(TestWebKitAPI::WebPushXPCConnectionMessageSender::messageDictionaryFromEncoder 
const):
(TestWebKitAPI::WebPushXPCConnectionMessageSender::performSendWithoutUsingIPCConnection
 const):
(TestWebKitAPI::WebPushXPCConnectionMessageSender::performSendWithAsyncReplyWithoutUsingIPCConnection
 const):
(TestWebKitAPI::sendConfigurationWithAuditToken):
(TestWebKitAPI::TEST):
(TestWebKitAPI::addMessageHeaders): Deleted.
(TestWebKitAPI::sendMessageToDaemon): Deleted.
(TestWebKitAPI::sendMessageToDaemonWithReplySync): Deleted.
(TestWebKitAPI::sendRawMessageToDaemonWithReplySync): Deleted.
(TestWebKitAPI::toStringVector): Deleted.
(TestWebKitAPI::encodeString): Deleted.

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to