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

Side by Side Diff: cc/resources/resource_pool.h

Issue 1230203007: Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove components/html_viewer/ change Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_RESOURCES_RESOURCE_POOL_H_ 5 #ifndef CC_RESOURCES_RESOURCE_POOL_H_
6 #define CC_RESOURCES_RESOURCE_POOL_H_ 6 #define CC_RESOURCES_RESOURCE_POOL_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 23 matching lines...) Expand all
34 ResourceFormat format); 34 ResourceFormat format);
35 scoped_ptr<ScopedResource> TryAcquireResourceWithContentId(uint64 content_id); 35 scoped_ptr<ScopedResource> TryAcquireResourceWithContentId(uint64 content_id);
36 void ReleaseResource(scoped_ptr<ScopedResource> resource, 36 void ReleaseResource(scoped_ptr<ScopedResource> resource,
37 uint64_t content_id); 37 uint64_t content_id);
38 38
39 void SetResourceUsageLimits(size_t max_memory_usage_bytes, 39 void SetResourceUsageLimits(size_t max_memory_usage_bytes,
40 size_t max_unused_memory_usage_bytes, 40 size_t max_unused_memory_usage_bytes,
41 size_t max_resource_count); 41 size_t max_resource_count);
42 42
43 void ReduceResourceUsage(); 43 void ReduceResourceUsage();
44 // This might block if |wait_if_needed| is true and one of the currently 44 void CheckBusyResources();
45 // busy resources has a read lock fence that needs to be waited upon before
46 // it can be locked for write again.
47 void CheckBusyResources(bool wait_if_needed);
48 45
49 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; } 46 size_t total_memory_usage_bytes() const { return memory_usage_bytes_; }
50 size_t acquired_memory_usage_bytes() const { 47 size_t acquired_memory_usage_bytes() const {
51 return memory_usage_bytes_ - unused_memory_usage_bytes_; 48 return memory_usage_bytes_ - unused_memory_usage_bytes_;
52 } 49 }
53 size_t total_resource_count() const { return resource_count_; } 50 size_t total_resource_count() const { return resource_count_; }
54 size_t acquired_resource_count() const { 51 size_t acquired_resource_count() const {
55 return resource_count_ - unused_resources_.size(); 52 return resource_count_ - unused_resources_.size();
56 } 53 }
57 size_t busy_resource_count() const { return busy_resources_.size(); } 54 size_t busy_resource_count() const { return busy_resources_.size(); }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 typedef std::deque<PoolResource> ResourceList; 89 typedef std::deque<PoolResource> ResourceList;
93 ResourceList unused_resources_; 90 ResourceList unused_resources_;
94 ResourceList busy_resources_; 91 ResourceList busy_resources_;
95 92
96 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 93 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
97 }; 94 };
98 95
99 } // namespace cc 96 } // namespace cc
100 97
101 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 98 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698