RESOLVED FIXED 99990
sCurrentPaintTimeStamp is not initialized when FrameView::paintContents returns in the middle
https://bugs.webkit.org/show_bug.cgi?id=99990
Summary sCurrentPaintTimeStamp is not initialized when FrameView::paintContents retur...
KyungTae Kim
Reported 2012-10-22 06:16:58 PDT
If it is TopLevelPainter, sCurrentPaintTimeStamp is set as currentTime() in the top of FrameView::paintContents, and is reset as 0 in the bottom of the same function. But, when the FrameView::paintContents returns in the middle, it is not reset as 0, and the value will be not updated anymore. That value is used for MemoryCache and there was a bug that the MemoryCache is not pruned because that value is not reset.
Attachments
Patch (1.61 KB, patch)
2012-10-22 16:14 PDT, KyungTae Kim
no flags
Patch (1.85 KB, patch)
2012-11-01 01:40 PDT, KyungTae Kim
no flags
KyungTae Kim
Comment 1 2012-10-22 16:14:07 PDT
Darin Adler
Comment 2 2012-10-22 18:22:05 PDT
Comment on attachment 170014 [details] Patch (Not your fault, but why is sCurrentPaintTimeStamp a time instead of just a boolean?) Seems to me that a better fix is to set up isTopLevelPainter after the early returns, rather than adding these two new exit sequences.
KyungTae Kim
Comment 3 2012-10-22 18:37:33 PDT
For example, sCurrentPaintTimeStamp is referenced with currentPaintTimeStamp() in MemoryCache::::pruneLiveResourcesToSize to measure elapsedTime. void MemoryCache::pruneLiveResourcesToSize(unsigned targetSize) { double currentTime = FrameView::currentPaintTimeStamp(); ... double elapsedTime = currentTime - current->m_lastDecodedAccessTime; if (elapsedTime < cMinDelayBeforeLiveDecodedPrune) return; current->destroyDecodedData(); So, this value need to be a time, and this value should not be initialized before the paintContents is exited. (because it can be accessed by other functions during painting) I considered using some constructor/destructor for initializing it automatically on exit, but It will become too complex.
KyungTae Kim
Comment 4 2012-11-01 01:40:08 PDT
WebKit Review Bot
Comment 5 2012-11-02 23:29:48 PDT
Comment on attachment 171793 [details] Patch Clearing flags on attachment: 171793 Committed r133391: <http://trac.webkit.org/changeset/133391>
WebKit Review Bot
Comment 6 2012-11-02 23:29:53 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.