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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_)); |
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_)); | 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 = | 279 ClientSession* client = new ClientSession( |
280 new ClientSession(this, audio_task_runner_, std::move(connection), | 280 this, std::move(connection), desktop_environment_factory_, |
281 desktop_environment_factory_, max_session_duration_, | 281 max_session_duration_, pairing_registry_, extensions_.get()); |
282 pairing_registry_, extensions_.get()); | |
283 | 282 |
284 clients_.push_back(client); | 283 clients_.push_back(client); |
285 } | 284 } |
286 | 285 |
287 void ChromotingHost::DisconnectAllClients() { | 286 void ChromotingHost::DisconnectAllClients() { |
288 DCHECK(CalledOnValidThread()); | 287 DCHECK(CalledOnValidThread()); |
289 | 288 |
290 while (!clients_.empty()) { | 289 while (!clients_.empty()) { |
291 size_t size = clients_.size(); | 290 size_t size = clients_.size(); |
292 clients_.front()->DisconnectSession(protocol::OK); | 291 clients_.front()->DisconnectSession(protocol::OK); |
293 CHECK_EQ(clients_.size(), size - 1); | 292 CHECK_EQ(clients_.size(), size - 1); |
294 } | 293 } |
295 } | 294 } |
296 | 295 |
297 } // namespace remoting | 296 } // namespace remoting |
OLD | NEW |