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 #include "cc/resources/tile_priority.h" | 5 #include "cc/resources/tile_priority.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 switch (prio) { | 87 switch (prio) { |
88 case SAME_PRIORITY_FOR_BOTH_TREES: | 88 case SAME_PRIORITY_FOR_BOTH_TREES: |
89 return scoped_ptr<base::Value>(new base::StringValue( | 89 return scoped_ptr<base::Value>(new base::StringValue( |
90 "SAME_PRIORITY_FOR_BOTH_TREES")); | 90 "SAME_PRIORITY_FOR_BOTH_TREES")); |
91 case SMOOTHNESS_TAKES_PRIORITY: | 91 case SMOOTHNESS_TAKES_PRIORITY: |
92 return scoped_ptr<base::Value>(new base::StringValue( | 92 return scoped_ptr<base::Value>(new base::StringValue( |
93 "SMOOTHNESS_TAKES_PRIORITY")); | 93 "SMOOTHNESS_TAKES_PRIORITY")); |
94 case NEW_CONTENT_TAKES_PRIORITY: | 94 case NEW_CONTENT_TAKES_PRIORITY: |
95 return scoped_ptr<base::Value>(new base::StringValue( | 95 return scoped_ptr<base::Value>(new base::StringValue( |
96 "NEW_CONTENT_TAKES_PRIORITY")); | 96 "NEW_CONTENT_TAKES_PRIORITY")); |
| 97 default: |
| 98 DCHECK(false) << "Unrecognized priority value " << prio; |
| 99 return scoped_ptr<base::Value>(new base::StringValue("<unknown>")); |
97 } | 100 } |
98 DCHECK(false) << "Unrecognized priority value " << prio; | |
99 return scoped_ptr<base::Value>(new base::StringValue( | |
100 "<unknown>")); | |
101 } | 101 } |
102 | 102 |
103 scoped_ptr<base::Value> GlobalStateThatImpactsTilePriority::AsValue() const { | 103 scoped_ptr<base::Value> GlobalStateThatImpactsTilePriority::AsValue() const { |
104 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 104 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
105 state->Set("memory_limit_policy", | 105 state->Set("memory_limit_policy", |
106 TileMemoryLimitPolicyAsValue(memory_limit_policy).release()); | 106 TileMemoryLimitPolicyAsValue(memory_limit_policy).release()); |
107 state->SetInteger("soft_memory_limit_in_bytes", soft_memory_limit_in_bytes); | 107 state->SetInteger("soft_memory_limit_in_bytes", soft_memory_limit_in_bytes); |
108 state->SetInteger("hard_memory_limit_in_bytes", hard_memory_limit_in_bytes); | 108 state->SetInteger("hard_memory_limit_in_bytes", hard_memory_limit_in_bytes); |
109 state->SetInteger("num_resources_limit", num_resources_limit); | 109 state->SetInteger("num_resources_limit", num_resources_limit); |
110 state->Set("tree_priority", TreePriorityAsValue(tree_priority).release()); | 110 state->Set("tree_priority", TreePriorityAsValue(tree_priority).release()); |
111 return state.PassAs<base::Value>(); | 111 return state.PassAs<base::Value>(); |
112 } | 112 } |
113 | 113 |
114 } // namespace cc | 114 } // namespace cc |
OLD | NEW |