Changeset 61316 in webkit


Ignore:
Timestamp:
Jun 17, 2010 2:29:23 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-17 John Gregg <johnnyg@google.com>

Reviewed by David Levin.

Move the call to the notification presenter that a Notification is being
destroyed from the destructor (not safe) to the ActiveDOMObject::contextDestroyed
method.

Also fix up an incorrect reference loss in the V8 bindings code for Notifications.
https://bugs.webkit.org/show_bug.cgi?id=40097

No new tests; code paths are well-covered by existing tests.

  • bindings/v8/custom/V8NotificationCenterCustom.cpp: (WebCore::V8NotificationCenter::createHTMLNotificationCallback): (WebCore::V8NotificationCenter::createNotificationCallback):
  • notifications/Notification.cpp: (WebCore::Notification::~Notification): (WebCore::Notification::contextDestroyed):
  • notifications/Notification.h:

2010-06-17 John Gregg <johnnyg@google.com>

Reviewed by David Levin.

Undo the build fix with the correct patch: Chromium NotificationPresenter
is now informed of the destruction before it actually happens, so this
use of the Notification object is correct.
https://bugs.webkit.org/show_bug.cgi?id=40097

  • src/NotificationPresenterImpl.cpp: (WebKit::NotificationPresenterImpl::notificationObjectDestroyed):
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r61315 r61316  
     12010-06-17  John Gregg  <johnnyg@google.com>
     2
     3        Reviewed by David Levin.
     4
     5        Move the call to the notification presenter that a Notification is being
     6        destroyed from the destructor (not safe) to the ActiveDOMObject::contextDestroyed
     7        method.
     8
     9        Also fix up an incorrect reference loss in the V8 bindings code for Notifications.
     10        https://bugs.webkit.org/show_bug.cgi?id=40097
     11
     12        No new tests; code paths are well-covered by existing tests.
     13
     14        * bindings/v8/custom/V8NotificationCenterCustom.cpp:
     15        (WebCore::V8NotificationCenter::createHTMLNotificationCallback):
     16        (WebCore::V8NotificationCenter::createNotificationCallback):
     17        * notifications/Notification.cpp:
     18        (WebCore::Notification::~Notification):
     19        (WebCore::Notification::contextDestroyed):
     20        * notifications/Notification.h:
     21
    1222010-06-17  Csaba Osztrogonác  <ossy@webkit.org>
    223
  • trunk/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp

    r60330 r61316  
    5959        return throwError(ec);
    6060
     61    notification->ref();
    6162    return toV8(notification.get());
    6263}
     
    7374        return throwError(ec);
    7475
     76    notification->ref();
    7577    return toV8(notification.get());
    7678}
  • trunk/WebCore/notifications/Notification.cpp

    r61121 r61316  
    9191        cancel();
    9292    }
    93     if (m_presenter)
    94         m_presenter->notificationObjectDestroyed(this);
    9593}
    9694
     
    141139}
    142140
     141void Notification::contextDestroyed()
     142{
     143    ActiveDOMObject::contextDestroyed();
     144    if (m_presenter)
     145        m_presenter->notificationObjectDestroyed(this);
     146}
    143147
    144148void Notification::startLoading()
  • trunk/WebCore/notifications/Notification.h

    r61121 r61316  
    8888        virtual Notification* toNotification() { return this; }
    8989
     90        // ActiveDOMObject interface
     91        virtual void contextDestroyed();
     92
    9093        void stopLoading();
    9194
  • trunk/WebKit/chromium/ChangeLog

    r61299 r61316  
     12010-06-17  John Gregg  <johnnyg@google.com>
     2
     3        Reviewed by David Levin.
     4
     5        Undo the build fix with the correct patch: Chromium NotificationPresenter
     6        is now informed of the destruction before it actually happens, so this
     7        use of the Notification object is correct.
     8        https://bugs.webkit.org/show_bug.cgi?id=40097
     9
     10        * src/NotificationPresenterImpl.cpp:
     11        (WebKit::NotificationPresenterImpl::notificationObjectDestroyed):
     12
    1132010-06-16  Kent Tamura  <tkent@chromium.org>
    214
  • trunk/WebKit/chromium/src/NotificationPresenterImpl.cpp

    r60590 r61316  
    8989void NotificationPresenterImpl::notificationObjectDestroyed(Notification* notification)
    9090{
    91     // TODO(pkasting): We cannot ref an object that's being destroyed.  Either
    92     // this function needs to be called earlier than in ~Notification(), or it
    93     // needs to not ref this object.
    94     //m_presenter->objectDestroyed(PassRefPtr<Notification>(notification));
     91    m_presenter->objectDestroyed(PassRefPtr<Notification>(notification));
    9592}
    9693
Note: See TracChangeset for help on using the changeset viewer.