Bug 145310 - [CG] Regression(r78652): Partially decoded images are not properly removed from MemoryCache when pruning
Summary: [CG] Regression(r78652): Partially decoded images are not properly removed fr...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
Depends on:
Reported: 2015-05-22 10:41 PDT by Chris Dumez
Modified: 2015-05-22 13:48 PDT (History)
3 users (show)

See Also:

Patch (5.51 KB, patch)
2015-05-22 11:54 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-05-22 10:41:20 PDT
r78652 added partially decoded images to the MemoryCache's list of live decoded resources so that they can be pruned on memory pressure. This was needed because CG decodes part of the image to determine its properties (e.g. size). On memory pressure, we call BitmapImage::destroyDecodedData() which clears the ImageSource and frees up this extra decoded data.

However, we currently fail to remove such partially decoded images from the MemoryCache's list of live resources when pruning. This is because BitmapImage::destroyMetadataAndNotify() fails to take into account the decoded properties size when no frames have been cleared. We thus fail to detect a decoded size change and do not call CachedImage::decodedSizeChanged(). As a result, the CachedImage's decoded size is not reset to 0 and we don't remove it from live decoded resources.
Comment 1 Chris Dumez 2015-05-22 11:54:07 PDT
Created attachment 253597 [details]
Comment 2 WebKit Commit Bot 2015-05-22 13:48:05 PDT
Comment on attachment 253597 [details]

Clearing flags on attachment: 253597

Committed r184793: <http://trac.webkit.org/changeset/184793>
Comment 3 WebKit Commit Bot 2015-05-22 13:48:10 PDT
All reviewed patches have been landed.  Closing bug.