Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 77532e760a8b528addf86f4e1a73416e4dad0272
      
https://github.com/WebKit/WebKit/commit/77532e760a8b528addf86f4e1a73416e4dad0272
  Author: Ben Nham <[email protected]>
  Date:   2024-09-10 (Tue, 10 Sep 2024)

  Changed paths:
    M Source/WebCore/PAL/pal/spi/cocoa/CoreServicesSPI.h
    M Source/WebKit/Platform/spi/ios/UIKitSPI.h
    M 
Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.webpushd.sb.in
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/webpushd/PushClientConnection.h
    M Source/WebKit/webpushd/PushClientConnection.mm
    M Source/WebKit/webpushd/PushService.h
    M Source/WebKit/webpushd/PushService.mm
    A Source/WebKit/webpushd/WebClipCache.h
    A Source/WebKit/webpushd/WebClipCache.mm
    M Source/WebKit/webpushd/WebPushDaemon.h
    M Source/WebKit/webpushd/WebPushDaemon.mm
    M Source/WebKit/webpushd/WebPushDaemonMain.mm

  Log Message:
  -----------
  Implicit web clip mode should choose a web clip that is visible to the 
application
https://bugs.webkit.org/show_bug.cgi?id=279278
rdar://135297386

Reviewed by Per Arne Vollan.

The "implicit web clip mode" in webpushd that selects the oldest web clip 
associated with an origin
(added in 282857@main) doesn't totally work, because not all web clips are 
visible to all apps.

Instead, we now select the oldest web clip visible to the app (by checking
`trustedClientBundleIdentifiers`) and persist that selection to a plist. This 
also required some
other changes so that webpushd would write temp files to the appropriate 
directory.

Another change here is that we previously allowed multiple apps to access 
webpushd, but the design
from the beginning was to only allow one app to access it, so I changed methods 
that checked whether
apps were allowed to connect to webpushd to only allow a single app to connect.

The class that abstracts this is optimistically named WebClipCache, which 
doesn't actually cache a
whole lot at the moment, but will once I get around to making all the possible 
cache invalidation
events from system frameworks fire notifyd notifications.

I also made a drive-by fix an issue with the notification source being 
incorrect in
WebPushDaemon::showNotification.

* Source/WebCore/PAL/pal/spi/cocoa/CoreServicesSPI.h:
* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
* Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.webpushd.sb.in:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/webpushd/PushClientConnection.h:
* Source/WebKit/webpushd/PushClientConnection.mm:
(WebPushD::PushClientConnection::subscriptionSetIdentifierForOrigin const):
(WebPushD::webClipIdentifierForOrigin): Deleted.
(WebPushD::PushClientConnection::associatedWebClipTitle const): Deleted.
* Source/WebKit/webpushd/PushService.h:
* Source/WebKit/webpushd/PushService.mm:
(WebPushD::PushService::updateSubscriptionSetState):
* Source/WebKit/webpushd/WebClipCache.h:
* Source/WebKit/webpushd/WebClipCache.mm: Added.
(WebPushD::WebClipCache::WebClipCache):
(WebPushD::webClipExists):
(WebPushD::webClipIdentifierForOrigin):
(WebPushD::WebClipCache::preferredWebClipIdentifier):
(WebPushD::loadWebClipCachePropertyList):
(WebPushD::WebClipCache::load):
(WebPushD::WebClipCache::persist):
(WebPushD::WebClipCache::visibleWebClipIdentifiers):
(WebPushD::WebClipCache::isWebClipVisible):
* Source/WebKit/webpushd/WebPushDaemon.h:
* Source/WebKit/webpushd/WebPushDaemon.mm:
(getAllowedBundleIdentifiers):
(getAllowedBundleIdentifier):
(WebPushD::WebPushDaemon::startMockPushService):
(WebPushD::WebPushDaemon::startPushService):
(WebPushD::WebPushDaemon::ensureWebClipCache):
(WebPushD::WebPushDaemon::connectionEventHandler):
(WebPushD::WebPushDaemon::updateSubscriptionSetState):
(WebPushD::WebPushDaemon::handleIncomingPush):
(WebPushD::WebPushDaemon::showNotification):
(getInstalledWebClipIdentifiers): Deleted.
(webClipExists): Deleted.
(WebPushD::platformNotificationSourceForDisplay): Deleted.
* Source/WebKit/webpushd/WebPushDaemonMain.mm:
(WebKit::WebPushDaemonMain):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to