Bug 145310

Summary: [CG] Regression(r78652): Partially decoded images are not properly removed from MemoryCache when pruning
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, kling, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=53281
Attachments:
Description Flags
Patch none

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]
Patch
Comment 2 WebKit Commit Bot 2015-05-22 13:48:05 PDT
Comment on attachment 253597 [details]
Patch

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.