[webkit-reviews] review granted: [Bug 73572] [WK2] Add further support for notifications : [Attachment 117534] Patch #3

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 1 18:00:44 PST 2011


Darin Adler <darin at apple.com> has granted Jon Lee <jonlee at apple.com>'s request
for review:
Bug 73572: [WK2] Add further support for notifications
https://bugs.webkit.org/show_bug.cgi?id=73572

Attachment 117534: Patch #3
https://bugs.webkit.org/attachment.cgi?id=117534&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=117534&action=review


> Source/WebKit2/UIProcess/WebNotification.h:75
> +inline bool isNotificationIDValid(uint64_t id)
> +{
> +    return id && id != static_cast<uint64_t>(-1);
> +}

Would be nice to have a rationale comment explaining why these two values are
invalid.

> Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp:46
> +    while (!isNotificationIDValid(uniqueNotificationID))
> +	   ++uniqueNotificationID;

This is dead code. You should remove it. There’s literally no chance we will
ever count from 1 all the way up to 2^64. And I don’t think we need to pretend
that the isNotificationIDValid function is a secret abstraction. This is
literally untestable code that will never do anything!

> Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp:82
> +    uint64_t notificationID = m_notificationMap.get(notification);
> +    if (!notificationID)
> +	   return;

Can this function be passed a null pointer? If so you need a check for that.

> Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp:93
> +    uint64_t notificationID = m_notificationMap.take(notification);
> +    if (!notificationID)
> +	   return;

Can this function be passed a null pointer? If so you need a check for that.


More information about the webkit-reviews mailing list