RESOLVED FIXED 91733
Destroy CSS decoded data more eagerly once they become dead caches.
https://bugs.webkit.org/show_bug.cgi?id=91733
Summary Destroy CSS decoded data more eagerly once they become dead caches.
Dongseong Hwang
Reported 2012-07-19 04:38:52 PDT
There are three CachedResources with decoded data: CachedImage, CachedScript and CachedCSSStyleSheet. In the cases of CachedImage and CachedScript, we eagerly destroy the decoded data using Timer in CacehdResource::allClientsRemoved(). We must apply the same policy here in CachedCSSStyleSheet because priority inversion can occur. For example, we can't destroy the decoded data of CachedImages when they are referenced by CachedCSSStyleSheet as background, mask or border images.
Attachments
Patch (4.89 KB, patch)
2012-07-19 04:40 PDT, Dongseong Hwang
no flags
Dongseong Hwang
Comment 1 2012-07-19 04:40:59 PDT
Dongseong Hwang
Comment 2 2012-07-19 04:45:12 PDT
Bug 22394 made CacheScript destroy script decoded data eagerly. Bug 22214 made the policy of CachedCSSStyleSheet::allClientsRemoved() and the policy continues to this day.
Geoffrey Garen
Comment 3 2012-07-19 11:08:21 PDT
Comment on attachment 153228 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153228&action=review > Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp:172 > + makePurgeable(true); Where is the makePurgeable(false) call to balance this? That's a good thing to comment on in your ChangeLog.
Dongseong Hwang
Comment 4 2012-07-22 19:05:13 PDT
(In reply to comment #3) > (From update of attachment 153228 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=153228&action=review > > > Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp:172 > > + makePurgeable(true); > > Where is the makePurgeable(false) call to balance this? That's a good thing to comment on in your ChangeLog. Thank you for your review. makePurgeable(false) is called by MemoryCache::resourceForURL() and DocumentLoader::subresource() like CachedImage and CachedScript. CachedImage and CachedScript call only makePurgeable(true) instead of makePurgeable(false), too. IMHO, "makePurgeable(false) call" may be not related to this patch because the previous CachedCSSStyleSheet did not call makePurgeable(false) and CachedCSSStyleSheet of this patch does also.
Geoffrey Garen
Comment 5 2012-07-23 11:00:32 PDT
Comment on attachment 153228 [details] Patch In future, I'd like to see more code sharing for destroying decoded data on a timer.
Kwang Yul Seo
Comment 6 2012-07-23 14:38:21 PDT
Comment on attachment 153228 [details] Patch Clearing flags on attachment: 153228 Committed r123385: <http://trac.webkit.org/changeset/123385>
Kwang Yul Seo
Comment 7 2012-07-23 14:38:26 PDT
All reviewed patches have been landed. Closing bug.
Dongseong Hwang
Comment 8 2012-07-23 16:23:36 PDT
(In reply to comment #5) > (From update of attachment 153228 [details]) > In future, I'd like to see more code sharing for destroying decoded data on a timer. Thank you for your review. I think so. :)
Note You need to log in before you can comment on or make changes to this bug.