| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 OnMemoryStateChange(base::MemoryState state) override; |
| 89 void OnPurgeMemory() override; |
| 89 | 90 |
| 90 size_t GetTotalMemoryUsageForTesting() const { | 91 size_t GetTotalMemoryUsageForTesting() const { |
| 91 return total_memory_usage_bytes_; | 92 return total_memory_usage_bytes_; |
| 92 } | 93 } |
| 93 size_t GetTotalResourceCountForTesting() const { | 94 size_t GetTotalResourceCountForTesting() const { |
| 94 return total_resource_count_; | 95 return total_resource_count_; |
| 95 } | 96 } |
| 96 size_t GetBusyResourceCountForTesting() const { | 97 size_t GetBusyResourceCountForTesting() const { |
| 97 return busy_resources_.size(); | 98 return busy_resources_.size(); |
| 98 } | 99 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 const base::TimeDelta resource_expiration_delay_; | 189 const base::TimeDelta resource_expiration_delay_; |
| 189 | 190 |
| 190 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; | 191 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; |
| 191 | 192 |
| 192 DISALLOW_COPY_AND_ASSIGN(ResourcePool); | 193 DISALLOW_COPY_AND_ASSIGN(ResourcePool); |
| 193 }; | 194 }; |
| 194 | 195 |
| 195 } // namespace cc | 196 } // namespace cc |
| 196 | 197 |
| 197 #endif // CC_RESOURCES_RESOURCE_POOL_H_ | 198 #endif // CC_RESOURCES_RESOURCE_POOL_H_ |
| OLD | NEW |