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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void CheckBusyResources(); | 78 void CheckBusyResources(); |
79 | 79 |
80 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } | 80 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } |
81 size_t resource_count() const { return in_use_resources_.size(); } | 81 size_t resource_count() const { return in_use_resources_.size(); } |
82 | 82 |
83 // Overridden from base::trace_event::MemoryDumpProvider: | 83 // Overridden from base::trace_event::MemoryDumpProvider: |
84 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 84 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
85 base::trace_event::ProcessMemoryDump* pmd) override; | 85 base::trace_event::ProcessMemoryDump* pmd) override; |
86 | 86 |
87 // Overriden from base::MemoryCoordinatorClient. | 87 // Overriden from base::MemoryCoordinatorClient. |
88 void OnMemoryStateChange(base::MemoryState state) override; | 88 void OnPurgeMemory() override; |
89 | 89 |
90 size_t GetTotalMemoryUsageForTesting() const { | 90 size_t GetTotalMemoryUsageForTesting() const { |
91 return total_memory_usage_bytes_; | 91 return total_memory_usage_bytes_; |
92 } | 92 } |
93 size_t GetTotalResourceCountForTesting() const { | 93 size_t GetTotalResourceCountForTesting() const { |
94 return total_resource_count_; | 94 return total_resource_count_; |
95 } | 95 } |
96 size_t GetBusyResourceCountForTesting() const { | 96 size_t GetBusyResourceCountForTesting() const { |
97 return busy_resources_.size(); | 97 return busy_resources_.size(); |
98 } | 98 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 const base::TimeDelta resource_expiration_delay_; | 188 const base::TimeDelta resource_expiration_delay_; |
189 | 189 |
190 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; | 190 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; |
191 | 191 |
192 DISALLOW_COPY_AND_ASSIGN(ResourcePool); | 192 DISALLOW_COPY_AND_ASSIGN(ResourcePool); |
193 }; | 193 }; |
194 | 194 |
195 } // namespace cc | 195 } // namespace cc |
196 | 196 |
197 #endif // CC_RESOURCES_RESOURCE_POOL_H_ | 197 #endif // CC_RESOURCES_RESOURCE_POOL_H_ |
OLD | NEW |