summaryrefslogtreecommitdiffstats
path: root/remoting/host/win/host_service.cc
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 19:00:06 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 19:00:06 +0000
commit9733976130e9df953c41469be9cbfcbdd4667887 (patch)
treeb37e7ab428f5edb9e14108cbe589f1051ddf465e /remoting/host/win/host_service.cc
parent51dc5a56a725a1aa13d8d87d9be27238d644445d (diff)
downloadchromium_src-9733976130e9df953c41469be9cbfcbdd4667887.zip
chromium_src-9733976130e9df953c41469be9cbfcbdd4667887.tar.gz
chromium_src-9733976130e9df953c41469be9cbfcbdd4667887.tar.bz2
[Chromoting] Reimplement the worker process launcher to address issues with job control and launching of elevated processes.
This CL makes three changes: 1. We create a new job object every time we launch a worker into a new session, under Vista and above. This addresses the limitation that a job object used with processes from one session cannot later be re-used to manage processes from a different session. 2. We launch and manage worker processes directly on XP/W2K3, without a job object. We don't need a job object since these platforms don't support/need elevation anyway. This addresses the limitation that processes created via CreateRemoteSessionProcess() cannot be assigned to a job object. 3. We allow WorkerProcessLauncher instances to be dropped synchronously from the caller's perspective; the class takes care of asynchronous tear-down tasks transparently. This addresses a race condition in tear-down of old worker processes and creation of new ones arising from delayed session change notifications. The new layout assigns the following responsibilities: - WorkerProcessLauncher is used to manage a worker process, taking care of setting up the IPC channel, and re-launching it w/ exponential back-off. It supports fire-and-forget tear-down. - WorkerProcessLauncher defers launch & termination to a caller-supplied Delegate, responsible for launching the process as the caller requires. - Our current "single-process" service launches the host process via WtsConsoleSessionProcessDriver, which tracks which session is currently attached to the console and uses WtsSessionProcessDelegate instances to have WorkerProcessLauncher re-launch the host into the new console session whenever it is switched. WtsSessionProcessDelegate takes care of OS-version-specific process management tasks. - Our experimental "multi-process" service launches the host's network process, undependent of session lifetimes, by passing an UnprivilegedProcessDelegate to WorkerProcessLauncher. This launches the host process in the same session as the caller. BUG=153005, 148781, 149098 TEST=remoting_unittests.WorkerProcessLauncherTest Review URL: https://chromiumcodereview.appspot.com/11040065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/win/host_service.cc')
-rw-r--r--remoting/host/win/host_service.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/remoting/host/win/host_service.cc b/remoting/host/win/host_service.cc
index b882d52..d8ff0d1 100644
--- a/remoting/host/win/host_service.cc
+++ b/remoting/host/win/host_service.cc
@@ -39,7 +39,7 @@
#include "remoting/host/win/wts_console_observer.h"
#if !defined(REMOTING_MULTI_PROCESS)
-#include "remoting/host/win/wts_session_process_launcher.h"
+#include "remoting/host/win/wts_console_session_process_driver.h"
#endif // !defined(REMOTING_MULTI_PROCESS)
using base::StringPrintf;
@@ -213,8 +213,8 @@ void HostService::CreateLauncher(
#else // !defined(REMOTING_MULTI_PROCESS)
- // Create the session process launcher.
- child_.reset(new WtsSessionProcessLauncher(
+ // Create the console session process driver.
+ child_.reset(new WtsConsoleSessionProcessDriver(
base::Bind(&HostService::OnChildStopped, base::Unretained(this)),
this,
main_task_runner_,
@@ -249,7 +249,7 @@ int HostService::Elevate() {
CommandLine command_line(CommandLine::NO_PROGRAM);
command_line.CopySwitchesFrom(*CommandLine::ForCurrentProcess(),
kCopiedSwitchNames,
- _countof(kCopiedSwitchNames));
+ arraysize(kCopiedSwitchNames));
CommandLine::StringType parameters = command_line.GetCommandLineString();
// Launch the child process requesting elevation.