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

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

Issue 10702200: PyAuto test for GPU memory consumption (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated PyAuto test for GPU memory consumption. 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.h
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index f4661f445ed4e914f02eef9aa9ca37d144e411b3..d90b13214c3f6e6e81876aa7755551a8b4547483 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -19,6 +19,7 @@
#include "content/common/gpu/gpu_process_launch_causes.h"
#include "content/public/browser/browser_child_process_host_delegate.h"
#include "content/public/common/gpu_info.h"
+#include "content/public/common/gpu_mem_stats.h"
#include "ipc/ipc_sender.h"
#include "ui/gfx/native_widget_types.h"
@@ -50,6 +51,14 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
typedef base::Callback<void(int32)> CreateCommandBufferCallback;
+ typedef base::Callback<void (const content::GpuMemStats& mem_stats)>
+ OnMemStatsCallback;
+
+ // Specify a callback to make when an OnMemStats message is received.
+ // Note that this function is to be called exactly once before every
+ // GpuHostMsg_MemStats message from the GPU process.
+ void SetOnMemStatsCallback(OnMemStatsCallback callback);
+
static bool gpu_enabled() { return gpu_enabled_; }
// Creates a new GpuProcessHost or gets an existing one, resulting in the
@@ -120,6 +129,7 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
void OnChannelEstablished(const IPC::ChannelHandle& channel_handle);
void OnCommandBufferCreated(const int32 route_id);
void OnDestroyCommandBuffer(int32 surface_id);
+ void OnMemStats(content::GpuMemStats mem_stats);
#if defined(OS_MACOSX)
void OnAcceleratedSurfaceBuffersSwapped(
@@ -194,6 +204,8 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
static bool hardware_gpu_enabled_;
+ OnMemStatsCallback on_mem_stats_callback_;
+
scoped_ptr<BrowserChildProcessHostImpl> process_;
DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);

Powered by Google App Engine
This is Rietveld 408576698