summaryrefslogtreecommitdiffstats
path: root/cc/resources/resource_pool.h
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-15 16:08:54 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-15 16:08:54 +0000
commit653f0422c015947678043d7240d5bf9c9aad74e0 (patch)
treeb2f75af6cb9e0f263209088ec994f92645cbd1da /cc/resources/resource_pool.h
parent353bb1f78ccbac8969df0a260268ff86df1b9784 (diff)
downloadchromium_src-653f0422c015947678043d7240d5bf9c9aad74e0.zip
chromium_src-653f0422c015947678043d7240d5bf9c9aad74e0.tar.gz
chromium_src-653f0422c015947678043d7240d5bf9c9aad74e0.tar.bz2
cc: Fix ResourcePool busy resource leak
Currently busy resources in ResourcePool are not deleted on ResourcePool destruction. This is ok on most platfroms (except android webview) because ResourcePool life time is tied to ResourceProvider, which will clean up this leak. On android webview however, ResourcePool is deleted in LayerTreeHostImpl::ReleaseGL and ResourceProvider is destroyed later on cc tear down. Add DCHECKs in ResourcePool destructor to catch this in the future. This change requires making sure that tests that use tile resources always have a ResourceProvider and all tile resources created in tests are accounted for by the ResourcePool. BUG= NOTRY=true Review URL: https://codereview.chromium.org/70143004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235339 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/resource_pool.h')
-rw-r--r--cc/resources/resource_pool.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h
index 3b92855..de63d97 100644
--- a/cc/resources/resource_pool.h
+++ b/cc/resources/resource_pool.h
@@ -63,6 +63,8 @@ class CC_EXPORT ResourcePool {
bool ResourceUsageTooHigh();
private:
+ void DidFinishUsingResource(ResourcePool::Resource* resource);
+
ResourceProvider* resource_provider_;
size_t max_memory_usage_bytes_;
size_t max_unused_memory_usage_bytes_;