OLD | NEW |
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 #include <map> |
9 | 10 |
10 #include "base/containers/scoped_ptr_map.h" | |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/trace_event/memory_dump_provider.h" | 12 #include "base/trace_event/memory_dump_provider.h" |
13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
14 #include "cc/output/renderer.h" | 14 #include "cc/output/renderer.h" |
15 #include "cc/resources/resource.h" | 15 #include "cc/resources/resource.h" |
16 #include "cc/resources/resource_format.h" | 16 #include "cc/resources/resource_format.h" |
17 #include "cc/resources/scoped_resource.h" | 17 #include "cc/resources/scoped_resource.h" |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 size_t max_resource_count_; | 113 size_t max_resource_count_; |
114 size_t in_use_memory_usage_bytes_; | 114 size_t in_use_memory_usage_bytes_; |
115 size_t total_memory_usage_bytes_; | 115 size_t total_memory_usage_bytes_; |
116 size_t total_resource_count_; | 116 size_t total_resource_count_; |
117 | 117 |
118 // Holds most recently used resources at the front of the queue. | 118 // Holds most recently used resources at the front of the queue. |
119 using ResourceDeque = std::deque<scoped_ptr<PoolResource>>; | 119 using ResourceDeque = std::deque<scoped_ptr<PoolResource>>; |
120 ResourceDeque unused_resources_; | 120 ResourceDeque unused_resources_; |
121 ResourceDeque busy_resources_; | 121 ResourceDeque busy_resources_; |
122 | 122 |
123 using ResourceMap = base::ScopedPtrMap<ResourceId, scoped_ptr<PoolResource>>; | 123 std::map<ResourceId, scoped_ptr<PoolResource>> in_use_resources_; |
124 ResourceMap in_use_resources_; | |
125 | 124 |
126 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 125 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
127 bool evict_expired_resources_pending_; | 126 bool evict_expired_resources_pending_; |
128 base::TimeDelta resource_expiration_delay_; | 127 base::TimeDelta resource_expiration_delay_; |
129 | 128 |
130 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; | 129 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; |
131 | 130 |
132 DISALLOW_COPY_AND_ASSIGN(ResourcePool); | 131 DISALLOW_COPY_AND_ASSIGN(ResourcePool); |
133 }; | 132 }; |
134 | 133 |
135 } // namespace cc | 134 } // namespace cc |
136 | 135 |
137 #endif // CC_RESOURCES_RESOURCE_POOL_H_ | 136 #endif // CC_RESOURCES_RESOURCE_POOL_H_ |
OLD | NEW |