Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 Resource* TryAcquireResourceForPartialRaster( | 49 Resource* TryAcquireResourceForPartialRaster( |
| 50 uint64_t new_content_id, | 50 uint64_t new_content_id, |
| 51 const gfx::Rect& new_invalidated_rect, | 51 const gfx::Rect& new_invalidated_rect, |
| 52 uint64_t previous_content_id, | 52 uint64_t previous_content_id, |
| 53 gfx::Rect* total_invalidated_rect); | 53 gfx::Rect* total_invalidated_rect); |
| 54 | 54 |
| 55 // Called when a resource's content has been fully replaced (and is completely | 55 // Called when a resource's content has been fully replaced (and is completely |
| 56 // valid). Updates the resource's content ID to its new value. | 56 // valid). Updates the resource's content ID to its new value. |
| 57 void OnContentReplaced(ResourceId resource_id, uint64_t content_id); | 57 void OnContentReplaced(ResourceId resource_id, uint64_t content_id); |
| 58 void ReleaseResource(Resource* resource); | 58 void ReleaseResource(Resource* resource); |
| 59 void ReleaseResource(ResourceId resource_id); | |
|
ccameron
2016/07/20 22:13:53
[These changes then end up not being needed]
It's
| |
| 60 | |
| 61 // Similar to ReleaseResource, but does nothing if the resource did not come | |
| 62 // from this pool. | |
| 63 void ReleaseResourceIfFound(ResourceId resource_id); | |
| 59 | 64 |
| 60 void SetResourceUsageLimits(size_t max_memory_usage_bytes, | 65 void SetResourceUsageLimits(size_t max_memory_usage_bytes, |
| 61 size_t max_resource_count); | 66 size_t max_resource_count); |
| 62 | 67 |
| 63 void ReduceResourceUsage(); | 68 void ReduceResourceUsage(); |
| 64 void CheckBusyResources(); | 69 void CheckBusyResources(); |
| 65 | 70 |
| 66 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } | 71 size_t memory_usage_bytes() const { return in_use_memory_usage_bytes_; } |
| 67 size_t resource_count() const { return in_use_resources_.size(); } | 72 size_t resource_count() const { return in_use_resources_.size(); } |
| 68 | 73 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 base::TimeDelta resource_expiration_delay_; | 156 base::TimeDelta resource_expiration_delay_; |
| 152 | 157 |
| 153 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; | 158 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; |
| 154 | 159 |
| 155 DISALLOW_COPY_AND_ASSIGN(ResourcePool); | 160 DISALLOW_COPY_AND_ASSIGN(ResourcePool); |
| 156 }; | 161 }; |
| 157 | 162 |
| 158 } // namespace cc | 163 } // namespace cc |
| 159 | 164 |
| 160 #endif // CC_RESOURCES_RESOURCE_POOL_H_ | 165 #endif // CC_RESOURCES_RESOURCE_POOL_H_ |
| OLD | NEW |