diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-03 07:10:44 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-03 07:10:44 +0000 |
commit | 4734d0becafa5b77d708020eed24d97148ea208d (patch) | |
tree | db94ca97a1ac3f1831033ef07dbda98ccb53dfa6 /chrome/service | |
parent | 463ea5fc399e6275a2351df6b398b7d91b8f5a61 (diff) | |
download | chromium_src-4734d0becafa5b77d708020eed24d97148ea208d.zip chromium_src-4734d0becafa5b77d708020eed24d97148ea208d.tar.gz chromium_src-4734d0becafa5b77d708020eed24d97148ea208d.tar.bz2 |
Make ChildProcessHost be used through an interface in content/public, instead of by inheritence.
BUG=98716
Review URL: http://codereview.chromium.org/8787004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112878 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r-- | chrome/service/service_utility_process_host.cc | 12 | ||||
-rw-r--r-- | chrome/service/service_utility_process_host.h | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc index d82007a..91f6627 100644 --- a/chrome/service/service_utility_process_host.cc +++ b/chrome/service/service_utility_process_host.cc @@ -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::StartGetPrinterCapsAndDefaults( 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 @@ bool ServiceUtilityProcessHost::StartProcess(bool no_sandbox, 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); diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h index 77cb2f7..a0bef70 100644 --- a/chrome/service/service_utility_process_host.h +++ b/chrome/service/service_utility_process_host.h @@ -21,7 +21,6 @@ #include "content/public/common/child_process_host_delegate.h" #include "printing/pdf_render_settings.h" -class ChildProcessHost; class CommandLine; class ScopedTempDir; @@ -29,6 +28,10 @@ namespace base { class MessageLoopProxy; } // namespace base +namespace content { +class ChildProcessHost; +} + namespace printing { class Emf; struct PageRange; @@ -135,7 +138,7 @@ class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { const printing::PrinterCapsAndDefaults& caps_and_defaults); void OnGetPrinterCapsAndDefaultsFailed(const std::string& printer_name); - scoped_ptr<ChildProcessHost> child_process_host_; + scoped_ptr<content::ChildProcessHost> child_process_host_; base::ProcessHandle handle_; // A pointer to our client interface, who will be informed of progress. scoped_refptr<Client> client_; |