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

Unified Diff: remoting/host/win/wts_session_process_launcher.cc

Issue 10832054: Removing --host-binary parameter in preparation to the coming me2me host refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 5 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 | « remoting/host/win/wts_session_process_launcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/wts_session_process_launcher.cc
diff --git a/remoting/host/win/wts_session_process_launcher.cc b/remoting/host/win/wts_session_process_launcher.cc
index 0a7ee1ba7b3eeb0f647c05aaf8df1fda0fc23ebe..0e09e93d7b0bcba5e8d75cd0efdf05a3dc2ac6db 100644
--- a/remoting/host/win/wts_session_process_launcher.cc
+++ b/remoting/host/win/wts_session_process_launcher.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 base::Closure& stopped_callback,
WtsConsoleMonitor* monitor,
- const FilePath& host_binary,
scoped_refptr<base::SingleThreadTaskRunner> main_message_loop,
scoped_refptr<base::SingleThreadTaskRunner> ipc_message_loop)
: Stoppable(main_message_loop, stopped_callback),
- 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 dir_path;
+ if (!PathService::Get(base::DIR_EXE, &dir_path)) {
+ LOG(ERROR) << "Failed to get the executable file name.";
+ Stop();
+ return;
+ }
+ FilePath host_binary = dir_path.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 (LaunchProcessWithToken(host_binary_,
+ if (LaunchProcessWithToken(host_binary,
command_line.GetCommandLineString(),
session_token_,
&process_)) {
« no previous file with comments | « remoting/host/win/wts_session_process_launcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698