From b221a221aa6bea441ef4a6735b8c51551a708c10 Mon Sep 17 00:00:00 2001 From: "enne@chromium.org" Date: Tue, 22 Jan 2013 21:38:56 +0000 Subject: cc: Update picture pile on tiles to prevent memory leak A given PicturePileImpl corresponds to a given main thread frame. It should go out of scope when that frame is no longer being used. Currently, as Tile holds a ref on PicturePileImpl, it won't go out of scope if the Tile persists, which could happen if the Tile never gets invalidated. To prevent this, the PicturePileImpl on each Tile is updated to the newest version of the PicturePileImpl when a tree is activated. This will allow old PicturePileImpls to be destroyed on a more regular basis. Raster jobs in flight hold their own ref to a per-thead clone of the PicturePileImpl, so this will not affect them. When the job finishes, the clone will also be destroyed. R=reveman@chromium.org BUG=171003 Review URL: https://chromiumcodereview.appspot.com/11953005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178106 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/tile.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cc/tile.h') diff --git a/cc/tile.h b/cc/tile.h index 7d41e6a..dcb24e0 100644 --- a/cc/tile.h +++ b/cc/tile.h @@ -54,6 +54,10 @@ class CC_EXPORT Tile : public base::RefCounted { float contents_scale() const { return contents_scale_; } gfx::Rect content_rect() const { return content_rect_; } + void set_picture_pile(scoped_refptr pile) { + picture_pile_ = pile; + } + private: // Methods called by by tile manager. friend class TileManager; -- cgit v1.1