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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 10702200: PyAuto test for GPU memory consumption (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index cc9176b412c189f0c8f60aa4a9e7542681155b8b..9a150c387102319662691b63a9e7a5612ce2f391 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -449,6 +449,7 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished)
IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, OnCommandBufferCreated)
IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyCommandBuffer, OnDestroyCommandBuffer)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_MemStats, OnMemStats)
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
OnAcceleratedSurfaceBuffersSwapped)
@@ -588,6 +589,18 @@ void GpuProcessHost::OnDestroyCommandBuffer(int32 surface_id) {
#endif // defined(TOOLKIT_GTK)
}
+void GpuProcessHost::SetOnMemStatsCallback(OnMemStatsCallback callback)
+{
+ DCHECK(on_mem_stats_callback_.is_null());
+ on_mem_stats_callback_ = callback;
+}
+
+void GpuProcessHost::OnMemStats(content::GpuMemStats mem_stats) {
+ DCHECK(!on_mem_stats_callback_.is_null());
+ on_mem_stats_callback_.Run(mem_stats);
+ on_mem_stats_callback_.Reset();
+}
+
#if defined(OS_MACOSX)
void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) {

Powered by Google App Engine
This is Rietveld 408576698