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

Unified Diff: content/browser/utility_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
Index: content/browser/utility_process_host.h
===================================================================
--- content/browser/utility_process_host.h (revision 118420)
+++ content/browser/utility_process_host.h (working copy)
@@ -12,10 +12,13 @@
#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
// a specific task. This class lives solely on the IO thread.
@@ -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 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 @@
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 @@
// has already been started via StartBatchMode().
bool StartProcess();
- // IPC messages:
+ // BrowserChildProcessHost:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
-
- // BrowserChildProcessHost:
virtual void OnProcessCrashed(int exit_code) OVERRIDE;
// A pointer to our client interface, who will be informed of progress.
@@ -112,6 +115,8 @@
bool started_;
+ scoped_ptr<BrowserChildProcessHost> process_;
+
DISALLOW_COPY_AND_ASSIGN(UtilityProcessHost);
};
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.cc ('k') | content/browser/utility_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698