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

Unified Diff: content/browser/utility_process_host.cc

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/utility_process_host.h ('k') | content/browser/worker_host/worker_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/utility_process_host.cc
===================================================================
--- content/browser/utility_process_host.cc (revision 118420)
+++ content/browser/utility_process_host.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
+#include "content/browser/browser_child_process_host.h"
#include "content/common/child_process_host_impl.h"
#include "content/common/utility_messages.h"
#include "content/public/browser/content_browser_client.h"
@@ -36,8 +37,7 @@
UtilityProcessHost::UtilityProcessHost(Client* client,
BrowserThread::ID client_thread_id)
- : BrowserChildProcessHost(content::PROCESS_TYPE_UTILITY),
- client_(client),
+ : client_(client),
client_thread_id_(client_thread_id),
is_batch_mode_(false),
no_sandbox_(false),
@@ -48,6 +48,8 @@
#endif
use_linux_zygote_(false),
started_(false) {
+ process_.reset(new BrowserChildProcessHost(
+ content::PROCESS_TYPE_UTILITY, this));
}
UtilityProcessHost::~UtilityProcessHost() {
@@ -58,7 +60,7 @@
if (!StartProcess())
return false;
- return BrowserChildProcessHost::Send(message);
+ return process_->Send(message);
}
bool UtilityProcessHost::StartBatchMode() {
@@ -87,9 +89,9 @@
return true;
// Name must be set or metrics_service will crash in any test which
// launches a UtilityProcessHost.
- SetName(ASCIIToUTF16("utility process"));
+ process_->SetName(ASCIIToUTF16("utility process"));
- std::string channel_id = child_process_host()->CreateChannel();
+ std::string channel_id = process_->GetHost()->CreateChannel();
if (channel_id.empty())
return false;
@@ -136,7 +138,7 @@
use_zygote = !no_sandbox_ && use_linux_zygote_;
#endif
- Launch(
+ process_->Launch(
#if defined(OS_WIN)
exposed_dir_,
#elif defined(OS_POSIX)
« no previous file with comments | « content/browser/utility_process_host.h ('k') | content/browser/worker_host/worker_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698