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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Description must be present in session-initiate messages. | 80 // Description must be present in session-initiate messages. |
81 DCHECK(message->description.get()); | 81 DCHECK(message->description.get()); |
82 | 82 |
83 SendReply(std::move(stanza_copy), JingleMessageReply::NONE); | 83 SendReply(std::move(stanza_copy), JingleMessageReply::NONE); |
84 | 84 |
85 std::unique_ptr<Authenticator> authenticator = | 85 std::unique_ptr<Authenticator> authenticator = |
86 authenticator_factory_->CreateAuthenticator( | 86 authenticator_factory_->CreateAuthenticator( |
87 signal_strategy_->GetLocalAddress().id(), message->from.id()); | 87 signal_strategy_->GetLocalAddress().id(), message->from.id()); |
88 | 88 |
89 JingleSession* session = new JingleSession(this); | 89 JingleSession* session = new JingleSession(this); |
90 session->InitializeIncomingConnection(*message, | 90 session->InitializeIncomingConnection(stanza->Attr(buzz::QN_ID), *message, |
91 std::move(authenticator)); | 91 std::move(authenticator)); |
92 sessions_[session->session_id_] = session; | 92 sessions_[session->session_id_] = session; |
93 | 93 |
94 // Destroy the session if it was rejected due to incompatible protocol. | 94 // Destroy the session if it was rejected due to incompatible protocol. |
95 if (session->state_ != Session::ACCEPTING) { | 95 if (session->state_ != Session::ACCEPTING) { |
96 delete session; | 96 delete session; |
97 DCHECK(sessions_.find(message->sid) == sessions_.end()); | 97 DCHECK(sessions_.find(message->sid) == sessions_.end()); |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 signal_strategy_->SendStanza( | 147 signal_strategy_->SendStanza( |
148 JingleMessageReply(error).ToXml(original_stanza.get())); | 148 JingleMessageReply(error).ToXml(original_stanza.get())); |
149 } | 149 } |
150 | 150 |
151 void JingleSessionManager::SessionDestroyed(JingleSession* session) { | 151 void JingleSessionManager::SessionDestroyed(JingleSession* session) { |
152 sessions_.erase(session->session_id_); | 152 sessions_.erase(session->session_id_); |
153 } | 153 } |
154 | 154 |
155 } // namespace protocol | 155 } // namespace protocol |
156 } // namespace remoting | 156 } // namespace remoting |
OLD | NEW |