summaryrefslogtreecommitdiffstats
path: root/cc/tile.h
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-22 21:38:56 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-22 21:38:56 +0000
commitb221a221aa6bea441ef4a6735b8c51551a708c10 (patch)
treea32811d7c5c00405a2252d91e343cba955e269c7 /cc/tile.h
parentd6a227b6bc0857ef6b71fdb14ae4e392ab51776d (diff)
downloadchromium_src-b221a221aa6bea441ef4a6735b8c51551a708c10.zip
chromium_src-b221a221aa6bea441ef4a6735b8c51551a708c10.tar.gz
chromium_src-b221a221aa6bea441ef4a6735b8c51551a708c10.tar.bz2
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
Diffstat (limited to 'cc/tile.h')
-rw-r--r--cc/tile.h4
1 files changed, 4 insertions, 0 deletions
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<Tile> {
float contents_scale() const { return contents_scale_; }
gfx::Rect content_rect() const { return content_rect_; }
+ void set_picture_pile(scoped_refptr<PicturePileImpl> pile) {
+ picture_pile_ = pile;
+ }
+
private:
// Methods called by by tile manager.
friend class TileManager;