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

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

Issue 2254673002: Remove dependency on AudioStub in ConnectionToClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win Created 4 years, 3 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
« no previous file with comments | « remoting/host/audio_pump_unittest.cc ('k') | remoting/host/chromoting_host_unittest.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) 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
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
OLDNEW
« no previous file with comments | « remoting/host/audio_pump_unittest.cc ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698