Bug 73253 - Create skeleton framework for notifications support in WK2
Summary: Create skeleton framework for notifications support in WK2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jon Lee
URL:
Keywords:
: 72743 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-28 14:39 PST by Jon Lee
Modified: 2011-12-08 19:22 PST (History)
7 users (show)

See Also:


Attachments
Patch (155.69 KB, patch)
2011-11-28 15:18 PST, Jon Lee
no flags Details | Formatted Diff | Diff
Patch (159.62 KB, patch)
2011-11-28 15:58 PST, Jon Lee
no flags Details | Formatted Diff | Diff
Fix merge issues for EWS (159.53 KB, patch)
2011-11-28 16:11 PST, Jon Lee
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Lee 2011-11-28 14:39:18 PST
This represents part 1 of bringing WK2 support of notifications. Basic showing and canceling of notifications, with no tracking, as well as exposing relevant classes as WK API.
Comment 1 Jon Lee 2011-11-28 15:18:55 PST
Created attachment 116838 [details]
Patch
Comment 2 Sam Weinig 2011-11-28 15:29:23 PST
Comment on attachment 116838 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116838&action=review

> Source/WebCore/notifications/NotificationController.cpp:38
> +: m_page(page)
> +, m_client(client)
> +{

Indent please.

> Source/WebKit2/Shared/UserMessageCoders.h:183
> +        case APIObject::TypeNotification: {
> +            WebNotification* notification = static_cast<WebNotification*>(m_root);
> +            encoder->encode(notification->title());
> +            encoder->encode(notification->body());
> +            return true;
> +        }

I don't think you need to make WebNotifications user encodable.

> Source/WebKit2/Shared/WebNotification.h:43
> +class WebNotification : public APIObject {
> +public:

Since this will probably only bne used from the UIProcess, you can put this in that directory, instead of shared.

> Source/WebKit2/UIProcess/API/C/WKNotification.cpp:31
> +#include "WebNotificationManagerProxy.h"

This doesn't seem to be used.

> Source/WebKit2/UIProcess/API/C/WKNotification.h:38
> +WK_EXPORT WKStringRef WKNotificationCopyTitle(WKNotificationRef);
> +WK_EXPORT WKStringRef WKNotificationCopyBody(WKNotificationRef);

We usually put parameter names in API headers.

> Source/WebKit2/UIProcess/API/C/WKNotificationManager.h:37
> +WK_EXPORT void WKNotificationManagerSetProvider(WKNotificationManagerRef, const WKNotificationProvider*);

We usually put parameter names in API headers.

> Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h:36
> +typedef void (*WKNotificationProviderShowCallback)(WKNotificationRef, const void* clientInfo);
> +typedef void (*WKNotificationProviderCancelCallback)(WKNotificationRef, const void* clientInfo);

We usually put parameter names in API headers.

> Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h:42
> +    int version;
> +    const void* clientInfo;
> +    WKNotificationProviderShowCallback show;
> +    WKNotificationProviderCancelCallback cancel;

We usually align the struct member names.

> Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp:36
> +#if ENABLE(NOTIFICATIONS)
> +#include "WebNotificationManagerProxyMessages.h"
> +#endif
> +#include "WebPage.h"
> +#include "WebProcess.h"
> +#if ENABLE(NOTIFICATIONS)
> +#include <WebCore/Notification.h>
> +#endif

Please group the ENABLE(NOTIFICATIONS) together.

> Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp:44
> +{ }

Two lines.
Comment 3 Jon Lee 2011-11-28 15:58:06 PST
Created attachment 116843 [details]
Patch
Comment 4 Jon Lee 2011-11-28 16:11:14 PST
Created attachment 116848 [details]
Fix merge issues for EWS
Comment 5 Sam Weinig 2011-11-28 16:54:28 PST
Comment on attachment 116848 [details]
Fix merge issues for EWS

View in context: https://bugs.webkit.org/attachment.cgi?id=116848&action=review

> Source/WebKit2/Shared/WebCoreArgumentCoders.h:47
> +    class Notification;

Seems unused.
Comment 6 Jon Lee 2011-11-28 17:08:55 PST
Committed r101307: <http://trac.webkit.org/changeset/101307>
Comment 7 Jon Lee 2011-11-28 17:32:12 PST
*** Bug 72743 has been marked as a duplicate of this bug. ***
Comment 8 Zhenyao Mo 2011-11-28 18:04:57 PST
fast/notifications/notification-after-close.html
fast/notifications/notifications-check-permission.html
fast/notifications/notifications-click-event.html
fast/notifications/notifications-display-close-events.html
fast/notifications/notifications-double-show.html
fast/notifications/notifications-no-icon.html
fast/notifications/notifications-replace.html
fast/notifications/notifications-request-permission.html
fast/notifications/notifications-rtl.html
fast/notifications/notifications-with-permission.html
fast/notifications/notifications-without-permission.html

11 tests crashing in chromium linux (not sure about mac and win yet)

I am going to clobber a linux bot and do a clean build/run.  if it's still crashing, I'll have to revert this patch...