| 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 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 5 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 typedef std::map<std::string, Transport*> ChannelsMap; | 79 typedef std::map<std::string, Transport*> ChannelsMap; |
| 80 typedef base::Callback<void(JingleMessageReply::ErrorType)> ReplyCallback; | 80 typedef base::Callback<void(JingleMessageReply::ErrorType)> ReplyCallback; |
| 81 | 81 |
| 82 explicit JingleSession(JingleSessionManager* session_manager); | 82 explicit JingleSession(JingleSessionManager* session_manager); |
| 83 | 83 |
| 84 // Start connection by sending session-initiate message. | 84 // Start connection by sending session-initiate message. |
| 85 void StartConnection(const std::string& peer_jid, | 85 void StartConnection(const std::string& peer_jid, |
| 86 scoped_ptr<Authenticator> authenticator, | 86 scoped_ptr<Authenticator> authenticator, |
| 87 scoped_ptr<CandidateSessionConfig> config); | 87 scoped_ptr<CandidateSessionConfig> config); |
| 88 | 88 |
| 89 // Adds to a new channel the remote candidates received before it was created. |
| 90 void AddPendingRemoteCandidates(Transport* channel, const std::string& name); |
| 91 |
| 89 // Called by JingleSessionManager for incoming connections. | 92 // Called by JingleSessionManager for incoming connections. |
| 90 void InitializeIncomingConnection(const JingleMessage& initiate_message, | 93 void InitializeIncomingConnection(const JingleMessage& initiate_message, |
| 91 scoped_ptr<Authenticator> authenticator); | 94 scoped_ptr<Authenticator> authenticator); |
| 92 void AcceptIncomingConnection(const JingleMessage& initiate_message); | 95 void AcceptIncomingConnection(const JingleMessage& initiate_message); |
| 93 | 96 |
| 94 // Sends |message| to the peer. The session is closed if the send fails or no | 97 // Sends |message| to the peer. The session is closed if the send fails or no |
| 95 // response is received within a reasonable time. All other responses are | 98 // response is received within a reasonable time. All other responses are |
| 96 // ignored. | 99 // ignored. |
| 97 void SendMessage(const JingleMessage& message); | 100 void SendMessage(const JingleMessage& message); |
| 98 | 101 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 162 |
| 160 // Pending transport-info requests. | 163 // Pending transport-info requests. |
| 161 std::list<IqRequest*> transport_info_requests_; | 164 std::list<IqRequest*> transport_info_requests_; |
| 162 | 165 |
| 163 ChannelsMap channels_; | 166 ChannelsMap channels_; |
| 164 scoped_ptr<ChannelMultiplexer> channel_multiplexer_; | 167 scoped_ptr<ChannelMultiplexer> channel_multiplexer_; |
| 165 | 168 |
| 166 base::OneShotTimer<JingleSession> transport_infos_timer_; | 169 base::OneShotTimer<JingleSession> transport_infos_timer_; |
| 167 std::list<JingleMessage::NamedCandidate> pending_candidates_; | 170 std::list<JingleMessage::NamedCandidate> pending_candidates_; |
| 168 | 171 |
| 172 // Pending remote candidates, received before the local channels were created. |
| 173 std::list<JingleMessage::NamedCandidate> pending_remote_candidates_; |
| 174 |
| 169 DISALLOW_COPY_AND_ASSIGN(JingleSession); | 175 DISALLOW_COPY_AND_ASSIGN(JingleSession); |
| 170 }; | 176 }; |
| 171 | 177 |
| 172 } // namespace protocol | 178 } // namespace protocol |
| 173 } // namespace remoting | 179 } // namespace remoting |
| 174 | 180 |
| 175 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 181 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| OLD | NEW |