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

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

Issue 10796096: Add tracing of all memory allocated in all contexts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More trybot constructor fixes Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | content/common/gpu/gpu_memory_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #if defined(ENABLE_GPU) 8 #if defined(ENABLE_GPU)
9 9
10 #include <vector> 10 #include <vector>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 StubMemoryStatMap; 86 StubMemoryStatMap;
87 const StubMemoryStatMap& stub_memory_stats_for_last_manage() const { 87 const StubMemoryStatMap& stub_memory_stats_for_last_manage() const {
88 return stub_memory_stats_for_last_manage_; 88 return stub_memory_stats_for_last_manage_;
89 } 89 }
90 90
91 // Tries to estimate the total available gpu memory for use by 91 // Tries to estimate the total available gpu memory for use by
92 // GpuMemoryManager. Ideally should consider other system applications and 92 // GpuMemoryManager. Ideally should consider other system applications and
93 // other internal but non GpuMemoryManager managed sources, etc. 93 // other internal but non GpuMemoryManager managed sources, etc.
94 size_t GetAvailableGpuMemory() const; 94 size_t GetAvailableGpuMemory() const;
95 95
96 // GetPeakAssignedAllocationSum() will return the historical max value for the 96 // Track a change in memory allocated by any context
97 // sum of all assigned client allocations (ie, peak system memory allocation). 97 void TrackMemoryAllocatedChange(size_t old_size, size_t new_size);
98 size_t peak_assigned_allocation_sum() const { 98
99 return peak_assigned_allocation_sum_;
100 }
101 99
102 private: 100 private:
103 friend class GpuMemoryManagerTest; 101 friend class GpuMemoryManagerTest;
104 void Manage(); 102 void Manage();
105 103
106 class CONTENT_EXPORT StubWithSurfaceComparator { 104 class CONTENT_EXPORT StubWithSurfaceComparator {
107 public: 105 public:
108 bool operator()(GpuCommandBufferStubBase* lhs, 106 bool operator()(GpuCommandBufferStubBase* lhs,
109 GpuCommandBufferStubBase* rhs); 107 GpuCommandBufferStubBase* rhs);
110 }; 108 };
111 109
112 GpuMemoryManagerClient* client_; 110 GpuMemoryManagerClient* client_;
113 111
114 base::CancelableClosure delayed_manage_callback_; 112 base::CancelableClosure delayed_manage_callback_;
115 bool manage_immediate_scheduled_; 113 bool manage_immediate_scheduled_;
116 114
117 size_t max_surfaces_with_frontbuffer_soft_limit_; 115 size_t max_surfaces_with_frontbuffer_soft_limit_;
118 116
119 StubMemoryStatMap stub_memory_stats_for_last_manage_; 117 StubMemoryStatMap stub_memory_stats_for_last_manage_;
120 size_t peak_assigned_allocation_sum_; 118
119 // The current total memory usage, and historical maximum memory usage
120 size_t bytes_allocated_current_;
121 size_t bytes_allocated_historical_max_;
121 122
122 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); 123 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager);
123 }; 124 };
124 125
125 #endif 126 #endif
126 127
127 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ 128 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | content/common/gpu/gpu_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698