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_TILE_PRIORITY_H_ | 5 #ifndef CC_RESOURCES_TILE_PRIORITY_H_ |
6 #define CC_RESOURCES_TILE_PRIORITY_H_ | 6 #define CC_RESOURCES_TILE_PRIORITY_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 NEW_CONTENT_TAKES_PRIORITY | 130 NEW_CONTENT_TAKES_PRIORITY |
131 | 131 |
132 // Be sure to update TreePriorityAsValue when adding new fields. | 132 // Be sure to update TreePriorityAsValue when adding new fields. |
133 }; | 133 }; |
134 scoped_ptr<base::Value> TreePriorityAsValue(TreePriority prio); | 134 scoped_ptr<base::Value> TreePriorityAsValue(TreePriority prio); |
135 | 135 |
136 class GlobalStateThatImpactsTilePriority { | 136 class GlobalStateThatImpactsTilePriority { |
137 public: | 137 public: |
138 GlobalStateThatImpactsTilePriority() | 138 GlobalStateThatImpactsTilePriority() |
139 : memory_limit_policy(ALLOW_NOTHING), | 139 : memory_limit_policy(ALLOW_NOTHING), |
140 memory_limit_in_bytes(0), | 140 soft_memory_limit_in_bytes(0), |
| 141 hard_memory_limit_in_bytes(0), |
141 unused_memory_limit_in_bytes(0), | 142 unused_memory_limit_in_bytes(0), |
142 num_resources_limit(0), | 143 num_resources_limit(0), |
143 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} | 144 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} |
144 | 145 |
145 TileMemoryLimitPolicy memory_limit_policy; | 146 TileMemoryLimitPolicy memory_limit_policy; |
146 | 147 |
147 size_t memory_limit_in_bytes; | 148 size_t soft_memory_limit_in_bytes; |
| 149 size_t hard_memory_limit_in_bytes; |
148 size_t unused_memory_limit_in_bytes; | 150 size_t unused_memory_limit_in_bytes; |
149 size_t num_resources_limit; | 151 size_t num_resources_limit; |
150 | 152 |
151 TreePriority tree_priority; | 153 TreePriority tree_priority; |
152 | 154 |
153 bool operator==(const GlobalStateThatImpactsTilePriority& other) const { | 155 bool operator==(const GlobalStateThatImpactsTilePriority& other) const { |
154 return memory_limit_policy == other.memory_limit_policy | 156 return memory_limit_policy == other.memory_limit_policy |
155 && memory_limit_in_bytes == other.memory_limit_in_bytes | 157 && soft_memory_limit_in_bytes == other.soft_memory_limit_in_bytes |
| 158 && hard_memory_limit_in_bytes == other.hard_memory_limit_in_bytes |
156 && unused_memory_limit_in_bytes == other.unused_memory_limit_in_bytes | 159 && unused_memory_limit_in_bytes == other.unused_memory_limit_in_bytes |
157 && num_resources_limit == other.num_resources_limit | 160 && num_resources_limit == other.num_resources_limit |
158 && tree_priority == other.tree_priority; | 161 && tree_priority == other.tree_priority; |
159 } | 162 } |
160 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { | 163 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { |
161 return !(*this == other); | 164 return !(*this == other); |
162 } | 165 } |
163 | 166 |
164 scoped_ptr<base::Value> AsValue() const; | 167 scoped_ptr<base::Value> AsValue() const; |
165 }; | 168 }; |
166 | 169 |
167 } // namespace cc | 170 } // namespace cc |
168 | 171 |
169 #endif // CC_RESOURCES_TILE_PRIORITY_H_ | 172 #endif // CC_RESOURCES_TILE_PRIORITY_H_ |
OLD | NEW |