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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 video_encode_task_runner_(video_encode_task_runner), | 77 video_encode_task_runner_(video_encode_task_runner), |
78 network_task_runner_(network_task_runner), | 78 network_task_runner_(network_task_runner), |
79 ui_task_runner_(ui_task_runner), | 79 ui_task_runner_(ui_task_runner), |
80 signal_strategy_(signal_strategy), | 80 signal_strategy_(signal_strategy), |
81 started_(false), | 81 started_(false), |
82 protocol_config_(protocol::CandidateSessionConfig::CreateDefault()), | 82 protocol_config_(protocol::CandidateSessionConfig::CreateDefault()), |
83 login_backoff_(&kDefaultBackoffPolicy), | 83 login_backoff_(&kDefaultBackoffPolicy), |
84 authenticating_client_(false), | 84 authenticating_client_(false), |
85 reject_authenticating_client_(false), | 85 reject_authenticating_client_(false), |
86 enable_curtaining_(false), | 86 enable_curtaining_(false), |
87 weak_factory_(this) { | 87 weak_factory_(this), |
| 88 enable_cast_(false) { |
88 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 89 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
89 DCHECK(signal_strategy); | 90 DCHECK(signal_strategy); |
90 | 91 |
91 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | 92 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
92 | 93 |
93 if (!desktop_environment_factory_->SupportsAudioCapture()) { | 94 if (!desktop_environment_factory_->SupportsAudioCapture()) { |
94 protocol_config_->DisableAudioChannel(); | 95 protocol_config_->DisableAudioChannel(); |
95 } | 96 } |
96 } | 97 } |
97 | 98 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 input_task_runner_, | 325 input_task_runner_, |
325 video_capture_task_runner_, | 326 video_capture_task_runner_, |
326 video_encode_task_runner_, | 327 video_encode_task_runner_, |
327 network_task_runner_, | 328 network_task_runner_, |
328 ui_task_runner_, | 329 ui_task_runner_, |
329 connection.Pass(), | 330 connection.Pass(), |
330 desktop_environment_factory_, | 331 desktop_environment_factory_, |
331 max_session_duration_, | 332 max_session_duration_, |
332 pairing_registry_); | 333 pairing_registry_); |
333 | 334 |
| 335 client->set_enable_cast(enable_cast_); |
| 336 |
334 // Registers capabilities provided by host extensions. | 337 // Registers capabilities provided by host extensions. |
335 for (HostExtensionList::iterator extension = extensions_.begin(); | 338 for (HostExtensionList::iterator extension = extensions_.begin(); |
336 extension != extensions_.end(); ++extension) { | 339 extension != extensions_.end(); ++extension) { |
337 client->AddHostCapabilities((*extension)->GetCapabilities()); | 340 client->AddHostCapabilities((*extension)->GetCapabilities()); |
338 } | 341 } |
339 | 342 |
340 clients_.push_back(client); | 343 clients_.push_back(client); |
341 } | 344 } |
342 | 345 |
343 void ChromotingHost::set_protocol_config( | 346 void ChromotingHost::set_protocol_config( |
344 scoped_ptr<protocol::CandidateSessionConfig> config) { | 347 scoped_ptr<protocol::CandidateSessionConfig> config) { |
345 DCHECK(CalledOnValidThread()); | 348 DCHECK(CalledOnValidThread()); |
346 DCHECK(config.get()); | 349 DCHECK(config.get()); |
347 DCHECK(!started_); | 350 DCHECK(!started_); |
348 protocol_config_ = config.Pass(); | 351 protocol_config_ = config.Pass(); |
349 } | 352 } |
350 | 353 |
351 void ChromotingHost::DisconnectAllClients() { | 354 void ChromotingHost::DisconnectAllClients() { |
352 DCHECK(CalledOnValidThread()); | 355 DCHECK(CalledOnValidThread()); |
353 | 356 |
354 while (!clients_.empty()) { | 357 while (!clients_.empty()) { |
355 size_t size = clients_.size(); | 358 size_t size = clients_.size(); |
356 clients_.front()->DisconnectSession(); | 359 clients_.front()->DisconnectSession(); |
357 CHECK_EQ(clients_.size(), size - 1); | 360 CHECK_EQ(clients_.size(), size - 1); |
358 } | 361 } |
359 } | 362 } |
360 | 363 |
361 } // namespace remoting | 364 } // namespace remoting |
OLD | NEW |