Chromium Code Reviews| Index: remoting/host/wts_session_process_launcher_win.cc |
| diff --git a/remoting/host/wts_session_process_launcher_win.cc b/remoting/host/wts_session_process_launcher_win.cc |
| index ffc38c6b47b097e9107520f46bf18fd11ea08678..5e227c0d7b678c93a0a7da001aeebd9095a3a75f 100644 |
| --- a/remoting/host/wts_session_process_launcher_win.cc |
| +++ b/remoting/host/wts_session_process_launcher_win.cc |
| @@ -15,8 +15,11 @@ |
| #include "base/bind.h" |
| #include "base/bind_helpers.h" |
| #include "base/command_line.h" |
| +#include "base/file_path.h" |
| +#include "base/file_util.h" |
| #include "base/logging.h" |
| #include "base/single_thread_task_runner.h" |
| +#include "base/path_service.h" |
| #include "base/process_util.h" |
| #include "base/rand_util.h" |
| #include "base/stringprintf.h" |
| @@ -40,6 +43,9 @@ namespace { |
| const int kMaxLaunchDelaySeconds = 60; |
| const int kMinLaunchDelaySeconds = 1; |
| +const FilePath::CharType kMe2meHostBinaryName[] = |
| + FILE_PATH_LITERAL("remoting_me2me_host.exe"); |
| + |
| // Match the pipe name prefix used by Chrome IPC channels. |
| const wchar_t kChromePipeNamePrefix[] = L"\\\\.\\pipe\\chrome."; |
| @@ -214,11 +220,9 @@ const uint32 kInvalidSessionId = 0xffffffff; |
| WtsSessionProcessLauncher::WtsSessionProcessLauncher( |
| const Shutdownable::Callback& done, |
| WtsConsoleMonitor* monitor, |
| - const FilePath& host_binary, |
| scoped_refptr<base::SingleThreadTaskRunner> main_message_loop, |
| scoped_refptr<base::SingleThreadTaskRunner> ipc_message_loop) |
| : Shutdownable(main_message_loop, done), |
| - host_binary_(host_binary), |
| main_message_loop_(main_message_loop), |
| ipc_message_loop_(ipc_message_loop), |
| monitor_(monitor), |
| @@ -249,6 +253,15 @@ void WtsSessionProcessLauncher::LaunchProcess() { |
| launch_time_ = base::Time::Now(); |
| + // Construct the host binary name. |
| + FilePath exe_path; |
| + if (!PathService::Get(base::FILE_EXE, &exe_path)) { |
|
simonmorris
2012/07/27 22:08:56
You could use DIR_EXE and avoid the call to DirNam
alexeypa (please no reviews)
2012/07/27 22:35:29
Done.
|
| + LOG(ERROR) << "Failed to get the executable file name."; |
| + Shutdown(); |
| + return; |
| + } |
| + FilePath host_binary = exe_path.DirName().Append(kMe2meHostBinaryName); |
| + |
| std::wstring channel_name; |
| ScopedHandle pipe; |
| if (CreatePipeForIpcChannel(this, &channel_name, &pipe)) { |
| @@ -261,7 +274,7 @@ void WtsSessionProcessLauncher::LaunchProcess() { |
| // Create the host process command line passing the name of the IPC channel |
| // to use and copying known switches from the service's command line. |
| - CommandLine command_line(host_binary_); |
| + CommandLine command_line(host_binary); |
| command_line.AppendSwitchNative(kChromotingIpcSwitchName, channel_name); |
| command_line.CopySwitchesFrom(*CommandLine::ForCurrentProcess(), |
| kCopiedSwitchNames, |
| @@ -269,7 +282,7 @@ void WtsSessionProcessLauncher::LaunchProcess() { |
| // Try to launch the process and attach an object watcher to the returned |
| // handle so that we get notified when the process terminates. |
| - if (LaunchProcessInSession(host_binary_, |
| + if (LaunchProcessInSession(host_binary, |
| command_line.GetCommandLineString(), |
| session_token_, |
| &process_)) { |