diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 07:51:54 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 07:51:54 +0000 |
commit | f177ffd84b0f1b94de05fa0166520783cb5cddb9 (patch) | |
tree | 54f755e0de2d845cd2d8b481f08c528911ce62d2 /content/browser/gpu/gpu_process_host.h | |
parent | 57c1b56f4ae39e8cb1cd805fb46653423d4e5456 (diff) | |
download | chromium_src-f177ffd84b0f1b94de05fa0166520783cb5cddb9.zip chromium_src-f177ffd84b0f1b94de05fa0166520783cb5cddb9.tar.gz chromium_src-f177ffd84b0f1b94de05fa0166520783cb5cddb9.tar.bz2 |
Revert 118415 - Add a Content API around BrowserChildProcessHost, similar to what was done with ChildProcessHost. Now classes like PluginProcessHost don't derive from it, but instead use composition.
I've also moved the iterator class into its own file in the public directory. Since classes don't derive from BrowserChildProcessHost and so can't static_cast from it, I added a template helper that does this.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9150017
TBR=jam@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/gpu_process_host.h')
-rw-r--r-- | content/browser/gpu/gpu_process_host.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h index 51245d7..29ec0df 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; -class BrowserChildProcessHost; +namespace IPC { +class Message; +} + +class GpuMainThread; -class GpuProcessHost : public content::BrowserChildProcessHostDelegate, - public IPC::Message::Sender, +class GpuProcessHost : public BrowserChildProcessHost, public base::NonThreadSafe { public: static bool gpu_enabled() { return gpu_enabled_; } @@ -52,9 +52,12 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate, 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&)> @@ -83,8 +86,6 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate, void ForceShutdown(); private: - static bool HostIsValid(GpuProcessHost* host); - GpuProcessHost(int host_id); virtual ~GpuProcessHost(); @@ -93,9 +94,6 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate, // 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; @@ -157,8 +155,6 @@ class GpuProcessHost : public content::BrowserChildProcessHostDelegate, // existing tabs, just the future ones. CONTENT_EXPORT static bool gpu_enabled_; - scoped_ptr<BrowserChildProcessHost> process_; - DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); }; |