summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu/gpu_process_host.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/gpu/gpu_process_host.h')
-rw-r--r--content/browser/gpu/gpu_process_host.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index 29ec0df..51245d7 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -11,22 +11,22 @@
#include "base/callback.h"
#include "base/memory/linked_ptr.h"
+#include "base/process.h"
#include "base/threading/non_thread_safe.h"
-#include "content/browser/browser_child_process_host.h"
#include "content/common/content_export.h"
#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 "ipc/ipc_message.h"
#include "ui/gfx/native_widget_types.h"
+class GpuMainThread;
struct GPUCreateCommandBufferConfig;
-namespace IPC {
-class Message;
-}
-
-class GpuMainThread;
+class BrowserChildProcessHost;
-class GpuProcessHost : public BrowserChildProcessHost,
+class GpuProcessHost : public content::BrowserChildProcessHostDelegate,
+ public IPC::Message::Sender,
public base::NonThreadSafe {
public:
static bool gpu_enabled() { return gpu_enabled_; }
@@ -52,12 +52,9 @@ class GpuProcessHost : public BrowserChildProcessHost,
static GpuProcessHost* FromID(int host_id);
int host_id() const { return host_id_; }
+ // IPC::Message::Sender implementation:
virtual bool Send(IPC::Message* msg) OVERRIDE;
- // ChildProcessHost implementation.
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
-
typedef base::Callback<void(const IPC::ChannelHandle&,
base::ProcessHandle,
const content::GPUInfo&)>
@@ -86,6 +83,8 @@ class GpuProcessHost : public BrowserChildProcessHost,
void ForceShutdown();
private:
+ static bool HostIsValid(GpuProcessHost* host);
+
GpuProcessHost(int host_id);
virtual ~GpuProcessHost();
@@ -94,6 +93,9 @@ class GpuProcessHost : public BrowserChildProcessHost,
// Post an IPC message to the UI shim's message handler on the UI thread.
void RouteOnUIThread(const IPC::Message& message);
+ // BrowserChildProcessHostDelegate implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
virtual void OnProcessLaunched() OVERRIDE;
virtual void OnProcessCrashed(int exit_code) OVERRIDE;
@@ -155,6 +157,8 @@ class GpuProcessHost : public BrowserChildProcessHost,
// existing tabs, just the future ones.
CONTENT_EXPORT static bool gpu_enabled_;
+ scoped_ptr<BrowserChildProcessHost> process_;
+
DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
};