Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Issue 10880033: Don't overwrit image data case entries that are just marked usable. (Closed)

Created:
8 years, 4 months ago by brettw
Modified:
8 years, 4 months ago
Reviewers:
yzshen1
CC:
chromium-reviews
Visibility:
Public.

Description

Improve 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 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -23 lines) Patch
M ppapi/proxy/ppb_graphics_2d_proxy.cc View 1 2 2 chunks +10 lines, -4 lines 0 comments Download
M ppapi/proxy/ppb_image_data_proxy.h View 1 2 2 chunks +9 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_image_data_proxy.cc View 1 2 3 9 chunks +41 lines, -17 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
brettw
8 years, 4 months ago (2012-08-23 22:42:27 UTC) #1
brettw
New patch uploaded.
8 years, 4 months ago (2012-08-24 18:02:49 UTC) #2
yzshen1
8 years, 4 months ago (2012-08-24 18:30:41 UTC) #3
lgtm

Powered by Google App Engine
This is Rietveld 408576698