summaryrefslogtreecommitdiffstats
path: root/content/browser/utility_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/utility_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/utility_process_host.h')
-rw-r--r--content/browser/utility_process_host.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/content/browser/utility_process_host.h b/content/browser/utility_process_host.h
index 1481d44..18951d7 100644
--- a/content/browser/utility_process_host.h
+++ b/content/browser/utility_process_host.h
@@ -12,9 +12,12 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/process_util.h"
-#include "content/browser/browser_child_process_host.h"
#include "content/common/content_export.h"
+#include "content/public/browser/browser_child_process_host_delegate.h"
#include "content/public/browser/browser_thread.h"
+#include "ipc/ipc_message.h"
+
+class BrowserChildProcessHost;
// This class acts as the browser-side host to a utility child process. A
// utility process is a short-lived sandboxed process that is created to run
@@ -23,7 +26,9 @@
// If you need multiple batches of work to be done in the sandboxed process,
// use StartBatchMode(), then multiple calls to StartFooBar(p),
// then finish with EndBatchMode().
-class CONTENT_EXPORT UtilityProcessHost : public BrowserChildProcessHost {
+class CONTENT_EXPORT UtilityProcessHost
+ : public NON_EXPORTED_BASE(content::BrowserChildProcessHostDelegate),
+ public IPC::Message::Sender {
public:
// An interface to be implemented by consumers of the utility process to
// get results back. All functions are called on the thread passed along
@@ -53,7 +58,7 @@ class CONTENT_EXPORT UtilityProcessHost : public BrowserChildProcessHost {
content::BrowserThread::ID client_thread_id);
virtual ~UtilityProcessHost();
- // BrowserChildProcessHost override
+ // IPC::Message::Sender implementation:
virtual bool Send(IPC::Message* message) OVERRIDE;
// Starts utility process in batch mode. Caller must call EndBatchMode()
@@ -80,10 +85,8 @@ class CONTENT_EXPORT UtilityProcessHost : public BrowserChildProcessHost {
// has already been started via StartBatchMode().
bool StartProcess();
- // IPC messages:
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
-
// BrowserChildProcessHost:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void OnProcessCrashed(int exit_code) OVERRIDE;
// A pointer to our client interface, who will be informed of progress.
@@ -112,6 +115,8 @@ class CONTENT_EXPORT UtilityProcessHost : public BrowserChildProcessHost {
bool started_;
+ scoped_ptr<BrowserChildProcessHost> process_;
+
DISALLOW_COPY_AND_ASSIGN(UtilityProcessHost);
};