[webkit-reviews] review granted: [Bug 78783] Bring notifications support to WK1 mac : [Attachment 128042] Bring notifications support to WK1 mac: showing, canceling, removing notifications

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 21 14:17:00 PST 2012


Anders Carlsson <andersca at apple.com> has granted Jon Lee <jonlee at apple.com>'s
request for review:
Bug 78783: Bring notifications support to WK1 mac
https://bugs.webkit.org/show_bug.cgi?id=78783

Attachment 128042: Bring notifications support to WK1 mac: showing, canceling,
removing notifications
https://bugs.webkit.org/attachment.cgi?id=128042&action=review

------- Additional Comments from Anders Carlsson <andersca at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=128042&action=review


> Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm:73
> +    NotificationContextMap::iterator it =
m_notificationContextMap.find(notification->scriptExecutionContext());
> +    if (it == m_notificationContextMap.end()) {
> +	   pair<NotificationContextMap::iterator, bool> addedPair =
m_notificationContextMap.add(notification->scriptExecutionContext(),
Vector<RetainPtr<WebNotification> >());
> +	   it = addedPair.first;
> +    }
> +    it->second.append(webNotification);

I think you can simplify this to always call add:

NotificationContextMap::iterator it =
m_notificationContextMap.add(notification->scriptExecutionContext(),
Vector<RetainPtr<WebNotification> >()).first();
addedPair.append(webNotification);

> Source/WebKit/mac/WebView/WebNotification.mm:73
> +- (id)init

Please add an extra newline before the method definition.


More information about the webkit-reviews mailing list