[webkit-changes] [WebKit/WebKit] 504315: Parsed Declarative Web Push JSON should be remembe...

Brady Eidson noreply at github.com
Sat Sep 16 00:49:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5043150257293a0e89dd2166d45592e9ac1cc379
      https://github.com/WebKit/WebKit/commit/5043150257293a0e89dd2166d45592e9ac1cc379
  Author: Brady Eidson <beidson at apple.com>
  Date:   2023-09-16 (Sat, 16 Sep 2023)

  Changed paths:
    M Source/WebCore/Modules/notifications/NotificationDirection.h
    M Source/WebCore/Modules/notifications/NotificationJSONParser.cpp
    M Source/WebCore/Modules/notifications/NotificationJSONParser.h
    A Source/WebCore/Modules/notifications/NotificationOptionsPayload.h
    A Source/WebCore/Modules/notifications/NotificationOptionsPayloadCocoa.mm
    M Source/WebCore/Modules/notifications/NotificationPayload.h
    A Source/WebCore/Modules/notifications/NotificationPayloadCocoa.mm
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources.make
    M Source/WebKit/Platform/IPC/DaemonCoders.cpp
    M Source/WebKit/Platform/IPC/DaemonCoders.h
    M Source/WebKit/Scripts/generate-serializers.py
    M Source/WebKit/Shared/Cocoa/WebPushMessageCocoa.mm
    M Source/WebKit/Shared/PushMessageForTesting.h
    A Source/WebKit/Shared/PushMessageForTesting.serialization.in
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/Shared/WebPushMessage.h
    M Source/WebKit/Shared/WebPushMessage.serialization.in
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/webpushd/PushService.mm
    M Source/WebKit/webpushd/WebPushDaemon.h
    M Source/WebKit/webpushd/WebPushDaemon.mm
    M Source/WebKit/webpushd/webpushtool/WebPushToolMain.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm

  Log Message:
  -----------
  Parsed Declarative Web Push JSON should be remembered and round trip throughout various forms of IPC
https://bugs.webkit.org/show_bug.cgi?id=261632
rdar://115585968

Reviewed by Alex Christensen.

webpushd knows how to validate Declarative Notification JSON into a NotificationPayload

But now:
- Once validated, it saves the NotificationPayload into the push message that will be fetched by the client later
- NotificationPayload and related all know how to serialize, both in the CoreIPC sense and Obj-C SPI client sense
- Tests validate that all that serialization happens.

* Source/WebCore/Modules/notifications/NotificationDirection.h:
* Source/WebCore/Modules/notifications/NotificationJSONParser.cpp:
(WebCore::NotificationJSONParser::parseNotificationPayload):
(WebCore::NotificationJSONParser::parseNotificationOptions):
* Source/WebCore/Modules/notifications/NotificationJSONParser.h:
* Source/WebCore/Modules/notifications/NotificationOptionsPayload.h: Copied from Source/WebCore/Modules/notifications/NotificationPayload.h.
* Source/WebCore/Modules/notifications/NotificationOptionsPayloadCocoa.mm: Added.
(WebCore::NotificationOptionsPayload::fromDictionary):
(WebCore::NotificationOptionsPayload::dictionaryRepresentation const):
* Source/WebCore/Modules/notifications/NotificationPayload.h:
* Source/WebCore/Modules/notifications/NotificationPayloadCocoa.mm: Added.
(WebCore::NotificationPayload::fromDictionary):
(WebCore::NotificationPayload::dictionaryRepresentation const):
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/Platform/IPC/DaemonCoders.cpp:
* Source/WebKit/Platform/IPC/DaemonCoders.h:
(WebKit::Daemon::Coder<WebPushD::PushMessageForTesting>::encode): Deleted.
(WebKit::Daemon::Coder<WebPushD::PushMessageForTesting>::decode): Deleted.
* Source/WebKit/Scripts/generate-serializers.py:
(SerializedEnum.is_webkit_platform):
(generate_impl):
(parse_serialized_types):
* Source/WebKit/Shared/Cocoa/WebPushMessageCocoa.mm:
(WebKit::WebPushMessage::fromDictionary):
(WebKit::WebPushMessage::toDictionary const):
* Source/WebKit/Shared/PushMessageForTesting.h:
(WebKit::WebPushD::PushMessageForTesting::encode const): Deleted.
(WebKit::WebPushD::PushMessageForTesting::decode): Deleted.
* Source/WebKit/Shared/PushMessageForTesting.serialization.in: Copied from Source/WebKit/Shared/WebPushMessage.serialization.in.
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/Shared/WebPushMessage.h:
* Source/WebKit/Shared/WebPushMessage.serialization.in:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/webpushd/PushService.mm:
(WebPushD::PushService::didReceivePushMessage):
* Source/WebKit/webpushd/WebPushDaemon.h:
* Source/WebKit/webpushd/WebPushDaemon.mm:
(WebPushD::WebPushDaemon::injectPushMessageForTesting):
(WebPushD::WebPushDaemon::getPendingPushMessages):
* Source/WebKit/webpushd/webpushtool/WebPushToolMain.mm:
(pushMessageFromArguments):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

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




More information about the webkit-changes mailing list