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

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

Issue 902613004: Fix ConnectionToClient to connect stubs only after authentication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_pump
Patch Set: Created 5 years, 10 months 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 | « no previous file | remoting/host/client_session.cc » ('j') | remoting/host/client_session.cc » ('J')
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_CLIENT_SESSION_H_ 5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_
6 #define REMOTING_HOST_CLIENT_SESSION_H_ 6 #define REMOTING_HOST_CLIENT_SESSION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; 134 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override;
135 void SetDisableInputs(bool disable_inputs) override; 135 void SetDisableInputs(bool disable_inputs) override;
136 void ResetVideoPipeline() override; 136 void ResetVideoPipeline() override;
137 137
138 void SetGnubbyAuthHandlerForTesting(GnubbyAuthHandler* gnubby_auth_handler); 138 void SetGnubbyAuthHandlerForTesting(GnubbyAuthHandler* gnubby_auth_handler);
139 139
140 protocol::ConnectionToClient* connection() const { 140 protocol::ConnectionToClient* connection() const {
141 return connection_.get(); 141 return connection_.get();
142 } 142 }
143 143
144 bool is_authenticated() { return auth_input_filter_.enabled(); } 144 bool is_authenticated() { return is_authenticated_; }
145 145
146 const std::string* client_capabilities() const { 146 const std::string* client_capabilities() const {
147 return client_capabilities_.get(); 147 return client_capabilities_.get();
148 } 148 }
149 149
150 private: 150 private:
151 // Creates a proxy for sending clipboard events to the client. 151 // Creates a proxy for sending clipboard events to the client.
152 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); 152 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy();
153 153
154 EventHandler* event_handler_; 154 EventHandler* event_handler_;
(...skipping 23 matching lines...) Expand all
178 178
179 // Filter to used to stop clipboard items sent from the client being echoed 179 // Filter to used to stop clipboard items sent from the client being echoed
180 // back to it. It is the final element in the clipboard (client -> host) 180 // back to it. It is the final element in the clipboard (client -> host)
181 // pipeline. 181 // pipeline.
182 protocol::ClipboardEchoFilter clipboard_echo_filter_; 182 protocol::ClipboardEchoFilter clipboard_echo_filter_;
183 183
184 // Filters used to manage enabling & disabling of input & clipboard. 184 // Filters used to manage enabling & disabling of input & clipboard.
185 protocol::InputFilter disable_input_filter_; 185 protocol::InputFilter disable_input_filter_;
186 protocol::ClipboardFilter disable_clipboard_filter_; 186 protocol::ClipboardFilter disable_clipboard_filter_;
187 187
188 // Filters used to disable input & clipboard when we're not authenticated.
189 protocol::InputFilter auth_input_filter_;
190 protocol::ClipboardFilter auth_clipboard_filter_;
191
192 // Factory for weak pointers to the client clipboard stub. 188 // Factory for weak pointers to the client clipboard stub.
193 // This must appear after |clipboard_echo_filter_|, so that it won't outlive 189 // This must appear after |clipboard_echo_filter_|, so that it won't outlive
194 // it. 190 // it.
195 base::WeakPtrFactory<protocol::ClipboardStub> client_clipboard_factory_; 191 base::WeakPtrFactory<protocol::ClipboardStub> client_clipboard_factory_;
196 192
197 // The maximum duration of this session. 193 // The maximum duration of this session.
198 // There is no maximum if this value is <= 0. 194 // There is no maximum if this value is <= 0.
199 base::TimeDelta max_duration_; 195 base::TimeDelta max_duration_;
200 196
201 // A timer that triggers a disconnect when the maximum session duration 197 // A timer that triggers a disconnect when the maximum session duration
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 229
234 // The pairing registry for PIN-less authentication. 230 // The pairing registry for PIN-less authentication.
235 scoped_refptr<protocol::PairingRegistry> pairing_registry_; 231 scoped_refptr<protocol::PairingRegistry> pairing_registry_;
236 232
237 // Used to proxy gnubby auth traffic. 233 // Used to proxy gnubby auth traffic.
238 scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_; 234 scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_;
239 235
240 // Used to manage extension functionality. 236 // Used to manage extension functionality.
241 scoped_ptr<HostExtensionSessionManager> extension_manager_; 237 scoped_ptr<HostExtensionSessionManager> extension_manager_;
242 238
239 bool is_authenticated_;
Wez 2015/02/07 00:40:43 nit: Add a comment to clarify that this is true if
Sergey Ulanov 2015/02/13 19:40:21 Done.
240
243 // Used to store video channel pause & lossless parameters. 241 // Used to store video channel pause & lossless parameters.
244 bool pause_video_; 242 bool pause_video_;
245 bool lossless_video_encode_; 243 bool lossless_video_encode_;
246 bool lossless_video_color_; 244 bool lossless_video_color_;
247 245
248 // Used to disable callbacks to |this| once DisconnectSession() has been 246 // Used to disable callbacks to |this| once DisconnectSession() has been
249 // called. 247 // called.
250 base::WeakPtrFactory<ClientSessionControl> weak_factory_; 248 base::WeakPtrFactory<ClientSessionControl> weak_factory_;
251 249
252 DISALLOW_COPY_AND_ASSIGN(ClientSession); 250 DISALLOW_COPY_AND_ASSIGN(ClientSession);
253 }; 251 };
254 252
255 } // namespace remoting 253 } // namespace remoting
256 254
257 #endif // REMOTING_HOST_CLIENT_SESSION_H_ 255 #endif // REMOTING_HOST_CLIENT_SESSION_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/host/client_session.cc » ('j') | remoting/host/client_session.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698