Index: remoting/host/win/wts_session_process_launcher.h |
diff --git a/remoting/host/win/wts_session_process_launcher.h b/remoting/host/win/wts_session_process_launcher.h |
index 577c0746c2a08ae5b44fdb6ab2b6bffd86393422..312084d144bb5583f958866190a0b0450b8eb1d7 100644 |
--- a/remoting/host/win/wts_session_process_launcher.h |
+++ b/remoting/host/win/wts_session_process_launcher.h |
@@ -15,9 +15,9 @@ |
#include "base/time.h" |
#include "base/timer.h" |
#include "base/win/scoped_handle.h" |
-#include "base/win/object_watcher.h" |
#include "ipc/ipc_channel.h" |
#include "remoting/base/stoppable.h" |
+#include "remoting/host/win/worker_process_launcher.h" |
#include "remoting/host/win/wts_console_observer.h" |
namespace base { |
@@ -36,8 +36,7 @@ class WtsConsoleMonitor; |
class WtsSessionProcessLauncher |
: public Stoppable, |
- public base::win::ObjectWatcher::Delegate, |
- public IPC::Listener, |
+ public WorkerProcessLauncher::Delegate, |
public WtsConsoleObserver { |
public: |
// Constructs a WtsSessionProcessLauncher object. All interaction with |
@@ -51,10 +50,11 @@ class WtsSessionProcessLauncher |
virtual ~WtsSessionProcessLauncher(); |
- // base::win::ObjectWatcher::Delegate implementation. |
- virtual void OnObjectSignaled(HANDLE object) OVERRIDE; |
- |
- // IPC::Listener implementation. |
+ // WorkerProcessLauncher::Delegate implementation. |
+ virtual bool DoLaunchProcess(const std::string& channel_name, |
+ base::win::ScopedHandle* wait_out) OVERRIDE; |
+ virtual void DoKillProcess(DWORD exit_code) OVERRIDE; |
+ virtual void OnChannelConnected(base::win::ScopedHandle peer) OVERRIDE; |
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
// WtsConsoleObserver implementation. |
@@ -71,10 +71,16 @@ class WtsSessionProcessLauncher |
// reason. |
void LaunchProcess(); |
+ // Called when the launcher reports the process to be stopped. |
+ void OnLauncherStopped(); |
+ |
// Sends the Secure Attention Sequence to the session represented by |
// |session_token_|. |
void OnSendSasToConsole(); |
+ // Tracks whether the object is attached to the console session. |
Wez
2012/08/08 20:13:41
nit: "True if this object is currently attached to
alexeypa (please no reviews)
2012/08/08 21:49:58
Done.
|
+ bool attached_; |
Wez
2012/08/08 20:13:41
nit: Consider storing the ID of the session to whi
alexeypa (please no reviews)
2012/08/08 21:49:58
It will not be used so there is no point is storin
|
+ |
// Time of the last launch attempt. |
base::Time launch_time_; |
@@ -93,29 +99,13 @@ class WtsSessionProcessLauncher |
// This pointer is used to unsubscribe from session attach and detach events. |
WtsConsoleMonitor* monitor_; |
- // The handle of the process injected into the console session. |
- base::Process process_; |
+ scoped_ptr<WorkerProcessLauncher> launcher_; |
Wez
2012/08/08 20:13:41
nit: worker_process_launcher_
alexeypa (please no reviews)
2012/08/08 21:49:58
No, I think it is OK to keep it |launcher_| just l
|
- // Used to determine when the launched process terminates. |
- base::win::ObjectWatcher process_watcher_; |
+ base::win::ScopedHandle worker_process_; |
// The token to be used to launch a process in a different session. |
base::win::ScopedHandle session_token_; |
- // Defines the states the process launcher can be in. |
- enum State { |
- StateDetached, |
- StateStarting, |
- StateAttached, |
- }; |
- |
- // Current state of the process launcher. |
- State state_; |
- |
- // The Chromoting IPC channel connecting the service to the per-session |
- // process. |
- scoped_ptr<IPC::ChannelProxy> chromoting_channel_; |
- |
scoped_ptr<SasInjector> sas_injector_; |
DISALLOW_COPY_AND_ASSIGN(WtsSessionProcessLauncher); |