Chromium Code Reviews| Index: remoting/host/win/wts_console_session_process_driver.h |
| diff --git a/remoting/host/win/wts_console_session_process_driver.h b/remoting/host/win/wts_console_session_process_driver.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0de6a4649a25f61259439034f5d681b2770105fa |
| --- /dev/null |
| +++ b/remoting/host/win/wts_console_session_process_driver.h |
| @@ -0,0 +1,75 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_ |
| +#define REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_ |
| + |
| +#include "base/compiler_specific.h" |
|
Wez
2012/10/09 03:40:39
nit: Remove the duplicate include.
alexeypa (please no reviews)
2012/10/09 19:42:04
Done.
|
| +#include "base/callback_forward.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "remoting/base/stoppable.h" |
| +#include "remoting/host/win/wts_console_observer.h" |
| +#include "remoting/host/worker_process_ipc_delegate.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} // namespace base |
| + |
| +namespace remoting { |
| + |
| +class WorkerProcessLauncher; |
| +class WtsConsoleMonitor; |
| + |
| +// Launches the host in the session attached to the console. When a new session |
| +// attaches to the console relaunches the host in it. |
| +class WtsConsoleSessionProcessDriver |
|
Wez
2012/10/09 03:40:39
WtsConsoleSessionProcessHost would be the Chrome-s
alexeypa (please no reviews)
2012/10/09 19:42:04
I'd like to avoid confusion. This class launches t
Wez
2012/10/10 00:52:03
Good point. I still don't like "Driver", though;
|
| + : public Stoppable, |
| + public WorkerProcessIpcDelegate, |
| + public WtsConsoleObserver { |
| + public: |
| + // Constructs a WtsConsoleSessionProcessDriver object. |stopped_callback| and |
| + // |main_task_runner| are passed to the undelying |Stoppable| implementation. |
|
Wez
2012/10/09 03:40:39
typo: undelying
Wez
2012/10/09 03:40:39
nit: |main_task_runner| is also passed to the Work
alexeypa (please no reviews)
2012/10/09 19:42:04
Done.
alexeypa (please no reviews)
2012/10/09 19:42:04
Done.
|
| + // All interaction with |monitor| should happen on |main_task_runner|. |
|
Wez
2012/10/09 03:40:39
nit: This is a property of the implementation; do
alexeypa (please no reviews)
2012/10/09 19:42:04
Done.
|
| + // |io_task_runner| must be an I/O message loop. |
| + WtsConsoleSessionProcessDriver( |
| + const base::Closure& stopped_callback, |
| + WtsConsoleMonitor* monitor, |
| + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
|
Wez
2012/10/09 03:40:39
nit: Consider |monitor_task_runner| or |caller_tas
alexeypa (please no reviews)
2012/10/09 19:42:04
Done. |caller_task_runner|
|
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); |
| + |
| + virtual ~WtsConsoleSessionProcessDriver(); |
| + |
| + // WorkerProcessIpcDelegate implementation. |
| + virtual void OnChannelConnected() OVERRIDE; |
| + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| + virtual void OnPermanentError() OVERRIDE; |
| + |
| + // WtsConsoleObserver implementation. |
| + virtual void OnSessionAttached(uint32 session_id) OVERRIDE; |
| + virtual void OnSessionDetached() OVERRIDE; |
| + |
| + protected: |
| + // Stoppable implementation. |
| + virtual void DoStop() OVERRIDE; |
| + |
| + private: |
| + // The task runner all public methods of this class should be called on. |
|
Wez
2012/10/09 03:40:39
nit: "The task runner..." -> "Task runner on which
alexeypa (please no reviews)
2012/10/09 19:42:04
Done.
|
| + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| + |
| + // Message loop used by the IPC channel. |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| + |
| + // Launches and monitors the worker process. |
| + scoped_refptr<WorkerProcessLauncher> launcher_; |
| + |
| + // This pointer is used to unsubscribe from session attach and detach events. |
|
Wez
2012/10/09 03:40:39
nit: Drop "This point is"
alexeypa (please no reviews)
2012/10/09 19:42:04
Done.
|
| + WtsConsoleMonitor* monitor_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WtsConsoleSessionProcessDriver); |
| +}; |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_ |