[webkit-reviews] review denied: [Bug 79636] Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl : [Attachment 131011] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 9 09:39:38 PST 2012


Adam Barth <abarth at webkit.org> has denied Kentaro Hara <haraken at chromium.org>'s
request for review:
Bug 79636: Move Notifications APIs from DOMWindow.idl to
DOMWindowNotifications.idl
https://bugs.webkit.org/show_bug.cgi?id=79636

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

------- Additional Comments from Adam Barth <abarth at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=131011&action=review


> Source/WebCore/notifications/NotificationCenter.cpp:69
>  NotificationCenter::NotificationCenter(ScriptExecutionContext* context,
NotificationPresenter* presenter)
>      : ActiveDOMObject(context, this)
> -    , m_notificationPresenter(presenter) {}
> +    , DOMWindowProperty(0)

An object shouldn't need to be both an ActiveDOMObject and a DOMWindowProperty.
 ActiveDOMObject is needed when the object uses a ScriptExecutionContext as a
context object and DOMWindowProperty is needed when using a Frame as a context
object.

> Source/WebCore/notifications/NotificationCenter.h:54
> -class NotificationCenter : public RefCounted<NotificationCenter>, public
ActiveDOMObject {
> +class NotificationCenter : public RefCounted<NotificationCenter>, public
ActiveDOMObject, public Supplement<ScriptExecutionContext>, public
DOMWindowProperty {

This can't be right.  Being RefCounted is incompatible with being a Supplement.
 Supplement uses OwnPtr and RefCounted uses RefPtr.

Take a look at how Geolocation solves these problems.  The pattern we've been
using is for DOMWindowNotifications to be an OwnPtr'd object (i.e., a
Supplement<DOMWindow>) that holds a RefPtr to NotificationCenter.


More information about the webkit-reviews mailing list