| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/output/managed_memory_policy.h" | 5 #include "cc/output/managed_memory_policy.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "cc/resources/priority_calculator.h" | 8 #include "cc/resources/priority_calculator.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return ALLOW_ABSOLUTE_MINIMUM; | 70 return ALLOW_ABSOLUTE_MINIMUM; |
| 71 case MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE: | 71 case MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE: |
| 72 return ALLOW_PREPAINT_ONLY; | 72 return ALLOW_PREPAINT_ONLY; |
| 73 case MemoryAllocation::CUTOFF_ALLOW_EVERYTHING: | 73 case MemoryAllocation::CUTOFF_ALLOW_EVERYTHING: |
| 74 return ALLOW_ANYTHING; | 74 return ALLOW_ANYTHING; |
| 75 } | 75 } |
| 76 NOTREACHED(); | 76 NOTREACHED(); |
| 77 return ALLOW_NOTHING; | 77 return ALLOW_NOTHING; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void ManagedMemoryPolicy::AsValueInto(base::debug::TracedValue* dict) const { |
| 81 dict->SetString("type", "ManagedMemoryPolicy"); |
| 82 dict->SetInteger("kDefaultNumResourcesLimit", kDefaultNumResourcesLimit); |
| 83 dict->SetInteger("bytes_limit_when_visible", bytes_limit_when_visible); |
| 84 switch (priority_cutoff_when_visible) { |
| 85 case MemoryAllocation::CUTOFF_ALLOW_NOTHING: |
| 86 dict->SetString("prority_cutoff_when_visible", "CUTOFF_ALLOW_NOTHING"); |
| 87 break; |
| 88 case MemoryAllocation::CUTOFF_ALLOW_REQUIRED_ONLY: |
| 89 dict->SetString("prority_cutoff_when_visible", |
| 90 "CUTOFF_ALLOW_REQUIRED_ONLY"); |
| 91 break; |
| 92 case MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE: |
| 93 dict->SetString("prority_cutoff_when_visible", |
| 94 "CUTOFF_ALLOW_NICE_TO_HAVE"); |
| 95 break; |
| 96 case MemoryAllocation::CUTOFF_ALLOW_EVERYTHING: |
| 97 dict->SetString("prority_cutoff_when_visible", "CUTOFF_ALLOW_EVERYTHING"); |
| 98 break; |
| 99 } |
| 100 dict->SetInteger("num_resources_limit", num_resources_limit); |
| 101 } |
| 102 |
| 80 } // namespace cc | 103 } // namespace cc |
| OLD | NEW |