Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ |
| 7 | 7 |
| 8 #if defined(ENABLE_GPU) | 8 #if defined(ENABLE_GPU) |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 std::set<GpuMemoryTrackingGroup*> tracking_groups_; | 96 std::set<GpuMemoryTrackingGroup*> tracking_groups_; |
| 97 | 97 |
| 98 size_t CalculateBonusMemoryAllocationBasedOnSize(gfx::Size size) const; | 98 size_t CalculateBonusMemoryAllocationBasedOnSize(gfx::Size size) const; |
| 99 | 99 |
| 100 size_t GetAvailableGpuMemory() const { | 100 size_t GetAvailableGpuMemory() const { |
| 101 return bytes_available_gpu_memory_; | 101 return bytes_available_gpu_memory_; |
| 102 } | 102 } |
| 103 | 103 |
| 104 // The maximum amount of memory that a tab may be assigned | 104 // The maximum amount of memory that a tab may be assigned |
| 105 size_t GetMaximumTabAllocation() const { | 105 size_t GetMaximumTabAllocation() const { |
| 106 #if defined(OS_CHROMEOS) | |
| 107 return 1024 * 1024 * 1024; | |
|
piman
2012/09/11 01:25:44
or maybe to avoid modifying all the code you can j
| |
| 108 #else | |
| 106 return 128 * 1024 * 1024; | 109 return 128 * 1024 * 1024; |
| 110 #endif | |
| 107 } | 111 } |
| 108 | 112 |
| 109 // The minimum non-zero amount of memory that a tab may be assigned | 113 // The minimum non-zero amount of memory that a tab may be assigned |
| 110 size_t GetMinimumTabAllocation() const { | 114 size_t GetMinimumTabAllocation() const { |
| 111 #if defined(OS_ANDROID) | 115 #if defined(OS_ANDROID) |
| 112 return 32 * 1024 * 1024; | 116 return 32 * 1024 * 1024; |
| 113 #else | 117 #else |
| 114 return 64 * 1024 * 1024; | 118 return 64 * 1024 * 1024; |
| 115 #endif | 119 #endif |
| 116 } | 120 } |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 136 // The current total memory usage, and historical maximum memory usage | 140 // The current total memory usage, and historical maximum memory usage |
| 137 size_t bytes_allocated_current_; | 141 size_t bytes_allocated_current_; |
| 138 size_t bytes_allocated_historical_max_; | 142 size_t bytes_allocated_historical_max_; |
| 139 | 143 |
| 140 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); | 144 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); |
| 141 }; | 145 }; |
| 142 | 146 |
| 143 #endif | 147 #endif |
| 144 | 148 |
| 145 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | 149 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ |
| OLD | NEW |