[Webkit-unassigned] [Bug 23025] New: Simplifying DOMTimer lifetime management code

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 29 14:22:02 PST 2008


https://bugs.webkit.org/show_bug.cgi?id=23025

           Summary: Simplifying DOMTimer lifetime management code
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dimich at chromium.org
                CC: darin at apple.com, ap at webkit.org


Following IRC discussion...

DOMTimer lifetime is a bit confusing - it is created from DOMTimer::install()
but then destroyed sometimes by direct 'delete' (when Document is destroyed)
and sometimes as a side-effect (in Document::removeTimeout which should only
remove an ID from the Document's timeout map).

Proposed change makes this code a bit more straightforward. The timeoutMap
methods on the Document now do not delete the timers, they only add/remove/find
timers in the map.
The timers are added to the map in their constructor and removed from the map
in their destructor, so consistency is guaranteed.
Timers are destroyed by directly calling 'delete' in 3 places:
- when Document is destroyed while timers are still alive, in
DOMTimer::contextDestroyed()
- when single-shot timer fired, in DOMTimer::fired()
- when JS calls clearTimer, in DOMTimer::removeById()


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list