2009-01-02 Dmitry Titov <dimich@chromium.org>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Jan 2009 02:27:33 +0000 (02:27 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Jan 2009 02:27:33 +0000 (02:27 +0000)
commit1d9ca5404a175a8adfdccb8067822e641e0e520c
tree1c19c3ef84dc09c445a82ead27dedfe8edef7a0a
parentff91e16469c9bca4a4dc628e1325ee23bdf79881
2009-01-02  Dmitry Titov  <dimich@chromium.org>

        Reviewed and landed by Darin.

        https://bugs.webkit.org/show_bug.cgi?id=23025
        DOMTimer lifetime cleanup: timeoutMap methods on Document now do not delete the timer.
        Instead, all 3 places that delete timers do it directly calling 'delete' and then timer's dtor removes the ID from the timeoutMap.
        Note that in case the context is destroyed and timers are deleted at once, the check in ~DOMTimer() prevents
        unnecessary HashMap remove in case the Document is being destroyed.

        * bindings/js/DOMTimer.cpp:
        (WebCore::DOMTimer::~DOMTimer): removes the id from the timeoutMap.
        (WebCore::DOMTimer::install):
        (WebCore::DOMTimer::removeById): simply uses 'delete this'.
        (WebCore::DOMTimer::fired): same.
        (WebCore::DOMTimer::contextDestroyed): same.
        * dom/Document.cpp:
        (WebCore::Document::removeTimeout): now it only removes the id from the map, does not delete the timer.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/bindings/js/DOMTimer.cpp
WebCore/dom/Document.cpp