| 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/jingle_session_manager.h" | 5 #include "remoting/protocol/jingle_session_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "remoting/protocol/authenticator.h" | 10 #include "remoting/protocol/authenticator.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 if (message.action == JingleMessage::SESSION_INITIATE) { | 77 if (message.action == JingleMessage::SESSION_INITIATE) { |
| 78 // Description must be present in session-initiate messages. | 78 // Description must be present in session-initiate messages. |
| 79 DCHECK(message.description.get()); | 79 DCHECK(message.description.get()); |
| 80 | 80 |
| 81 SendReply(stanza, JingleMessageReply::NONE); | 81 SendReply(stanza, JingleMessageReply::NONE); |
| 82 | 82 |
| 83 scoped_ptr<Authenticator> authenticator = | 83 scoped_ptr<Authenticator> authenticator = |
| 84 authenticator_factory_->CreateAuthenticator( | 84 authenticator_factory_->CreateAuthenticator( |
| 85 signal_strategy_->GetLocalJid(), message.from, | 85 signal_strategy_->GetLocalJid(), message.from); |
| 86 message.description->authenticator_message()); | |
| 87 | 86 |
| 88 JingleSession* session = new JingleSession(this); | 87 JingleSession* session = new JingleSession(this); |
| 89 session->InitializeIncomingConnection(message, std::move(authenticator)); | 88 session->InitializeIncomingConnection(message, std::move(authenticator)); |
| 90 sessions_[session->session_id_] = session; | 89 sessions_[session->session_id_] = session; |
| 91 | 90 |
| 92 // Destroy the session if it was rejected due to incompatible protocol. | 91 // Destroy the session if it was rejected due to incompatible protocol. |
| 93 if (session->state_ != Session::ACCEPTING) { | 92 if (session->state_ != Session::ACCEPTING) { |
| 94 delete session; | 93 delete session; |
| 95 DCHECK(sessions_.find(message.sid) == sessions_.end()); | 94 DCHECK(sessions_.find(message.sid) == sessions_.end()); |
| 96 return true; | 95 return true; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 signal_strategy_->SendStanza( | 141 signal_strategy_->SendStanza( |
| 143 JingleMessageReply(error).ToXml(original_stanza)); | 142 JingleMessageReply(error).ToXml(original_stanza)); |
| 144 } | 143 } |
| 145 | 144 |
| 146 void JingleSessionManager::SessionDestroyed(JingleSession* session) { | 145 void JingleSessionManager::SessionDestroyed(JingleSession* session) { |
| 147 sessions_.erase(session->session_id_); | 146 sessions_.erase(session->session_id_); |
| 148 } | 147 } |
| 149 | 148 |
| 150 } // namespace protocol | 149 } // namespace protocol |
| 151 } // namespace remoting | 150 } // namespace remoting |
| OLD | NEW |