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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const SignalingAddress& peer_address, | 49 const SignalingAddress& peer_address, |
50 std::unique_ptr<Authenticator> authenticator) { | 50 std::unique_ptr<Authenticator> authenticator) { |
51 std::unique_ptr<JingleSession> session(new JingleSession(this)); | 51 std::unique_ptr<JingleSession> session(new JingleSession(this)); |
52 session->StartConnection(peer_address, std::move(authenticator)); | 52 session->StartConnection(peer_address, std::move(authenticator)); |
53 sessions_[session->session_id_] = session.get(); | 53 sessions_[session->session_id_] = session.get(); |
54 return std::move(session); | 54 return std::move(session); |
55 } | 55 } |
56 | 56 |
57 void JingleSessionManager::set_authenticator_factory( | 57 void JingleSessionManager::set_authenticator_factory( |
58 std::unique_ptr<AuthenticatorFactory> authenticator_factory) { | 58 std::unique_ptr<AuthenticatorFactory> authenticator_factory) { |
59 DCHECK(CalledOnValidThread()); | 59 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
60 authenticator_factory_ = std::move(authenticator_factory); | 60 authenticator_factory_ = std::move(authenticator_factory); |
61 } | 61 } |
62 | 62 |
63 void JingleSessionManager::OnSignalStrategyStateChange( | 63 void JingleSessionManager::OnSignalStrategyStateChange( |
64 SignalStrategy::State state) {} | 64 SignalStrategy::State state) {} |
65 | 65 |
66 bool JingleSessionManager::OnSignalStrategyIncomingStanza( | 66 bool JingleSessionManager::OnSignalStrategyIncomingStanza( |
67 const buzz::XmlElement* stanza) { | 67 const buzz::XmlElement* stanza) { |
68 if (!JingleMessage::IsJingleMessage(stanza)) | 68 if (!JingleMessage::IsJingleMessage(stanza)) |
69 return false; | 69 return false; |
(...skipping 77 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 |