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

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

Issue 6282006: Add a done task to ScreenRecorder::Stop() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed comments Created 9 years, 11 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/screen_recorder.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "remoting/host/chromoting_host.h" 5 #include "remoting/host/chromoting_host.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "remoting/base/constants.h" 10 #include "remoting/base/constants.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // No-op if this object is not started yet. 114 // No-op if this object is not started yet.
115 { 115 {
116 base::AutoLock auto_lock(lock_); 116 base::AutoLock auto_lock(lock_);
117 if (state_ != kStarted) { 117 if (state_ != kStarted) {
118 state_ = kStopped; 118 state_ = kStopped;
119 return; 119 return;
120 } 120 }
121 state_ = kStopped; 121 state_ = kStopped;
122 } 122 }
123 123
124 // Tell the session to pause and then disconnect all clients. 124 // Tell the session to stop and then disconnect all clients.
125 if (recorder_.get()) { 125 if (recorder_.get()) {
126 recorder_->Pause(); 126 recorder_->Stop(NULL);
127 recorder_->RemoveAllConnections(); 127 recorder_->RemoveAllConnections();
128 } 128 }
129 129
130 // Disconnect the client. 130 // Disconnect the client.
131 if (connection_) { 131 if (connection_) {
132 connection_->Disconnect(); 132 connection_->Disconnect();
133 } 133 }
134 134
135 // Stop the heartbeat sender. 135 // Stop the heartbeat sender.
136 if (heartbeat_sender_) { 136 if (heartbeat_sender_) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 // Immediately add the connection and start the session. 176 // Immediately add the connection and start the session.
177 recorder_->AddConnection(connection); 177 recorder_->AddConnection(connection);
178 recorder_->Start(); 178 recorder_->Start();
179 VLOG(1) << "Session manager started"; 179 VLOG(1) << "Session manager started";
180 } 180 }
181 181
182 void ChromotingHost::OnClientDisconnected(ConnectionToClient* connection) { 182 void ChromotingHost::OnClientDisconnected(ConnectionToClient* connection) {
183 DCHECK_EQ(context_->main_message_loop(), MessageLoop::current()); 183 DCHECK_EQ(context_->main_message_loop(), MessageLoop::current());
184 184
185 // Remove the connection from the session manager and pause the session. 185 // Remove the connection from the session manager and stop the session.
186 // TODO(hclam): Pause only if the last connection disconnected. 186 // TODO(hclam): Stop only if the last connection disconnected.
187 if (recorder_.get()) { 187 if (recorder_.get()) {
188 recorder_->RemoveConnection(connection); 188 recorder_->RemoveConnection(connection);
189 recorder_->Pause(); 189 recorder_->Stop(NULL);
190 } 190 }
191 191
192 // Close the connection to connection just to be safe. 192 // Close the connection to connection just to be safe.
193 connection->Disconnect(); 193 connection->Disconnect();
194 194
195 // Also remove reference to ConnectionToClient from this object. 195 // Also remove reference to ConnectionToClient from this object.
196 connection_ = NULL; 196 connection_ = NULL;
197 } 197 }
198 198
199 //////////////////////////////////////////////////////////////////////////// 199 ////////////////////////////////////////////////////////////////////////////
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 return NULL; 337 return NULL;
338 } 338 }
339 339
340 std::string ChromotingHost::GenerateHostAuthToken( 340 std::string ChromotingHost::GenerateHostAuthToken(
341 const std::string& encoded_client_token) { 341 const std::string& encoded_client_token) {
342 // TODO(ajwong): Return the signature of this instead. 342 // TODO(ajwong): Return the signature of this instead.
343 return encoded_client_token; 343 return encoded_client_token;
344 } 344 }
345 345
346 } // namespace remoting 346 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/screen_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698