Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bc9d83a37f645bc8d118d84b8b557426af4bede2
https://github.com/WebKit/WebKit/commit/bc9d83a37f645bc8d118d84b8b557426af4bede2
Author: Ben Nham <[email protected]>
Date: 2022-12-09 (Fri, 09 Dec 2022)
Changed paths:
A Source/WebCore/Modules/push-api/PushSubscriptionIdentifier.cpp
M Source/WebCore/Modules/push-api/PushSubscriptionIdentifier.h
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebKit/NetworkProcess/NetworkSession.cpp
M Source/WebKit/NetworkProcess/NetworkSession.h
M Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp
M Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h
M Source/WebKit/Platform/IPC/DaemonCoders.cpp
M Source/WebKit/Platform/IPC/DaemonCoders.h
M Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.h
M Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.serialization.in
M Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h
M Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
M Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp
M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h
M Source/WebKit/webpushd/PushClientConnection.h
M Source/WebKit/webpushd/PushClientConnection.mm
M Source/WebKit/webpushd/PushService.h
M Source/WebKit/webpushd/PushService.mm
M Source/WebKit/webpushd/WebPushDaemon.h
M Source/WebKit/webpushd/WebPushDaemon.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm
Log Message:
-----------
Make PushService aware of data store identifiers and push partitions
https://bugs.webkit.org/show_bug.cgi?id=249032
<rdar://problem/103187488>
Reviewed by Brady Eidson.
This changes PushService to identify push subscriptions using the tuple
(bundleID, pushPartition,
dataStoreUUID, serviceWorkerScopeURL). Previously, push subscriptions were
identified by only
(bundleID, serviceWorkerScopeURL).
This mostly entails replacing all methods that take bundleIDs in PushService
with methods that take
a PushSubscriptionSetIdentifier (which is (bundleID, pushPartition,
dataStoreUUID)).
Additionally, I changed the WebPushDaemon integration tests to test multiple
subscription set
identifiers. There was a massive amount of boilerplate in the tests that made
that ugly to do, so I
refactored the tests to remove the boilerplate.
* Source/WebCore/Modules/push-api/PushSubscriptionIdentifier.cpp: Added.
(WebCore::makePushTopic):
(WebCore::PushSubscriptionSetIdentifier::debugDescription const):
* Source/WebCore/Modules/push-api/PushSubscriptionIdentifier.h:
(WebCore::PushSubscriptionSetIdentifier::operator== const):
(WebCore::add):
(WebCore::PushSubscriptionSetIdentifier::isHashTableDeletedValue const):
(WTF::PushSubscriptionSetIdentifierHash::hash):
(WTF::PushSubscriptionSetIdentifierHash::equal):
(WTF::HashTraits<WebCore::PushSubscriptionSetIdentifier>::emptyValue):
(WTF::HashTraits<WebCore::PushSubscriptionSetIdentifier>::constructDeletedValue):
(WTF::HashTraits<WebCore::PushSubscriptionSetIdentifier>::isDeletedValue):
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebKit/NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* Source/WebKit/NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::dataStoreIdentifier const):
* Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h:
* Source/WebKit/Platform/IPC/DaemonCoders.cpp:
(WebKit::Daemon::void>::encode):
(WebKit::Daemon::void>::decode):
(WebKit::Daemon::Coder<WTF::UUID>::encode):
(WebKit::Daemon::Coder<WTF::UUID>::decode):
* Source/WebKit/Platform/IPC/DaemonCoders.h:
* Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.h:
(WebKit::WebPushD::WebPushDaemonConnectionConfiguration::encode const):
(WebKit::WebPushD::WebPushDaemonConnectionConfiguration::decode):
* Source/WebKit/Shared/WebPushDaemonConnectionConfiguration.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration webPushPartitionString]):
(-[_WKWebsiteDataStoreConfiguration setWebPushPartitionString:]):
* Source/WebKit/UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::setPushesAndNotificationsEnabledForOrigin):
(WebKit::removePushSubscriptionsForOrigins):
(WebKit::persistentDataStoreIfExists): Deleted.
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy const):
(WebKit::WebsiteDataStoreConfiguration::webPushDaemonConnectionConfiguration
const):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::webPushPartitionString const):
(WebKit::WebsiteDataStoreConfiguration::setWebPushPartitionString):
* Source/WebKit/webpushd/PushClientConnection.h:
(WebPushD::ClientConnection::pushPartitionString const):
(WebPushD::ClientConnection::dataStoreIdentifier const):
* Source/WebKit/webpushd/PushClientConnection.mm:
(WebPushD::ClientConnection::updateConnectionConfiguration):
(WebPushD::ClientConnection::subscriptionSetIdentifier):
* Source/WebKit/webpushd/PushService.h:
* Source/WebKit/webpushd/PushService.mm:
(WebPushD::PushServiceRequest::subscriptionSetIdentifier const):
(WebPushD::PushServiceRequest::scope const):
(WebPushD::PushServiceRequest::key const):
(WebPushD::PushServiceRequest::PushServiceRequest):
(WebPushD::PushServiceRequestImpl::PushServiceRequestImpl):
(WebPushD::PushServiceRequestImpl::fulfill):
(WebPushD::PushServiceRequestImpl::reject):
(WebPushD::GetSubscriptionRequest::GetSubscriptionRequest):
(WebPushD::GetSubscriptionRequest::startInternal):
(WebPushD::SubscribeRequest::SubscribeRequest):
(WebPushD::SubscribeRequest::startImpl):
(WebPushD::UnsubscribeRequest::UnsubscribeRequest):
(WebPushD::UnsubscribeRequest::startInternal):
(WebPushD::PushService::enqueuePushServiceRequest):
(WebPushD::PushService::finishedPushServiceRequest):
(WebPushD::PushService::getSubscription):
(WebPushD::PushService::subscribe):
(WebPushD::PushService::unsubscribe):
(WebPushD::PushService::incrementSilentPushCount):
(WebPushD::PushService::setPushesEnabledForSubscriptionSetAndOrigin):
(WebPushD::PushService::removeRecordsForSubscriptionSet):
(WebPushD::PushService::removeRecordsForSubscriptionSetAndOrigin):
(WebPushD::PushService::removeRecordsImpl):
(WebPushD::PushService::didReceivePushMessage):
(WebPushD::makeSubscriptionSet): Deleted.
(WebPushD::makePushTopic): Deleted.
(WebPushD::PushServiceRequest::bundleIdentifier): Deleted.
(WebPushD::PushServiceRequest::scope): Deleted.
(WebPushD::PushService::setPushesEnabledForBundleIdentifierAndOrigin): Deleted.
(WebPushD::PushService::removeRecordsForBundleIdentifier): Deleted.
(WebPushD::PushService::removeRecordsForBundleIdentifierAndOrigin): Deleted.
* Source/WebKit/webpushd/WebPushDaemon.h:
* Source/WebKit/webpushd/WebPushDaemon.mm:
(WebPushD::Daemon::startMockPushService):
(WebPushD::Daemon::startPushService):
(WebPushD::Daemon::canRegisterForNotifications):
(WebPushD::Daemon::deletePushRegistration):
(WebPushD::Daemon::setPushAndNotificationsEnabledForOrigin):
(WebPushD::Daemon::deletePushAndNotificationRegistration):
(WebPushD::Daemon::injectPushMessageForTesting):
(WebPushD::Daemon::handleIncomingPush):
(WebPushD::Daemon::notifyClientPushMessageIsAvailable):
(WebPushD::Daemon::getPendingPushMessages):
(WebPushD::Daemon::subscribeToPushService):
(WebPushD::Daemon::unsubscribeFromPushService):
(WebPushD::Daemon::getPushSubscription):
(WebPushD::Daemon::incrementSilentPushCount):
(WebPushD::Daemon::removeAllPushSubscriptions):
(WebPushD::Daemon::removePushSubscriptionsForOrigin):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::sendConfigurationWithAuditToken):
(TestWebKitAPI::log):
(TestWebKitAPI::then):
(TestWebKitAPI::catch):
(TestWebKitAPI::subscribe):
(TestWebKitAPI::unsubscribe):
(TestWebKitAPI::getPushSubscription):
(TestWebKitAPI::disableShowNotifications):
(-[NotificationScriptMessageHandler setMessageHandler:]): Deleted.
(-[NotificationScriptMessageHandler
userContentController:didReceiveScriptMessage:]): Deleted.
(TestWebKitAPI::function): Deleted.
Canonical link: https://commits.webkit.org/257669@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes