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 #include "remoting/host/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 *response = protocol::SessionManager::OVERLOAD; | 268 *response = protocol::SessionManager::OVERLOAD; |
269 return; | 269 return; |
270 } | 270 } |
271 | 271 |
272 *response = protocol::SessionManager::ACCEPT; | 272 *response = protocol::SessionManager::ACCEPT; |
273 | 273 |
274 HOST_LOG << "Client connected: " << session->jid(); | 274 HOST_LOG << "Client connected: " << session->jid(); |
275 | 275 |
276 // Create a client object. | 276 // Create a client object. |
277 scoped_ptr<protocol::ConnectionToClient> connection( | 277 scoped_ptr<protocol::ConnectionToClient> connection( |
278 new protocol::IceConnectionToClient(make_scoped_ptr(session))); | 278 new protocol::IceConnectionToClient(make_scoped_ptr(session), |
| 279 video_encode_task_runner_)); |
279 ClientSession* client = new ClientSession( | 280 ClientSession* client = new ClientSession( |
280 this, | 281 this, |
281 audio_task_runner_, | 282 audio_task_runner_, |
282 input_task_runner_, | 283 input_task_runner_, |
283 video_capture_task_runner_, | 284 video_capture_task_runner_, |
284 video_encode_task_runner_, | 285 video_encode_task_runner_, |
285 network_task_runner_, | 286 network_task_runner_, |
286 ui_task_runner_, | 287 ui_task_runner_, |
287 connection.Pass(), | 288 connection.Pass(), |
288 desktop_environment_factory_, | 289 desktop_environment_factory_, |
289 max_session_duration_, | 290 max_session_duration_, |
290 pairing_registry_, | 291 pairing_registry_, |
291 extensions_.get()); | 292 extensions_.get()); |
292 | 293 |
293 clients_.push_back(client); | 294 clients_.push_back(client); |
294 } | 295 } |
295 | 296 |
296 void ChromotingHost::DisconnectAllClients() { | 297 void ChromotingHost::DisconnectAllClients() { |
297 DCHECK(CalledOnValidThread()); | 298 DCHECK(CalledOnValidThread()); |
298 | 299 |
299 while (!clients_.empty()) { | 300 while (!clients_.empty()) { |
300 size_t size = clients_.size(); | 301 size_t size = clients_.size(); |
301 clients_.front()->DisconnectSession(protocol::OK); | 302 clients_.front()->DisconnectSession(protocol::OK); |
302 CHECK_EQ(clients_.size(), size - 1); | 303 CHECK_EQ(clients_.size(), size - 1); |
303 } | 304 } |
304 } | 305 } |
305 | 306 |
306 } // namespace remoting | 307 } // namespace remoting |
OLD | NEW |