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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "remoting/jingle_glue/iq_sender.h" | 8 #include "remoting/jingle_glue/iq_sender.h" |
9 #include "remoting/jingle_glue/jingle_info_request.h" | 9 #include "remoting/jingle_glue/jingle_info_request.h" |
10 #include "remoting/jingle_glue/signal_strategy.h" | 10 #include "remoting/jingle_glue/signal_strategy.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 if (message.action == JingleMessage::SESSION_INITIATE) { | 136 if (message.action == JingleMessage::SESSION_INITIATE) { |
137 // Description must be present in session-initiate messages. | 137 // Description must be present in session-initiate messages. |
138 DCHECK(message.description.get()); | 138 DCHECK(message.description.get()); |
139 | 139 |
140 SendReply(stanza, JingleMessageReply::NONE); | 140 SendReply(stanza, JingleMessageReply::NONE); |
141 | 141 |
142 scoped_ptr<Authenticator> authenticator = | 142 scoped_ptr<Authenticator> authenticator = |
143 authenticator_factory_->CreateAuthenticator( | 143 authenticator_factory_->CreateAuthenticator( |
144 signal_strategy_->GetLocalJid(), message.from, | 144 message.from, message.description->authenticator_message()); |
145 message.description->authenticator_message()); | |
146 | 145 |
147 JingleSession* session = new JingleSession(this); | 146 JingleSession* session = new JingleSession(this); |
148 session->InitializeIncomingConnection(message, authenticator.Pass()); | 147 session->InitializeIncomingConnection(message, authenticator.Pass()); |
149 sessions_[session->session_id_] = session; | 148 sessions_[session->session_id_] = session; |
150 | 149 |
151 IncomingSessionResponse response = SessionManager::DECLINE; | 150 IncomingSessionResponse response = SessionManager::DECLINE; |
152 listener_->OnIncomingSession(session, &response); | 151 listener_->OnIncomingSession(session, &response); |
153 | 152 |
154 if (response == SessionManager::ACCEPT) { | 153 if (response == SessionManager::ACCEPT) { |
155 session->AcceptIncomingConnection(message); | 154 session->AcceptIncomingConnection(message); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 signal_strategy_->SendStanza( | 196 signal_strategy_->SendStanza( |
198 JingleMessageReply(error).ToXml(original_stanza)); | 197 JingleMessageReply(error).ToXml(original_stanza)); |
199 } | 198 } |
200 | 199 |
201 void JingleSessionManager::SessionDestroyed(JingleSession* session) { | 200 void JingleSessionManager::SessionDestroyed(JingleSession* session) { |
202 sessions_.erase(session->session_id_); | 201 sessions_.erase(session->session_id_); |
203 } | 202 } |
204 | 203 |
205 } // namespace protocol | 204 } // namespace protocol |
206 } // namespace remoting | 205 } // namespace remoting |
OLD | NEW |