| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 HOST_LOG << "Client connected: " << session->jid(); | 262 HOST_LOG << "Client connected: " << session->jid(); |
| 263 | 263 |
| 264 // Create either IceConnectionToClient or WebrtcConnectionToClient. | 264 // Create either IceConnectionToClient or WebrtcConnectionToClient. |
| 265 // TODO(sergeyu): Move this logic to the protocol layer. | 265 // TODO(sergeyu): Move this logic to the protocol layer. |
| 266 std::unique_ptr<protocol::ConnectionToClient> connection; | 266 std::unique_ptr<protocol::ConnectionToClient> connection; |
| 267 if (session->config().protocol() == | 267 if (session->config().protocol() == |
| 268 protocol::SessionConfig::Protocol::WEBRTC) { | 268 protocol::SessionConfig::Protocol::WEBRTC) { |
| 269 connection.reset(new protocol::WebrtcConnectionToClient( | 269 connection.reset(new protocol::WebrtcConnectionToClient( |
| 270 base::WrapUnique(session), transport_context_, | 270 base::WrapUnique(session), transport_context_, |
| 271 video_encode_task_runner_)); | 271 video_encode_task_runner_, audio_task_runner_)); |
| 272 } else { | 272 } else { |
| 273 connection.reset(new protocol::IceConnectionToClient( | 273 connection.reset(new protocol::IceConnectionToClient( |
| 274 base::WrapUnique(session), transport_context_, | 274 base::WrapUnique(session), transport_context_, |
| 275 video_encode_task_runner_, audio_task_runner_)); | 275 video_encode_task_runner_, audio_task_runner_)); |
| 276 } | 276 } |
| 277 | 277 |
| 278 // Create a ClientSession object. | 278 // Create a ClientSession object. |
| 279 ClientSession* client = new ClientSession( | 279 ClientSession* client = new ClientSession( |
| 280 this, std::move(connection), desktop_environment_factory_, | 280 this, std::move(connection), desktop_environment_factory_, |
| 281 max_session_duration_, pairing_registry_, extensions_.get()); | 281 max_session_duration_, pairing_registry_, extensions_.get()); |
| 282 | 282 |
| 283 clients_.push_back(client); | 283 clients_.push_back(client); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void ChromotingHost::DisconnectAllClients() { | 286 void ChromotingHost::DisconnectAllClients() { |
| 287 DCHECK(CalledOnValidThread()); | 287 DCHECK(CalledOnValidThread()); |
| 288 | 288 |
| 289 while (!clients_.empty()) { | 289 while (!clients_.empty()) { |
| 290 size_t size = clients_.size(); | 290 size_t size = clients_.size(); |
| 291 clients_.front()->DisconnectSession(protocol::OK); | 291 clients_.front()->DisconnectSession(protocol::OK); |
| 292 CHECK_EQ(clients_.size(), size - 1); | 292 CHECK_EQ(clients_.size(), size - 1); |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace remoting | 296 } // namespace remoting |
| OLD | NEW |