Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Side by Side Diff: remoting/host/ipc_desktop_environment_factory.h

Issue 11028128: [Chromoting] Request the daemon to open a terminal once a connection has been accepted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_
6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_
7
8 #include <map>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "remoting/host/desktop_environment_factory.h"
12 #include "remoting/host/desktop_session_connector.h"
13
14 namespace IPC {
15 class ChannelProxy;
16 } // namespace IPC
17
18 namespace remoting {
19
20 class DesktopSessionConnector;
21 class IpcDesktopEnvironment;
22
23 // Used to create IpcDesktopEnvironment objects intergating with the desktop via
24 // a helper process and talking to that process via IPC.
25 class IpcDesktopEnvironmentFactory
26 : public DesktopEnvironmentFactory,
27 public DesktopSessionConnector {
28 public:
29 // Passes a reference to the IPC channel connected to the daemon process and
30 // relevant task runners. |daemon_channel| must outlive this object.
31 IpcDesktopEnvironmentFactory(
32 IPC::ChannelProxy* daemon_channel,
33 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
34 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
35 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
36 virtual ~IpcDesktopEnvironmentFactory();
37
38 virtual scoped_ptr<DesktopEnvironment> Create(ClientSession* client) OVERRIDE;
39
40 // DesktopSessionConnector implementation.
41 virtual void ConnectTerminal(
42 IpcDesktopEnvironment* desktop_environment) OVERRIDE;
43 virtual void DisconnectTerminal(
44 IpcDesktopEnvironment* desktop_environment) OVERRIDE;
45 virtual void OnTerminalDisconnected(int terminal_id) OVERRIDE;
46
47 private:
48 // IPC channel connected to the daemon process.
49 IPC::ChannelProxy* daemon_channel_;
50
51 // Task runner used to service calls to the DesktopSessionConnector APIs.
52 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
53
54 // List of DesktopEnvironment instances we've told the daemon process about.
55 typedef std::map<int, IpcDesktopEnvironment*> ActiveConnectionsList;
56 ActiveConnectionsList active_connections_;
57
58 // Next desktop session ID. IDs are allocated sequentially starting from 0.
59 // This gives us more than 67 years of unique IDs assuming a new ID is
60 // allocated every second.
61 int next_id_;
62
63 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory);
64 };
65
66 } // namespace remoting
67
68 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_
OLDNEW
« no previous file with comments | « remoting/host/ipc_desktop_environment.cc ('k') | remoting/host/ipc_desktop_environment_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698