| 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_DAEMON_PROCESS_H_ | 5 #ifndef REMOTING_HOST_DAEMON_PROCESS_H_ |
| 6 #define REMOTING_HOST_DAEMON_PROCESS_H_ | 6 #define REMOTING_HOST_DAEMON_PROCESS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/process/process.h" | 19 #include "base/process/process.h" |
| 20 #include "ipc/ipc_channel.h" | 20 #include "ipc/ipc_channel.h" |
| 21 #include "ipc/ipc_channel_proxy.h" | 21 #include "ipc/ipc_channel_handle.h" |
| 22 #include "ipc/ipc_platform_file.h" | |
| 23 #include "remoting/host/config_watcher.h" | 22 #include "remoting/host/config_watcher.h" |
| 24 #include "remoting/host/host_status_monitor.h" | 23 #include "remoting/host/host_status_monitor.h" |
| 25 #include "remoting/host/worker_process_ipc_delegate.h" | 24 #include "remoting/host/worker_process_ipc_delegate.h" |
| 26 | 25 |
| 27 struct SerializedTransportRoute; | 26 struct SerializedTransportRoute; |
| 28 | 27 |
| 29 namespace tracked_objects { | 28 namespace tracked_objects { |
| 30 class Location; | 29 class Location; |
| 31 } // namespace tracked_objects | 30 } // namespace tracked_objects |
| 32 | 31 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // WorkerProcessIpcDelegate implementation. | 69 // WorkerProcessIpcDelegate implementation. |
| 71 void OnChannelConnected(int32_t peer_pid) override; | 70 void OnChannelConnected(int32_t peer_pid) override; |
| 72 bool OnMessageReceived(const IPC::Message& message) override; | 71 bool OnMessageReceived(const IPC::Message& message) override; |
| 73 void OnPermanentError(int exit_code) override; | 72 void OnPermanentError(int exit_code) override; |
| 74 | 73 |
| 75 // Sends an IPC message to the network process. The message will be dropped | 74 // Sends an IPC message to the network process. The message will be dropped |
| 76 // unless the network process is connected over the IPC channel. | 75 // unless the network process is connected over the IPC channel. |
| 77 virtual void SendToNetwork(IPC::Message* message) = 0; | 76 virtual void SendToNetwork(IPC::Message* message) = 0; |
| 78 | 77 |
| 79 // Called when a desktop integration process attaches to |terminal_id|. | 78 // Called when a desktop integration process attaches to |terminal_id|. |
| 80 // |desktop_process| is a handle of the desktop integration process. | |
| 81 // |desktop_pipe| specifies the client end of the desktop pipe. Returns true | 79 // |desktop_pipe| specifies the client end of the desktop pipe. Returns true |
| 82 // on success, false otherwise. | 80 // on success, false otherwise. |
| 83 virtual bool OnDesktopSessionAgentAttached( | 81 virtual bool OnDesktopSessionAgentAttached( |
| 84 int terminal_id, | 82 int terminal_id, |
| 85 base::ProcessHandle desktop_process, | 83 const IPC::ChannelHandle& desktop_pipe) = 0; |
| 86 IPC::PlatformFileForTransit desktop_pipe) = 0; | |
| 87 | 84 |
| 88 // Closes the desktop session identified by |terminal_id|. | 85 // Closes the desktop session identified by |terminal_id|. |
| 89 void CloseDesktopSession(int terminal_id); | 86 void CloseDesktopSession(int terminal_id); |
| 90 | 87 |
| 91 protected: | 88 protected: |
| 92 DaemonProcess(scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 89 DaemonProcess(scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 93 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 90 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 94 const base::Closure& stopped_callback); | 91 const base::Closure& stopped_callback); |
| 95 | 92 |
| 96 // Creates a desktop session and assigns a unique ID to it. | 93 // Creates a desktop session and assigns a unique ID to it. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 std::unique_ptr<HostEventLogger> host_event_logger_; | 183 std::unique_ptr<HostEventLogger> host_event_logger_; |
| 187 | 184 |
| 188 base::WeakPtrFactory<DaemonProcess> weak_factory_; | 185 base::WeakPtrFactory<DaemonProcess> weak_factory_; |
| 189 | 186 |
| 190 DISALLOW_COPY_AND_ASSIGN(DaemonProcess); | 187 DISALLOW_COPY_AND_ASSIGN(DaemonProcess); |
| 191 }; | 188 }; |
| 192 | 189 |
| 193 } // namespace remoting | 190 } // namespace remoting |
| 194 | 191 |
| 195 #endif // REMOTING_HOST_DAEMON_PROCESS_H_ | 192 #endif // REMOTING_HOST_DAEMON_PROCESS_H_ |
| OLD | NEW |