Chromium Code Reviews
DescriptionImprove the image data cache.
Adds a flag to ImageData in the plugin process for whether it's been used in
a ReplaceContents call and only attempt to cache image datas if this flag is
set. Since we only get the "usable" notifications from the renderer for the
ReplaceContents case, all other images can never be re-used so adding them is
a waste.
This also adds a check to avoid immediately overwriting an entry marked usable.
In practice, I don't think this will make a difference with the current code,
since the plugin won't do ReplaceContents faster than we'll get usable
notifications back from the renderer. However, the number of items in-flight
isn't guaranteed so it seems like this is a good margin of safety.
An alternative would have been to do a similar check when adding an entry, and
not replace one that's usable. However, if we make a new GraphicsContext with
a new size, this means that we'll never overwrite an "old"-sized image until
it times out and the cache won't work well. With the current code, it should
replace the old-sized usable entry after two frames instead:
BUG=142507
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=153267
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #
Messages
Total messages: 3 (0 generated)
|
|||||||||||||||||||||||||||||||||||||