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

Unified Diff: cc/resources/resource_pool.h

Issue 23231002: cc: Prevent the tile manager from allocating more memory than allowed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_pool.h
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h
index 309bf33f30b0873f50059780dae77efffdc0b0b3..19996746fa194378a77aad733394293a66278e96 100644
--- a/cc/resources/resource_pool.h
+++ b/cc/resources/resource_pool.h
@@ -42,7 +42,9 @@ class CC_EXPORT ResourcePool {
void SetMemoryUsageLimits(size_t max_memory_usage_bytes,
size_t max_unused_memory_usage_bytes,
- size_t num_resources_limit);
+ size_t max_resource_count);
+
+ void ReduceMemoryUsage();
size_t total_memory_usage_bytes() const {
return memory_usage_bytes_;
@@ -50,7 +52,9 @@ class CC_EXPORT ResourcePool {
size_t acquired_memory_usage_bytes() const {
return memory_usage_bytes_ - unused_memory_usage_bytes_;
}
- size_t NumResources() const { return resources_.size(); }
+ size_t acquired_resource_count() const {
+ return resource_count_ - resources_.size();
+ }
protected:
explicit ResourcePool(ResourceProvider* resource_provider);
@@ -61,9 +65,10 @@ class CC_EXPORT ResourcePool {
ResourceProvider* resource_provider_;
size_t max_memory_usage_bytes_;
size_t max_unused_memory_usage_bytes_;
+ size_t max_resource_count_;
size_t memory_usage_bytes_;
size_t unused_memory_usage_bytes_;
- size_t num_resources_limit_;
+ size_t resource_count_;
typedef std::list<Resource*> ResourceList;
ResourceList resources_;
aelias_OOO_until_Jul13 2013/08/15 02:06:00 Please rename this to unused_resources_, that woul
reveman 2013/08/15 15:14:15 Done.
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698