| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 authenticator_ = authenticator.Pass(); | 85 authenticator_ = authenticator.Pass(); |
| 86 | 86 |
| 87 // Save jid of the host. The actual connection is created later after | 87 // Save jid of the host. The actual connection is created later after |
| 88 // |signal_strategy_| is connected. | 88 // |signal_strategy_| is connected. |
| 89 host_jid_ = host_jid; | 89 host_jid_ = host_jid; |
| 90 host_public_key_ = host_public_key; | 90 host_public_key_ = host_public_key; |
| 91 | 91 |
| 92 signal_strategy_->AddListener(this); | 92 signal_strategy_->AddListener(this); |
| 93 signal_strategy_->Connect(); | 93 signal_strategy_->Connect(); |
| 94 | 94 |
| 95 session_manager_.reset(new JingleSessionManager( | 95 session_manager_.reset(new JingleSessionManager(transport_factory.Pass())); |
| 96 transport_factory.Pass(), allow_nat_traversal_)); | |
| 97 session_manager_->Init(signal_strategy_, this); | 96 session_manager_->Init(signal_strategy_, this); |
| 98 | 97 |
| 99 SetState(CONNECTING, OK); | 98 SetState(CONNECTING, OK); |
| 100 } | 99 } |
| 101 | 100 |
| 102 const SessionConfig& ConnectionToHost::config() { | 101 const SessionConfig& ConnectionToHost::config() { |
| 103 return session_->config(); | 102 return session_->config(); |
| 104 } | 103 } |
| 105 | 104 |
| 106 void ConnectionToHost::OnSignalStrategyStateChange( | 105 void ConnectionToHost::OnSignalStrategyStateChange( |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 282 |
| 284 if (state != state_) { | 283 if (state != state_) { |
| 285 state_ = state; | 284 state_ = state; |
| 286 error_ = error; | 285 error_ = error; |
| 287 event_callback_->OnConnectionState(state_, error_); | 286 event_callback_->OnConnectionState(state_, error_); |
| 288 } | 287 } |
| 289 } | 288 } |
| 290 | 289 |
| 291 } // namespace protocol | 290 } // namespace protocol |
| 292 } // namespace remoting | 291 } // namespace remoting |
| OLD | NEW |