summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_session_win.h
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-17 21:06:24 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-17 21:06:24 +0000
commit60ccc243dfbfc86001cf1c0a4b44131a39d7d28d (patch)
tree8834337b7ad8eec985fd783d382734c5d9388eed /remoting/host/desktop_session_win.h
parentf05d582b7e213b15138697c01abf48c652ff271a (diff)
downloadchromium_src-60ccc243dfbfc86001cf1c0a4b44131a39d7d28d.zip
chromium_src-60ccc243dfbfc86001cf1c0a4b44131a39d7d28d.tar.gz
chromium_src-60ccc243dfbfc86001cf1c0a4b44131a39d7d28d.tar.bz2
[Chromoting] Added support of a list of desktop sessions on the daemon side.
DaemonProcess object keeps a list of active desktop sessions, each representing the screen, input devices, etc to be remoted to another machine. The network process is expected to request a desktop session to be opened once a connection has been accepted and closed when the client session is destroyed. This CL includes changes on the daemon side only. BUG=134694 Review URL: https://chromiumcodereview.appspot.com/11017065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162520 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/desktop_session_win.h')
-rw-r--r--remoting/host/desktop_session_win.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/remoting/host/desktop_session_win.h b/remoting/host/desktop_session_win.h
new file mode 100644
index 0000000..f958225
--- /dev/null
+++ b/remoting/host/desktop_session_win.h
@@ -0,0 +1,77 @@
+// 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_DESKTOP_SESSION_WIN_H_
+#define REMOTING_HOST_DESKTOP_SESSION_WIN_H_
+
+#include "base/file_path.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "remoting/host/desktop_session.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 DaemonProcess;
+class WorkerProcessLauncher;
+class WtsConsoleMonitor;
+
+// DesktopSession implementation which attaches to the host's physical console.
+// Receives IPC messages from the desktop process, running in the console
+// session, via |WorkerProcessIpcDelegate|, and monitors console session
+// attach/detach events via |WtsConsoleObserer|.
+// TODO(alexeypa): replace |WtsConsoleObserver| with an interface capable of
+// monitoring both the console and RDP connections. See http://crbug.com/137696.
+class DesktopSessionWin
+ : public DesktopSession,
+ public WorkerProcessIpcDelegate,
+ public WtsConsoleObserver {
+ public:
+ // Passes the owning |daemon_process|, a unique identifier of the desktop
+ // session |id| and the interface for monitoring console session attach/detach
+ // events. Both |daemon_process| and |monitor| must outlive |this|.
+ DesktopSessionWin(
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
+ DaemonProcess* daemon_process,
+ int id,
+ WtsConsoleMonitor* monitor);
+ virtual ~DesktopSessionWin();
+
+ // 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;
+
+ private:
+ // Task runner on which public methods of this class should be called.
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
+
+ // Message loop used by the IPC channel.
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+
+ // Contains the full path to the desktop binary.
+ FilePath desktop_binary_;
+
+ // Launches and monitors the desktop process.
+ scoped_ptr<WorkerProcessLauncher> launcher_;
+
+ // Pointer used to unsubscribe from session attach and detach events.
+ WtsConsoleMonitor* monitor_;
+
+ DISALLOW_COPY_AND_ASSIGN(DesktopSessionWin);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_DESKTOP_SESSION_WIN_H_