Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: content/common/gpu/gpu_memory_manager.h

Issue 12223064: base: Fix parsing and add dalvik-heap-limit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 10
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 uint64 GetMaximumClientAllocation() const; 157 uint64 GetMaximumClientAllocation() const;
158 uint64 GetMinimumClientAllocation() const { 158 uint64 GetMinimumClientAllocation() const {
159 return bytes_minimum_per_client_; 159 return bytes_minimum_per_client_;
160 } 160 }
161 // The default amount of memory that a client is assigned, if it has not 161 // The default amount of memory that a client is assigned, if it has not
162 // reported any memory usage stats yet. 162 // reported any memory usage stats yet.
163 uint64 GetDefaultClientAllocation() const { 163 uint64 GetDefaultClientAllocation() const {
164 return bytes_default_per_client_; 164 return bytes_default_per_client_;
165 } 165 }
166 166
167 // Get a reasonable memory limit from a viewport's surface area. 167 // On Android only, estimate memory limite from Dalvik heap size.
ccameron 2013/02/11 20:05:33 s/limite/limit
168 static uint64 CalcAvailableFromViewportArea(int viewport_area); 168 static uint64 CalcAvailableFromDalvikHeap();
169
169 static uint64 CalcAvailableFromGpuTotal(uint64 total_gpu_memory); 170 static uint64 CalcAvailableFromGpuTotal(uint64 total_gpu_memory);
170 171
171 // Send memory usage stats to the browser process. 172 // Send memory usage stats to the browser process.
172 void SendUmaStatsToBrowser(); 173 void SendUmaStatsToBrowser();
173 174
174 // Get the current number of bytes allocated. 175 // Get the current number of bytes allocated.
175 uint64 GetCurrentUsage() const { 176 uint64 GetCurrentUsage() const {
176 return bytes_allocated_managed_current_ + 177 return bytes_allocated_managed_current_ +
177 bytes_allocated_unmanaged_current_; 178 bytes_allocated_unmanaged_current_;
178 } 179 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 284
284 // Used to disable automatic changes to Manage() in testing. 285 // Used to disable automatic changes to Manage() in testing.
285 bool disable_schedule_manage_; 286 bool disable_schedule_manage_;
286 287
287 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); 288 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager);
288 }; 289 };
289 290
290 } // namespace content 291 } // namespace content
291 292
292 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ 293 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698