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

Unified Diff: chrome/service/service_utility_process_host.cc

Issue 8787004: Make ChildProcessHost be used through an interface in content/public, instead of by inheritence. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « chrome/service/service_utility_process_host.h ('k') | content/browser/browser_child_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/service_utility_process_host.cc
===================================================================
--- chrome/service/service_utility_process_host.cc (revision 112775)
+++ chrome/service/service_utility_process_host.cc (working copy)
@@ -15,7 +15,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_utility_messages.h"
-#include "content/common/child_process_host.h"
+#include "content/public/common/child_process_host.h"
#include "content/public/common/result_codes.h"
#include "ipc/ipc_switches.h"
#include "printing/page_range.h"
@@ -30,13 +30,15 @@
#include "printing/emf_win.h"
#endif
+using content::ChildProcessHost;
+
ServiceUtilityProcessHost::ServiceUtilityProcessHost(
Client* client, base::MessageLoopProxy* client_message_loop_proxy)
: handle_(base::kNullProcessHandle),
client_(client),
client_message_loop_proxy_(client_message_loop_proxy),
waiting_for_reply_(false) {
- child_process_host_.reset(new ChildProcessHost(this));
+ child_process_host_.reset(ChildProcessHost::Create(this));
}
ServiceUtilityProcessHost::~ServiceUtilityProcessHost() {
@@ -103,7 +105,8 @@
bool ServiceUtilityProcessHost::StartProcess(bool no_sandbox,
const FilePath& exposed_dir) {
- if (!child_process_host_->CreateChannel())
+ std::string channel_id = child_process_host_->CreateChannel();
+ if (channel_id.empty())
return false;
FilePath exe_path = GetUtilityProcessCmd();
@@ -114,8 +117,7 @@
CommandLine cmd_line(exe_path);
cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kUtilityProcess);
- cmd_line.AppendSwitchASCII(switches::kProcessChannelID,
- child_process_host_->channel_id());
+ cmd_line.AppendSwitchASCII(switches::kProcessChannelID, channel_id);
cmd_line.AppendSwitch(switches::kLang);
return Launch(&cmd_line, no_sandbox, exposed_dir);
« no previous file with comments | « chrome/service/service_utility_process_host.h ('k') | content/browser/browser_child_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698