| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 stopping_recorders_(0), | 74 stopping_recorders_(0), |
| 75 state_(kInitial), | 75 state_(kInitial), |
| 76 protocol_config_(protocol::CandidateSessionConfig::CreateDefault()), | 76 protocol_config_(protocol::CandidateSessionConfig::CreateDefault()), |
| 77 login_backoff_(&kDefaultBackoffPolicy), | 77 login_backoff_(&kDefaultBackoffPolicy), |
| 78 authenticating_client_(false), | 78 authenticating_client_(false), |
| 79 reject_authenticating_client_(false) { | 79 reject_authenticating_client_(false) { |
| 80 DCHECK(context_); | 80 DCHECK(context_); |
| 81 DCHECK(signal_strategy); | 81 DCHECK(signal_strategy); |
| 82 DCHECK(desktop_environment_); | 82 DCHECK(desktop_environment_); |
| 83 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 83 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
| 84 |
| 85 if (!desktop_environment_->audio_capturer()) { |
| 86 // Disable audio by replacing our list of supported audio configurations |
| 87 // with the NONE config. |
| 88 protocol_config_->mutable_audio_configs()->clear(); |
| 89 protocol_config_->mutable_audio_configs()->push_back( |
| 90 protocol::ChannelConfig(protocol::ChannelConfig::TRANSPORT_NONE, |
| 91 protocol::kDefaultStreamVersion, |
| 92 protocol::ChannelConfig::CODEC_VERBATIM)); |
| 93 } |
| 84 } | 94 } |
| 85 | 95 |
| 86 ChromotingHost::~ChromotingHost() { | 96 ChromotingHost::~ChromotingHost() { |
| 87 DCHECK(clients_.empty()); | 97 DCHECK(clients_.empty()); |
| 88 } | 98 } |
| 89 | 99 |
| 90 void ChromotingHost::Start() { | 100 void ChromotingHost::Start() { |
| 91 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 101 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
| 92 | 102 |
| 93 LOG(INFO) << "Starting host"; | 103 LOG(INFO) << "Starting host"; |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 OnShutdown()); | 498 OnShutdown()); |
| 489 | 499 |
| 490 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); | 500 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); |
| 491 it != shutdown_tasks_.end(); ++it) { | 501 it != shutdown_tasks_.end(); ++it) { |
| 492 it->Run(); | 502 it->Run(); |
| 493 } | 503 } |
| 494 shutdown_tasks_.clear(); | 504 shutdown_tasks_.clear(); |
| 495 } | 505 } |
| 496 | 506 |
| 497 } // namespace remoting | 507 } // namespace remoting |
| OLD | NEW |