| 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"
|
| +#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
|
| + : public Stoppable,
|
| + public WorkerProcessIpcDelegate,
|
| + public WtsConsoleObserver {
|
| + public:
|
| + // Constructs a WtsConsoleSessionProcessDriver object. |stopped_callback| and
|
| + // |main_task_runner| are passed to the undelying |Stoppable| implementation.
|
| + // All interaction with |monitor| should happen on |main_task_runner|.
|
| + // |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,
|
| + 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.
|
| + 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.
|
| + WtsConsoleMonitor* monitor_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(WtsConsoleSessionProcessDriver);
|
| +};
|
| +
|
| +} // namespace remoting
|
| +
|
| +#endif // REMOTING_HOST_WIN_WTS_CONSOLE_SESSION_PROCESS_DRIVER_H_
|
|
|