Make PushService aware of data store identifiers and push partitions#7398
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Dec 10, 2022
Merged
Conversation
2332601 to
1b66714
Compare
Collaborator
|
EWS run on previous version of this PR (hash 1b66714) Details
|
1b66714 to
04da94b
Compare
Collaborator
|
EWS run on previous version of this PR (hash 04da94b) Details
|
beidson
approved these changes
Dec 9, 2022
04da94b to
cf1baed
Compare
Collaborator
|
EWS run on current version of this PR (hash cf1baed) Details
|
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
cf1baed to
bc9d83a
Compare
Collaborator
|
Committed 257669@main (bc9d83a): https://commits.webkit.org/257669@main Reviewed commits have been landed. Closing PR #7398 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bc9d83a
cf1baed
🧪 ios-wk2🧪 api-mac🧪 api-ios🧪 api-gtk🧪 mac-AS-debug-wk2