[webkit-reviews] review requested: [Bug 23865] Safari can be frozen by rapidly adding timers : [Attachment 27585] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 11 19:30:13 PST 2009


Dmitry Titov <dimich at chromium.org> has asked  for review:
Bug 23865: Safari can be frozen by rapidly adding timers
https://bugs.webkit.org/show_bug.cgi?id=23865

Attachment 27585: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=27585&action=review

------- Additional Comments from Dmitry Titov <dimich at chromium.org>
This patch fires timers one by one, measuring elapsed time. If too much time
elapses, it quits firing loop and reschedules. This allows thread run loop to
run. Using the JS in description, it now does not freeze UI.

However, if the script continues to run, the timer heap grows. If run for long
time, one of 2 will happen:

- user closes the tab and we freeze UI for a while removing millions of timers
from timer heap
- OOM and crash

Do we need a variant of "Slow Script" dialog in case the page tries to create
too many outstanding timers?


More information about the webkit-reviews mailing list