| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
| 15 #include "crypto/rsa_private_key.h" | 15 #include "crypto/rsa_private_key.h" |
| 16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
| 17 #include "remoting/protocol/authenticator.h" | 17 #include "remoting/protocol/authenticator.h" |
| 18 #include "remoting/protocol/datagram_channel_factory.h" | 18 #include "remoting/protocol/datagram_channel_factory.h" |
| 19 #include "remoting/protocol/jingle_messages.h" | 19 #include "remoting/protocol/jingle_messages.h" |
| 20 #include "remoting/protocol/session.h" | 20 #include "remoting/protocol/session.h" |
| 21 #include "remoting/protocol/session_config.h" | 21 #include "remoting/protocol/session_config.h" |
| 22 #include "remoting/protocol/transport.h" | 22 #include "remoting/protocol/transport.h" |
| 23 #include "remoting/signaling/iq_sender.h" | 23 #include "remoting/signaling/iq_sender.h" |
| 24 | 24 |
| 25 namespace remoting { | 25 namespace remoting { |
| 26 namespace protocol { | 26 namespace protocol { |
| 27 | 27 |
| 28 class SecureChannelFactory; | |
| 29 class ChannelMultiplexer; | 28 class ChannelMultiplexer; |
| 30 class JingleSessionManager; | 29 class JingleSessionManager; |
| 31 class PseudoTcpChannelFactory; | 30 class PseudoTcpChannelFactory; |
| 31 class QuicChannelFactory; |
| 32 class SecureChannelFactory; |
| 32 | 33 |
| 33 // JingleSessionManager and JingleSession implement the subset of the | 34 // JingleSessionManager and JingleSession implement the subset of the |
| 34 // Jingle protocol used in Chromoting. Instances of this class are | 35 // Jingle protocol used in Chromoting. Instances of this class are |
| 35 // created by the JingleSessionManager. | 36 // created by the JingleSessionManager. |
| 36 class JingleSession : public base::NonThreadSafe, | 37 class JingleSession : public base::NonThreadSafe, |
| 37 public Session, | 38 public Session, |
| 38 public DatagramChannelFactory, | 39 public DatagramChannelFactory, |
| 39 public Transport::EventHandler { | 40 public Transport::EventHandler { |
| 40 public: | 41 public: |
| 41 ~JingleSession() override; | 42 ~JingleSession() override; |
| 42 | 43 |
| 43 // Session interface. | 44 // Session interface. |
| 44 void SetEventHandler(Session::EventHandler* event_handler) override; | 45 void SetEventHandler(Session::EventHandler* event_handler) override; |
| 45 ErrorCode error() override; | 46 ErrorCode error() override; |
| 46 const std::string& jid() override; | 47 const std::string& jid() override; |
| 47 const SessionConfig& config() override; | 48 const SessionConfig& config() override; |
| 48 StreamChannelFactory* GetTransportChannelFactory() override; | 49 StreamChannelFactory* GetTransportChannelFactory() override; |
| 49 StreamChannelFactory* GetMultiplexedChannelFactory() override; | 50 StreamChannelFactory* GetMultiplexedChannelFactory() override; |
| 51 StreamChannelFactory* GetQuicChannelFactory() override; |
| 50 void Close() override; | 52 void Close() override; |
| 51 | 53 |
| 52 // DatagramChannelFactory interface. | 54 // DatagramChannelFactory interface. |
| 53 void CreateChannel(const std::string& name, | 55 void CreateChannel(const std::string& name, |
| 54 const ChannelCreatedCallback& callback) override; | 56 const ChannelCreatedCallback& callback) override; |
| 55 void CancelChannelCreation(const std::string& name) override; | 57 void CancelChannelCreation(const std::string& name) override; |
| 56 | 58 |
| 57 // Transport::EventHandler interface. | 59 // Transport::EventHandler interface. |
| 58 void OnTransportIceCredentials(Transport* transport, | 60 void OnTransportIceCredentials(Transport* transport, |
| 59 const std::string& ufrag, | 61 const std::string& ufrag, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // Pending Iq requests. Used for all messages except transport-info. | 166 // Pending Iq requests. Used for all messages except transport-info. |
| 165 std::set<IqRequest*> pending_requests_; | 167 std::set<IqRequest*> pending_requests_; |
| 166 | 168 |
| 167 // Pending transport-info requests. | 169 // Pending transport-info requests. |
| 168 std::list<IqRequest*> transport_info_requests_; | 170 std::list<IqRequest*> transport_info_requests_; |
| 169 | 171 |
| 170 ChannelsMap channels_; | 172 ChannelsMap channels_; |
| 171 scoped_ptr<PseudoTcpChannelFactory> pseudotcp_channel_factory_; | 173 scoped_ptr<PseudoTcpChannelFactory> pseudotcp_channel_factory_; |
| 172 scoped_ptr<SecureChannelFactory> secure_channel_factory_; | 174 scoped_ptr<SecureChannelFactory> secure_channel_factory_; |
| 173 scoped_ptr<ChannelMultiplexer> channel_multiplexer_; | 175 scoped_ptr<ChannelMultiplexer> channel_multiplexer_; |
| 176 scoped_ptr<QuicChannelFactory> quic_channel_factory_; |
| 174 | 177 |
| 175 scoped_ptr<JingleMessage> pending_transport_info_message_; | 178 scoped_ptr<JingleMessage> pending_transport_info_message_; |
| 176 base::OneShotTimer<JingleSession> transport_info_timer_; | 179 base::OneShotTimer<JingleSession> transport_info_timer_; |
| 177 | 180 |
| 178 // Pending remote transport info received before the local channels were | 181 // Pending remote transport info received before the local channels were |
| 179 // created. | 182 // created. |
| 180 std::list<JingleMessage::IceCredentials> pending_remote_ice_credentials_; | 183 std::list<JingleMessage::IceCredentials> pending_remote_ice_credentials_; |
| 181 std::list<JingleMessage::NamedCandidate> pending_remote_candidates_; | 184 std::list<JingleMessage::NamedCandidate> pending_remote_candidates_; |
| 182 | 185 |
| 183 base::WeakPtrFactory<JingleSession> weak_factory_; | 186 base::WeakPtrFactory<JingleSession> weak_factory_; |
| 184 | 187 |
| 185 DISALLOW_COPY_AND_ASSIGN(JingleSession); | 188 DISALLOW_COPY_AND_ASSIGN(JingleSession); |
| 186 }; | 189 }; |
| 187 | 190 |
| 188 } // namespace protocol | 191 } // namespace protocol |
| 189 } // namespace remoting | 192 } // namespace remoting |
| 190 | 193 |
| 191 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 194 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
| OLD | NEW |