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_DESKTOP_PROCESS_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_PROCESS_H_ |
6 #define REMOTING_HOST_DESKTOP_PROCESS_H_ | 6 #define REMOTING_HOST_DESKTOP_PROCESS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "ipc/ipc_listener.h" | 18 #include "ipc/ipc_listener.h" |
19 #include "remoting/host/desktop_session_agent.h" | 19 #include "remoting/host/desktop_session_agent.h" |
20 | 20 |
21 namespace IPC { | 21 namespace IPC { |
22 class ChannelProxy; | 22 class ChannelProxy; |
23 } // namespace IPC | 23 } // namespace IPC |
24 | 24 |
25 namespace remoting { | 25 namespace remoting { |
26 | 26 |
(...skipping 19 matching lines...) Expand all Loading... |
46 // IPC::Listener implementation. | 46 // IPC::Listener implementation. |
47 bool OnMessageReceived(const IPC::Message& message) override; | 47 bool OnMessageReceived(const IPC::Message& message) override; |
48 void OnChannelConnected(int32_t peer_pid) override; | 48 void OnChannelConnected(int32_t peer_pid) override; |
49 void OnChannelError() override; | 49 void OnChannelError() override; |
50 | 50 |
51 // Injects Secure Attention Sequence. | 51 // Injects Secure Attention Sequence. |
52 void InjectSas(); | 52 void InjectSas(); |
53 | 53 |
54 // Creates the desktop agent and required threads and IPC channels. Returns | 54 // Creates the desktop agent and required threads and IPC channels. Returns |
55 // true on success. | 55 // true on success. |
56 bool Start(scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory); | 56 bool Start( |
| 57 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory); |
57 | 58 |
58 private: | 59 private: |
59 // Crashes the process in response to a daemon's request. The daemon passes | 60 // Crashes the process in response to a daemon's request. The daemon passes |
60 // the location of the code that detected the fatal error resulted in this | 61 // the location of the code that detected the fatal error resulted in this |
61 // request. See the declaration of ChromotingDaemonMsg_Crash message. | 62 // request. See the declaration of ChromotingDaemonMsg_Crash message. |
62 void OnCrash(const std::string& function_name, | 63 void OnCrash(const std::string& function_name, |
63 const std::string& file_name, | 64 const std::string& file_name, |
64 const int& line_number); | 65 const int& line_number); |
65 | 66 |
66 // Task runner on which public methods of this class should be called. | 67 // Task runner on which public methods of this class should be called. |
67 scoped_refptr<AutoThreadTaskRunner> caller_task_runner_; | 68 scoped_refptr<AutoThreadTaskRunner> caller_task_runner_; |
68 | 69 |
69 // Used to run input-related tasks. | 70 // Used to run input-related tasks. |
70 scoped_refptr<AutoThreadTaskRunner> input_task_runner_; | 71 scoped_refptr<AutoThreadTaskRunner> input_task_runner_; |
71 | 72 |
72 // Factory used to create integration components for use by |desktop_agent_|. | 73 // Factory used to create integration components for use by |desktop_agent_|. |
73 scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; | 74 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; |
74 | 75 |
75 // Name of the IPC channel connecting the desktop process with the daemon | 76 // Name of the IPC channel connecting the desktop process with the daemon |
76 // process. | 77 // process. |
77 std::string daemon_channel_name_; | 78 std::string daemon_channel_name_; |
78 | 79 |
79 // IPC channel connecting the desktop process with the daemon process. | 80 // IPC channel connecting the desktop process with the daemon process. |
80 scoped_ptr<IPC::ChannelProxy> daemon_channel_; | 81 std::unique_ptr<IPC::ChannelProxy> daemon_channel_; |
81 | 82 |
82 // Provides screen/audio capturing and input injection services for | 83 // Provides screen/audio capturing and input injection services for |
83 // the network process. | 84 // the network process. |
84 scoped_refptr<DesktopSessionAgent> desktop_agent_; | 85 scoped_refptr<DesktopSessionAgent> desktop_agent_; |
85 | 86 |
86 DISALLOW_COPY_AND_ASSIGN(DesktopProcess); | 87 DISALLOW_COPY_AND_ASSIGN(DesktopProcess); |
87 }; | 88 }; |
88 | 89 |
89 } // namespace remoting | 90 } // namespace remoting |
90 | 91 |
91 #endif // REMOTING_HOST_DESKTOP_PROCESS_H_ | 92 #endif // REMOTING_HOST_DESKTOP_PROCESS_H_ |
OLD | NEW |