| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_ | 5 #ifndef REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_ |
| 6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_ | 6 #define REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 35 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
| 36 virtual ~IpcDesktopEnvironmentFactory(); | 36 virtual ~IpcDesktopEnvironmentFactory(); |
| 37 | 37 |
| 38 virtual scoped_ptr<DesktopEnvironment> Create(ClientSession* client) OVERRIDE; | 38 virtual scoped_ptr<DesktopEnvironment> Create(ClientSession* client) OVERRIDE; |
| 39 | 39 |
| 40 // DesktopSessionConnector implementation. | 40 // DesktopSessionConnector implementation. |
| 41 virtual void ConnectTerminal( | 41 virtual void ConnectTerminal( |
| 42 IpcDesktopEnvironment* desktop_environment) OVERRIDE; | 42 IpcDesktopEnvironment* desktop_environment) OVERRIDE; |
| 43 virtual void DisconnectTerminal( | 43 virtual void DisconnectTerminal( |
| 44 IpcDesktopEnvironment* desktop_environment) OVERRIDE; | 44 IpcDesktopEnvironment* desktop_environment) OVERRIDE; |
| 45 virtual void OnDesktopSessionAgentAttached( |
| 46 int terminal_id, |
| 47 IPC::PlatformFileForTransit desktop_process, |
| 48 IPC::PlatformFileForTransit desktop_pipe) OVERRIDE; |
| 45 virtual void OnTerminalDisconnected(int terminal_id) OVERRIDE; | 49 virtual void OnTerminalDisconnected(int terminal_id) OVERRIDE; |
| 46 | 50 |
| 47 private: | 51 private: |
| 48 // IPC channel connected to the daemon process. | 52 // IPC channel connected to the daemon process. |
| 49 IPC::ChannelProxy* daemon_channel_; | 53 IPC::ChannelProxy* daemon_channel_; |
| 50 | 54 |
| 51 // Task runner used to service calls to the DesktopSessionConnector APIs. | 55 // Task runner used to service calls to the DesktopSessionConnector APIs. |
| 52 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 56 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
| 53 | 57 |
| 54 // List of DesktopEnvironment instances we've told the daemon process about. | 58 // List of DesktopEnvironment instances we've told the daemon process about. |
| 55 typedef std::map<int, IpcDesktopEnvironment*> ActiveConnectionsList; | 59 typedef std::map<int, IpcDesktopEnvironment*> ActiveConnectionsList; |
| 56 ActiveConnectionsList active_connections_; | 60 ActiveConnectionsList active_connections_; |
| 57 | 61 |
| 58 // Next desktop session ID. IDs are allocated sequentially starting from 0. | 62 // 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 | 63 // This gives us more than 67 years of unique IDs assuming a new ID is |
| 60 // allocated every second. | 64 // allocated every second. |
| 61 int next_id_; | 65 int next_id_; |
| 62 | 66 |
| 63 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); | 67 DISALLOW_COPY_AND_ASSIGN(IpcDesktopEnvironmentFactory); |
| 64 }; | 68 }; |
| 65 | 69 |
| 66 } // namespace remoting | 70 } // namespace remoting |
| 67 | 71 |
| 68 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_ | 72 #endif // REMOTING_HOST_IPC_DESKTOP_ENVIRONMENT_FACTORY_H_ |
| OLD | NEW |