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

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: s/resources_/unused_resources_/ 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') | cc/resources/resource_pool.cc » ('J')
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..1710a7fdaf652d1d08ded9b882632b5c8eb878b4 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_ - unused_resources_.size();
+ }
protected:
explicit ResourcePool(ResourceProvider* resource_provider);
@@ -61,12 +65,13 @@ 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_;
+ ResourceList unused_resources_;
DISALLOW_COPY_AND_ASSIGN(ResourcePool);
};
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | cc/resources/resource_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698