Chromium Code Reviews| 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 <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 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 "ipc/ipc_listener.h" | 18 #include "ipc/ipc_listener.h" |
| 19 #include "mojo/public/cpp/system/message_pipe.h" | |
| 19 #include "remoting/host/desktop_session_agent.h" | 20 #include "remoting/host/desktop_session_agent.h" |
| 20 | 21 |
| 21 namespace IPC { | 22 namespace IPC { |
| 22 class ChannelProxy; | 23 class ChannelProxy; |
| 23 } // namespace IPC | 24 } // namespace IPC |
| 24 | 25 |
| 25 namespace remoting { | 26 namespace remoting { |
| 26 | 27 |
| 27 class AutoThreadTaskRunner; | 28 class AutoThreadTaskRunner; |
| 28 class DesktopEnvironment; | 29 class DesktopEnvironment; |
| 29 class DesktopEnvironmentFactory; | 30 class DesktopEnvironmentFactory; |
| 30 class DesktopSessionAgent; | 31 class DesktopSessionAgent; |
| 31 | 32 |
| 32 class DesktopProcess : public DesktopSessionAgent::Delegate, | 33 class DesktopProcess : public DesktopSessionAgent::Delegate, |
| 33 public IPC::Listener, | 34 public IPC::Listener, |
| 34 public base::SupportsWeakPtr<DesktopProcess> { | 35 public base::SupportsWeakPtr<DesktopProcess> { |
| 35 public: | 36 public: |
| 36 DesktopProcess( | 37 DesktopProcess(scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 37 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 38 scoped_refptr<AutoThreadTaskRunner> input_task_runner, |
| 38 scoped_refptr<AutoThreadTaskRunner> input_task_runner, | 39 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 39 const std::string& daemon_channel_name); | 40 mojo::ScopedMessagePipeHandle daemon_channel_handle); |
| 40 ~DesktopProcess() override; | 41 ~DesktopProcess() override; |
| 41 | 42 |
| 42 // DesktopSessionAgent::Delegate implementation. | 43 // DesktopSessionAgent::Delegate implementation. |
| 43 DesktopEnvironmentFactory& desktop_environment_factory() override; | 44 DesktopEnvironmentFactory& desktop_environment_factory() override; |
| 44 void OnNetworkProcessDisconnected() override; | 45 void OnNetworkProcessDisconnected() override; |
| 45 | 46 |
| 46 // IPC::Listener implementation. | 47 // IPC::Listener implementation. |
| 47 bool OnMessageReceived(const IPC::Message& message) override; | 48 bool OnMessageReceived(const IPC::Message& message) override; |
| 48 void OnChannelConnected(int32_t peer_pid) override; | 49 void OnChannelConnected(int32_t peer_pid) override; |
| 49 void OnChannelError() override; | 50 void OnChannelError() override; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 66 void OnCrash(const std::string& function_name, | 67 void OnCrash(const std::string& function_name, |
| 67 const std::string& file_name, | 68 const std::string& file_name, |
| 68 const int& line_number); | 69 const int& line_number); |
| 69 | 70 |
| 70 // Task runner on which public methods of this class should be called. | 71 // Task runner on which public methods of this class should be called. |
| 71 scoped_refptr<AutoThreadTaskRunner> caller_task_runner_; | 72 scoped_refptr<AutoThreadTaskRunner> caller_task_runner_; |
| 72 | 73 |
| 73 // Used to run input-related tasks. | 74 // Used to run input-related tasks. |
| 74 scoped_refptr<AutoThreadTaskRunner> input_task_runner_; | 75 scoped_refptr<AutoThreadTaskRunner> input_task_runner_; |
| 75 | 76 |
| 77 // Used for IPC. | |
|
joedow
2016/10/26 21:48:20
nit: perhaps make this a bit more verbose: "Used f
Sam McNally
2016/10/27 00:43:46
Done.
| |
| 78 scoped_refptr<AutoThreadTaskRunner> io_task_runner_; | |
| 79 | |
| 76 // Factory used to create integration components for use by |desktop_agent_|. | 80 // Factory used to create integration components for use by |desktop_agent_|. |
| 77 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; | 81 std::unique_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; |
| 78 | 82 |
| 79 // Name of the IPC channel connecting the desktop process with the daemon | 83 // Handle for the IPC channel connecting the desktop process with the daemon |
| 80 // process. | 84 // process. |
| 81 std::string daemon_channel_name_; | 85 mojo::ScopedMessagePipeHandle daemon_channel_handle_; |
| 82 | 86 |
| 83 // IPC channel connecting the desktop process with the daemon process. | 87 // IPC channel connecting the desktop process with the daemon process. |
| 84 std::unique_ptr<IPC::ChannelProxy> daemon_channel_; | 88 std::unique_ptr<IPC::ChannelProxy> daemon_channel_; |
| 85 | 89 |
| 86 // Provides screen/audio capturing and input injection services for | 90 // Provides screen/audio capturing and input injection services for |
| 87 // the network process. | 91 // the network process. |
| 88 scoped_refptr<DesktopSessionAgent> desktop_agent_; | 92 scoped_refptr<DesktopSessionAgent> desktop_agent_; |
| 89 | 93 |
| 90 DISALLOW_COPY_AND_ASSIGN(DesktopProcess); | 94 DISALLOW_COPY_AND_ASSIGN(DesktopProcess); |
| 91 }; | 95 }; |
| 92 | 96 |
| 93 } // namespace remoting | 97 } // namespace remoting |
| 94 | 98 |
| 95 #endif // REMOTING_HOST_DESKTOP_PROCESS_H_ | 99 #endif // REMOTING_HOST_DESKTOP_PROCESS_H_ |
| OLD | NEW |