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

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

Issue 9150017: Add a Content API around BrowserChildProcessHost, similar to what was done with ChildProcessHost.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix?! Created 8 years, 11 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
« no previous file with comments | « content/browser/debugger/worker_devtools_manager.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.h
===================================================================
--- content/browser/gpu/gpu_process_host.h (revision 118420)
+++ content/browser/gpu/gpu_process_host.h (working copy)
@@ -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 BrowserChildProcessHost;
-class GpuMainThread;
-
-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 @@
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 @@
void ForceShutdown();
private:
+ static bool HostIsValid(GpuProcessHost* host);
+
GpuProcessHost(int host_id);
virtual ~GpuProcessHost();
@@ -94,6 +93,9 @@
// 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 @@
// existing tabs, just the future ones.
CONTENT_EXPORT static bool gpu_enabled_;
+ scoped_ptr<BrowserChildProcessHost> process_;
+
DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
};
« no previous file with comments | « content/browser/debugger/worker_devtools_manager.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698