Bring Notification.idl up to spec
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 May 2017 03:22:38 +0000 (03:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 May 2017 03:22:38 +0000 (03:22 +0000)
commit19e8478adadadc0323ffa7649e6367343b78dc3c
tree4ed27d2f86e729112e4ed42963ca26a2fc31e020
parent205c25da14bb12830f472193caa7754560c1245b
Bring Notification.idl up to spec
https://bugs.webkit.org/show_bug.cgi?id=172156

Patch by Sam Weinig <sam@webkit.org> on 2017-05-16
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/notifications/notification.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* Modules/notifications/Notification.cpp:
(WebCore::Notification::create):
(WebCore::Notification::Notification):
(WebCore::Notification::show):
(WebCore::directionString): Deleted.
(WebCore::Notification::permission): Deleted.
(WebCore::Notification::permissionString): Deleted.
* Modules/notifications/Notification.h:
* Modules/notifications/Notification.idl:
* Modules/notifications/NotificationClient.h:
* Modules/notifications/NotificationDirection.h: Added.
* Modules/notifications/NotificationPermission.h: Added.
* Modules/notifications/NotificationPermission.idl: Added.
* Modules/notifications/NotificationPermissionCallback.h:
* Modules/notifications/NotificationPermissionCallback.idl:
Bring up to spec, replacing DOMStrings with enums where appropriate and adding
additional readonly properties to Notification to mirror options provided
in construction.

Source/WebKit/mac:

* WebCoreSupport/WebNotificationClient.h:
* WebCoreSupport/WebNotificationClient.mm:
(generateNotificationID):
(WebNotificationClient::show):
(WebNotificationClient::cancel):
(WebNotificationClient::clearNotifications):
(WebNotificationClient::notificationObjectDestroyed):
(WebNotificationClient::requestPermission):
(WebNotificationClient::hasPendingPermissionRequests):
(WebNotificationClient::checkPermission):
(-[WebNotificationPolicyListener allow]):
(-[WebNotificationPolicyListener deny]):
* WebView/WebNotification.mm:
(-[WebNotification iconURL]):
(-[WebNotification dir]):
Simplify #ifdefs and update for enum vs String usage.

Source/WebKit2:

* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/C/WKNotification.cpp:
(WKNotificationCopyDir):
* UIProcess/Notifications/WebNotification.cpp:
(WebKit::WebNotification::WebNotification):
* UIProcess/Notifications/WebNotification.h:
(WebKit::WebNotification::create):
(WebKit::WebNotification::dir):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::show):
* UIProcess/Notifications/WebNotificationManagerProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showNotification):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
(WebKit::NotificationPermissionRequestManager::startRequest):
(WebKit::NotificationPermissionRequestManager::permissionLevel):
(WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::policyForOrigin):
(WebKit::WebNotificationManager::show):
* WebProcess/WebCoreSupport/WebNotificationClient.cpp:
(WebKit::WebNotificationClient::checkPermission):
* WebProcess/WebCoreSupport/WebNotificationClient.h:
Update for enum vs String usage.

LayoutTests:

* http/tests/notifications/notification-expected.txt: Added.
* http/tests/notifications/notification.html: Added.
Add test for basic Notification API functionality.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/notifications/notification-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/notifications/notification.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/Modules/notifications/Notification.idl
Source/WebCore/Modules/notifications/NotificationClient.h
Source/WebCore/Modules/notifications/NotificationDirection.h [new file with mode: 0644]
Source/WebCore/Modules/notifications/NotificationPermission.h [new file with mode: 0644]
Source/WebCore/Modules/notifications/NotificationPermission.idl [new file with mode: 0644]
Source/WebCore/Modules/notifications/NotificationPermissionCallback.h
Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm
Source/WebKit/mac/WebView/WebNotification.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebCoreArgumentCoders.h
Source/WebKit2/UIProcess/API/C/WKNotification.cpp
Source/WebKit2/UIProcess/Notifications/WebNotification.cpp
Source/WebKit2/UIProcess/Notifications/WebNotification.h
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h