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

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

Issue 7635005: Properly handle screen recorder shutdown in ChromotingHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/host/chromoting_host.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_CHROMOTING_HOST_H_ 5 #ifndef REMOTING_CHROMOTING_HOST_H_
6 #define REMOTING_CHROMOTING_HOST_H_ 6 #define REMOTING_CHROMOTING_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 std::string GenerateHostAuthToken(const std::string& encoded_client_token); 176 std::string GenerateHostAuthToken(const std::string& encoded_client_token);
177 177
178 int AuthenticatedClientsCount() const; 178 int AuthenticatedClientsCount() const;
179 179
180 void EnableCurtainMode(bool enable); 180 void EnableCurtainMode(bool enable);
181 181
182 void ProcessPreAuthentication( 182 void ProcessPreAuthentication(
183 const scoped_refptr<protocol::ConnectionToClient>& connection); 183 const scoped_refptr<protocol::ConnectionToClient>& connection);
184 184
185 void StopScreenRecorder();
186 void OnScreenRecorderStopped();
187
185 // The following methods are called during shutdown. 188 // The following methods are called during shutdown.
186 void ShutdownNetwork(); 189 void ShutdownNetwork();
187 void ShutdownRecorder(); 190 void ShutdownRecorder();
188 void ShutdownFinish(); 191 void ShutdownFinish();
189 192
190 // Parameters specified when the host was created. 193 // Parameters specified when the host was created.
191 ChromotingHostContext* context_; 194 ChromotingHostContext* context_;
192 DesktopEnvironment* desktop_environment_; 195 DesktopEnvironment* desktop_environment_;
193 scoped_refptr<MutableHostConfig> config_; 196 scoped_refptr<MutableHostConfig> config_;
194 scoped_ptr<AccessVerifier> access_verifier_; 197 scoped_ptr<AccessVerifier> access_verifier_;
(...skipping 10 matching lines...) Expand all
205 ClientList clients_; 208 ClientList clients_;
206 209
207 // Session manager for the host process. 210 // Session manager for the host process.
208 scoped_refptr<ScreenRecorder> recorder_; 211 scoped_refptr<ScreenRecorder> recorder_;
209 212
210 // Tracks the internal state of the host. 213 // Tracks the internal state of the host.
211 // This variable is written on the main thread of ChromotingHostContext 214 // This variable is written on the main thread of ChromotingHostContext
212 // and read by jingle thread. 215 // and read by jingle thread.
213 State state_; 216 State state_;
214 217
218 // Number of screen recorders that are currently being
219 // stopped. Normally set to 0 or 1, but in some cases it may be
220 // greater than 1, particularly if when second client can connect
221 // immidiately after previous one disconnected.
222 int stopping_recorders_;
223
215 // Lock is to lock the access to |state_|. 224 // Lock is to lock the access to |state_|.
216 base::Lock lock_; 225 base::Lock lock_;
217 226
218 // Configuration of the protocol. 227 // Configuration of the protocol.
219 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; 228 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_;
220 229
221 bool is_curtained_; 230 bool is_curtained_;
222 231
223 // Whether or not the host is running in "IT2Me" mode, in which connections 232 // Whether or not the host is running in "IT2Me" mode, in which connections
224 // are pre-authenticated, and hence the local login challenge can be bypassed. 233 // are pre-authenticated, and hence the local login challenge can be bypassed.
225 bool is_it2me_; 234 bool is_it2me_;
226 235
227 std::string access_code_; 236 std::string access_code_;
228 237
229 // Stores list of tasks that should be executed when we finish 238 // Stores list of tasks that should be executed when we finish
230 // shutdown. Used only while |state_| is set to kStopping. 239 // shutdown. Used only while |state_| is set to kStopping.
231 std::vector<Task*> shutdown_tasks_; 240 std::vector<Task*> shutdown_tasks_;
232 241
233 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); 242 DISALLOW_COPY_AND_ASSIGN(ChromotingHost);
234 }; 243 };
235 244
236 } // namespace remoting 245 } // namespace remoting
237 246
238 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ 247 #endif // REMOTING_HOST_CHROMOTING_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/host/chromoting_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698