summaryrefslogtreecommitdiffstats
path: root/content/browser/ppapi_plugin_process_host.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 06:29:23 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 06:29:23 +0000
commit3b0032a7abc9cc9350253d4f66dcd9a367e206ab (patch)
tree3c7ae09453fe79f47ed7e0b5095aef5518bb4e95 /content/browser/ppapi_plugin_process_host.h
parent1027ebc3ec3fbb9fd44112e42bb06906895712bb (diff)
downloadchromium_src-3b0032a7abc9cc9350253d4f66dcd9a367e206ab.zip
chromium_src-3b0032a7abc9cc9350253d4f66dcd9a367e206ab.tar.gz
chromium_src-3b0032a7abc9cc9350253d4f66dcd9a367e206ab.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/ppapi_plugin_process_host.h')
-rw-r--r--content/browser/ppapi_plugin_process_host.h33
1 files changed, 30 insertions, 3 deletions
diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h
index f92aa1d..0a37360 100644
--- a/content/browser/ppapi_plugin_process_host.h
+++ b/content/browser/ppapi_plugin_process_host.h
@@ -12,8 +12,12 @@
#include "base/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/ref_counted.h"
-#include "content/browser/browser_child_process_host.h"
#include "content/browser/renderer_host/pepper_message_filter.h"
+#include "content/public/browser/browser_child_process_host_delegate.h"
+#include "content/public/browser/browser_child_process_host_iterator.h"
+#include "ipc/ipc_message.h"
+
+class BrowserChildProcessHost;
namespace content {
struct PepperPluginInfo;
@@ -26,8 +30,8 @@ class HostResolver;
// Process host for PPAPI plugin and broker processes.
// When used for the broker, interpret all references to "plugin" with "broker".
-class PpapiPluginProcessHost
- : public BrowserChildProcessHost {
+class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate,
+ public IPC::Message::Sender {
public:
class Client {
public:
@@ -60,6 +64,9 @@ class PpapiPluginProcessHost
static PpapiPluginProcessHost* CreateBrokerHost(
const content::PepperPluginInfo& info);
+ // IPC::Message::Sender implementation:
+ virtual bool Send(IPC::Message* message) OVERRIDE;
+
// Opens a new channel to the plugin. The client will be notified when the
// channel is ready or if there's an error.
void OpenChannelToPlugin(Client* client);
@@ -115,8 +122,28 @@ class PpapiPluginProcessHost
// The unique id created for the process.
int process_id_;
+ scoped_ptr<BrowserChildProcessHost> process_;
+
DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost);
};
+class PpapiPluginProcessHostIterator
+ : public content::BrowserChildProcessHostTypeIterator<
+ PpapiPluginProcessHost> {
+ public:
+ PpapiPluginProcessHostIterator()
+ : content::BrowserChildProcessHostTypeIterator<
+ PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_PLUGIN) {}
+};
+
+class PpapiBrokerProcessHostIterator
+ : public content::BrowserChildProcessHostTypeIterator<
+ PpapiPluginProcessHost> {
+ public:
+ PpapiBrokerProcessHostIterator()
+ : content::BrowserChildProcessHostTypeIterator<
+ PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_BROKER) {}
+};
+
#endif // CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_