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/protocol/connection_to_host.h" | 5 #include "remoting/protocol/connection_to_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/location.h" | 9 #include "base/location.h" |
10 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const buzz::XmlElement* stanza) { | 122 const buzz::XmlElement* stanza) { |
123 return false; | 123 return false; |
124 } | 124 } |
125 | 125 |
126 void ConnectionToHost::OnSessionManagerReady() { | 126 void ConnectionToHost::OnSessionManagerReady() { |
127 DCHECK(CalledOnValidThread()); | 127 DCHECK(CalledOnValidThread()); |
128 | 128 |
129 // After SessionManager is initialized we can try to connect to the host. | 129 // After SessionManager is initialized we can try to connect to the host. |
130 scoped_ptr<CandidateSessionConfig> candidate_config = | 130 scoped_ptr<CandidateSessionConfig> candidate_config = |
131 CandidateSessionConfig::CreateDefault(); | 131 CandidateSessionConfig::CreateDefault(); |
132 if (!audio_stub_) | 132 if (!audio_stub_) { |
133 CandidateSessionConfig::DisableAudioChannel(candidate_config.get()); | 133 candidate_config->DisableAudioChannel(); |
| 134 } |
134 | 135 |
135 session_ = session_manager_->Connect( | 136 session_ = session_manager_->Connect( |
136 host_jid_, authenticator_.Pass(), candidate_config.Pass()); | 137 host_jid_, authenticator_.Pass(), candidate_config.Pass()); |
137 session_->SetEventHandler(this); | 138 session_->SetEventHandler(this); |
138 } | 139 } |
139 | 140 |
140 void ConnectionToHost::OnIncomingSession( | 141 void ConnectionToHost::OnIncomingSession( |
141 Session* session, | 142 Session* session, |
142 SessionManager::IncomingSessionResponse* response) { | 143 SessionManager::IncomingSessionResponse* response) { |
143 DCHECK(CalledOnValidThread()); | 144 DCHECK(CalledOnValidThread()); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 279 |
279 if (state != state_) { | 280 if (state != state_) { |
280 state_ = state; | 281 state_ = state; |
281 error_ = error; | 282 error_ = error; |
282 event_callback_->OnConnectionState(state_, error_); | 283 event_callback_->OnConnectionState(state_, error_); |
283 } | 284 } |
284 } | 285 } |
285 | 286 |
286 } // namespace protocol | 287 } // namespace protocol |
287 } // namespace remoting | 288 } // namespace remoting |
OLD | NEW |