Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7f0adb9a948d4da14ee28010d3da9428de203961
      
https://github.com/WebKit/WebKit/commit/7f0adb9a948d4da14ee28010d3da9428de203961
  Author: Ben Nham <n...@apple.com>
  Date:   2024-08-11 (Sun, 11 Aug 2024)
  Changed paths:
    M Source/WebKit/webpushd/WebPushDaemon.mm
    M Source/WebKit/webpushd/_WKMockUserNotificationCenter.mm

  Log Message:
  -----------
  Fix thread safety issues in WebPushDaemon
https://bugs.webkit.org/show_bug.cgi?id=277866
rdar://133553571

Reviewed by Brady Eidson.

UNUserNotificationCenter calls its completion handler on background threads, 
but WebPushDaemon is
expecting them to run on the main thread. Add main thread dispatches where 
necessary. Change the
mock version of the class to also call back on background threads and add an 
assert to catch these
issues in the future.

* Source/WebKit/webpushd/WebPushDaemon.mm:
(WebPushD::WebPushDaemon::connectionEventHandler):
(WebPushD::WebPushDaemon::getNotifications):
(WebPushD::WebPushDaemon::getPushPermissionState):
(WebPushD::WebPushDaemon::requestPushPermission):
(WebPushD::WebPushDaemon::setAppBadge):
* Source/WebKit/webpushd/_WKMockUserNotificationCenter.mm:
(-[_WKMockUserNotificationCenter _internalInitWithBundleIdentifier:]):
(-[_WKMockUserNotificationCenter 
addNotificationRequest:withCompletionHandler:]):
(-[_WKMockUserNotificationCenter 
getDeliveredNotificationsWithCompletionHandler:]):
(-[_WKMockUserNotificationCenter 
getNotificationSettingsWithCompletionHandler:]):
(-[_WKMockUserNotificationCenter 
requestAuthorizationWithOptions:completionHandler:]):
(-[_WKMockUserNotificationCenter notificationSettings]):

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



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

Reply via email to