RESOLVED FIXED 80485
Migrate permission functions to Notification from NotificationCenter
https://bugs.webkit.org/show_bug.cgi?id=80485
Summary Migrate permission functions to Notification from NotificationCenter
Jon Lee
Reported 2012-03-06 21:41:37 PST
1. Move NotificationCenter.checkPermission() to Notification.permissionLevel(). Update to return string instead of enum. 2. Move NotificationCenter.requestPermission() to Notification.requestPermission. <rdar://problem/10965458>
Attachments
Patch (47.06 KB, patch)
2012-03-09 12:18 PST, Jon Lee
no flags
Patch (47.09 KB, patch)
2012-03-09 13:00 PST, Jon Lee
no flags
Patch (50.29 KB, patch)
2012-03-09 14:22 PST, Jon Lee
no flags
Patch (56.90 KB, patch)
2012-03-09 22:50 PST, Jon Lee
no flags
Patch (56.83 KB, patch)
2012-03-09 23:01 PST, Jon Lee
no flags
Patch (57.42 KB, patch)
2012-03-09 23:27 PST, Jon Lee
no flags
Patch (59.50 KB, patch)
2012-03-10 00:36 PST, Jon Lee
no flags
Patch (60.17 KB, patch)
2012-03-10 01:01 PST, Jon Lee
no flags
Patch (60.18 KB, patch)
2012-03-10 12:44 PST, Jon Lee
no flags
Patch (60.89 KB, patch)
2012-03-10 13:11 PST, Jon Lee
no flags
Patch (60.91 KB, patch)
2012-03-10 13:51 PST, Jon Lee
no flags
Patch (61.66 KB, patch)
2012-03-16 00:58 PDT, Jon Lee
no flags
Patch (63.17 KB, patch)
2012-04-27 02:14 PDT, Jon Lee
no flags
Patch (69.55 KB, patch)
2012-04-27 23:40 PDT, Jon Lee
no flags
Patch (69.67 KB, patch)
2012-04-28 13:00 PDT, Jon Lee
no flags
Patch (69.69 KB, patch)
2012-04-28 13:41 PDT, Jon Lee
jianli: review+
Jon Lee
Comment 1 2012-03-09 12:18:24 PST
Early Warning System Bot
Comment 2 2012-03-09 12:53:36 PST
Early Warning System Bot
Comment 3 2012-03-09 12:58:52 PST
Jon Lee
Comment 4 2012-03-09 13:00:47 PST
Early Warning System Bot
Comment 5 2012-03-09 14:05:10 PST
Early Warning System Bot
Comment 6 2012-03-09 14:14:11 PST
Jon Lee
Comment 7 2012-03-09 14:22:45 PST
Early Warning System Bot
Comment 8 2012-03-09 15:30:18 PST
Early Warning System Bot
Comment 9 2012-03-09 16:25:56 PST
WebKit Review Bot
Comment 10 2012-03-09 16:48:23 PST
Comment on attachment 131109 [details] Patch Attachment 131109 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11906808
Gyuyoung Kim
Comment 11 2012-03-09 17:39:45 PST
Jon Lee
Comment 12 2012-03-09 22:50:33 PST
Jon Lee
Comment 13 2012-03-09 23:01:25 PST
Early Warning System Bot
Comment 14 2012-03-09 23:20:09 PST
WebKit Review Bot
Comment 15 2012-03-09 23:22:16 PST
Comment on attachment 131156 [details] Patch Attachment 131156 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11915944
Early Warning System Bot
Comment 16 2012-03-09 23:22:43 PST
Jon Lee
Comment 17 2012-03-09 23:27:35 PST
WebKit Review Bot
Comment 18 2012-03-09 23:43:50 PST
Comment on attachment 131157 [details] Patch Attachment 131157 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11906994
Gyuyoung Kim
Comment 19 2012-03-09 23:49:51 PST
Jon Lee
Comment 20 2012-03-10 00:36:11 PST
WebKit Review Bot
Comment 21 2012-03-10 00:52:50 PST
Comment on attachment 131163 [details] Patch Attachment 131163 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11937011
Jon Lee
Comment 22 2012-03-10 01:01:01 PST
WebKit Review Bot
Comment 23 2012-03-10 01:15:58 PST
Comment on attachment 131164 [details] Patch Attachment 131164 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11931019
Gyuyoung Kim
Comment 24 2012-03-10 01:28:31 PST
Jon Lee
Comment 25 2012-03-10 12:44:05 PST
Jon Lee
Comment 26 2012-03-10 13:11:32 PST
WebKit Review Bot
Comment 27 2012-03-10 13:33:45 PST
Comment on attachment 131185 [details] Patch Attachment 131185 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11934231
Jon Lee
Comment 28 2012-03-10 13:51:23 PST
Jon Lee
Comment 29 2012-03-10 15:44:42 PST
Comment on attachment 131189 [details] Patch This is pending discussion in the WG. Removing r? for now.
Jon Lee
Comment 30 2012-03-16 00:58:41 PDT
WebKit Review Bot
Comment 31 2012-03-16 01:23:37 PDT
Comment on attachment 132223 [details] Patch Attachment 132223 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11960274
Build Bot
Comment 32 2012-03-16 02:21:36 PDT
WebKit Review Bot
Comment 33 2012-03-16 02:33:16 PDT
Comment on attachment 132223 [details] Patch Attachment 132223 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11964100
WebKit Review Bot
Comment 34 2012-03-16 03:45:54 PDT
Comment on attachment 132223 [details] Patch Attachment 132223 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11965113
WebKit Review Bot
Comment 35 2012-03-16 04:57:18 PDT
Comment on attachment 132223 [details] Patch Attachment 132223 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11962226
WebKit Review Bot
Comment 36 2012-03-16 05:52:55 PDT
Comment on attachment 132223 [details] Patch Attachment 132223 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11968036
Jon Lee
Comment 37 2012-04-27 02:14:49 PDT
Early Warning System Bot
Comment 38 2012-04-27 02:33:29 PDT
Early Warning System Bot
Comment 39 2012-04-27 02:41:49 PDT
Jon Lee
Comment 40 2012-04-27 23:40:16 PDT
Jon Lee
Comment 41 2012-04-28 13:00:29 PDT
WebKit Review Bot
Comment 42 2012-04-28 13:28:35 PDT
Comment on attachment 139370 [details] Patch Attachment 139370 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12555707
Jon Lee
Comment 43 2012-04-28 13:41:51 PDT
Jian Li
Comment 44 2012-04-30 13:03:26 PDT
Comment on attachment 139372 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=139372&action=review > Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp:42 > + ScriptExecutionContext* context = notification->scriptExecutionContext(); Better to move these 2 lines just before its 1st access. > Source/WebCore/notifications/Notification.cpp:254 > +#if ENABLE(NOTIFICATIONS) Can you wrap all 3 new methods and existing method taskTimerFired in one single #if guard? > Source/WebCore/notifications/Notification.h:142 > + static const String& stringForPermission(NotificationClient::Permission); Please add const modifier. In addition, it might be simpler to call it permissionString. > Source/WebCore/notifications/NotificationCenter.idl:46 > +#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS It seems that all methods exposed in NotificationCenter interface are wrapped inside ENABLE_LEGACY_NOTIFICATIONS. Do we also want to put NotificationCenter under ENABLE_LEGACY_NOTIFICATIONS? > Source/WebKit/chromium/src/NotificationPresenterImpl.h:63 > + virtual void requestPermission(WebCore::ScriptExecutionContext* , WTF::PassRefPtr<WebCore::NotificationPermissionCallback> callback) { } Extra space after "*". > Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm:170 > +void WebNotificationClient::requestPermission(ScriptExecutionContext* context, WebNotificationPolicyListener *listener) Space should be placed after "*".
Jon Lee
Comment 45 2012-04-30 13:41:14 PDT
(In reply to comment #44) > (From update of attachment 139372 [details]) > > Source/WebCore/notifications/Notification.h:142 > > + static const String& stringForPermission(NotificationClient::Permission); > > Please add const modifier. In addition, it might be simpler to call it permissionString. I don't think you can have const static functions, can you? Otherwise, thanks for the other feedback, I'll incorporate that into the checked-in patch.
Jon Lee
Comment 46 2012-05-03 00:05:53 PDT
Andrey Kosyakov
Comment 48 2012-05-03 05:43:41 PDT
Note You need to log in before you can comment on or make changes to this bug.