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

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

Issue 2451953002: Use ChannelMojo between the remoting network and desktop processes. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « remoting/host/desktop_process_unittest.cc ('k') | remoting/host/desktop_session_agent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SESSION_AGENT_H_ 5 #ifndef REMOTING_HOST_DESKTOP_SESSION_AGENT_H_
6 #define REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ 6 #define REMOTING_HOST_DESKTOP_SESSION_AGENT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 13
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "ipc/ipc_listener.h" 19 #include "ipc/ipc_listener.h"
20 #include "ipc/ipc_platform_file.h" 20 #include "mojo/public/cpp/system/message_pipe.h"
21 #include "remoting/host/client_session_control.h" 21 #include "remoting/host/client_session_control.h"
22 #include "remoting/protocol/clipboard_stub.h" 22 #include "remoting/protocol/clipboard_stub.h"
23 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" 23 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
24 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" 24 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
25 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" 25 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
26 26
27 namespace IPC { 27 namespace IPC {
28 class ChannelProxy; 28 class ChannelProxy;
29 class Message; 29 class Message;
30 } // namespace IPC 30 } // namespace IPC
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const webrtc::DesktopVector& position) override; 87 const webrtc::DesktopVector& position) override;
88 88
89 // Forwards a local clipboard event though the IPC channel to the network 89 // Forwards a local clipboard event though the IPC channel to the network
90 // process. 90 // process.
91 void InjectClipboardEvent(const protocol::ClipboardEvent& event); 91 void InjectClipboardEvent(const protocol::ClipboardEvent& event);
92 92
93 // Forwards an audio packet though the IPC channel to the network process. 93 // Forwards an audio packet though the IPC channel to the network process.
94 void ProcessAudioPacket(std::unique_ptr<AudioPacket> packet); 94 void ProcessAudioPacket(std::unique_ptr<AudioPacket> packet);
95 95
96 // Creates desktop integration components and a connected IPC channel to be 96 // Creates desktop integration components and a connected IPC channel to be
97 // used to access them. The client end of the channel is returned in 97 // used to access them. The client end of the channel is returned.
98 // the variable pointed by |desktop_pipe_out|. 98 mojo::ScopedMessagePipeHandle Start(const base::WeakPtr<Delegate>& delegate);
99 bool Start(const base::WeakPtr<Delegate>& delegate,
100 IPC::PlatformFileForTransit* desktop_pipe_out);
101 99
102 // Stops the agent asynchronously. 100 // Stops the agent asynchronously.
103 void Stop(); 101 void Stop();
104 102
105 protected: 103 protected:
106 friend class base::RefCountedThreadSafe<DesktopSessionAgent>; 104 friend class base::RefCountedThreadSafe<DesktopSessionAgent>;
107 105
108 ~DesktopSessionAgent() override; 106 ~DesktopSessionAgent() override;
109 107
110 // ClientSessionControl interface. 108 // ClientSessionControl interface.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 170
173 // Filter used to disable remote inputs during local input activity. 171 // Filter used to disable remote inputs during local input activity.
174 std::unique_ptr<RemoteInputFilter> remote_input_filter_; 172 std::unique_ptr<RemoteInputFilter> remote_input_filter_;
175 173
176 // Used to apply client-requested changes in screen resolution. 174 // Used to apply client-requested changes in screen resolution.
177 std::unique_ptr<ScreenControls> screen_controls_; 175 std::unique_ptr<ScreenControls> screen_controls_;
178 176
179 // IPC channel connecting the desktop process with the network process. 177 // IPC channel connecting the desktop process with the network process.
180 std::unique_ptr<IPC::ChannelProxy> network_channel_; 178 std::unique_ptr<IPC::ChannelProxy> network_channel_;
181 179
182 // The client end of the network-to-desktop pipe. It is kept alive until
183 // the network process connects to the pipe.
184 base::File desktop_pipe_;
185
186 // True if the desktop session agent has been started. 180 // True if the desktop session agent has been started.
187 bool started_ = false; 181 bool started_ = false;
188 182
189 // Captures the screen. 183 // Captures the screen.
190 std::unique_ptr<webrtc::DesktopCapturer> video_capturer_; 184 std::unique_ptr<webrtc::DesktopCapturer> video_capturer_;
191 185
192 // Captures mouse shapes. 186 // Captures mouse shapes.
193 std::unique_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor_; 187 std::unique_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor_;
194 188
195 // Keep reference to the last frame sent to make sure shared buffer is alive 189 // Keep reference to the last frame sent to make sure shared buffer is alive
196 // before it's received. 190 // before it's received.
197 std::unique_ptr<webrtc::DesktopFrame> last_frame_; 191 std::unique_ptr<webrtc::DesktopFrame> last_frame_;
198 192
199 // Used to disable callbacks to |this|. 193 // Used to disable callbacks to |this|.
200 base::WeakPtrFactory<DesktopSessionAgent> weak_factory_; 194 base::WeakPtrFactory<DesktopSessionAgent> weak_factory_;
201 195
202 DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent); 196 DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent);
203 }; 197 };
204 198
205 } // namespace remoting 199 } // namespace remoting
206 200
207 #endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ 201 #endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_
OLDNEW
« no previous file with comments | « remoting/host/desktop_process_unittest.cc ('k') | remoting/host/desktop_session_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698