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_MANAGER_H_ | 5 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ |
6 #define REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ | 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... |
23 class XmlElement; | 23 class XmlElement; |
24 } // namespace buzz | 24 } // namespace buzz |
25 | 25 |
26 namespace talk_base { | 26 namespace talk_base { |
27 class SocketAddress; | 27 class SocketAddress; |
28 } // namespace talk_base | 28 } // namespace talk_base |
29 | 29 |
30 namespace remoting { | 30 namespace remoting { |
31 | 31 |
32 class IqSender; | 32 class IqSender; |
33 class JingleInfoRequest; | |
34 | 33 |
35 namespace protocol { | 34 namespace protocol { |
36 | 35 |
37 class JingleSession; | 36 class JingleSession; |
38 class TransportFactory; | 37 class TransportFactory; |
39 | 38 |
40 // JingleSessionManager and JingleSession implement the subset of the | 39 // JingleSessionManager and JingleSession implement the subset of the |
41 // Jingle protocol used in Chromoting. JingleSessionManager provides | 40 // Jingle protocol used in Chromoting. JingleSessionManager provides |
42 // the protocol::SessionManager interface for accepting incoming and | 41 // the protocol::SessionManager interface for accepting incoming and |
43 // creating outgoing sessions. | 42 // creating outgoing sessions. |
44 class JingleSessionManager : public SessionManager, | 43 class JingleSessionManager : public SessionManager, |
45 public SignalStrategy::Listener { | 44 public SignalStrategy::Listener { |
46 public: | 45 public: |
47 // When |fetch_stun_relay_config| is set to true then | 46 explicit JingleSessionManager(scoped_ptr<TransportFactory> transport_factory); |
48 // JingleSessionManager will also try to query configuration of STUN | |
49 // and Relay servers from the signaling server. | |
50 // | |
51 // TODO(sergeyu): Move NAT-traversal config fetching to a separate | |
52 // class. | |
53 explicit JingleSessionManager( | |
54 scoped_ptr<TransportFactory> transport_factory, | |
55 bool fetch_stun_relay_config); | |
56 virtual ~JingleSessionManager(); | 47 virtual ~JingleSessionManager(); |
57 | 48 |
58 // SessionManager interface. | 49 // SessionManager interface. |
59 virtual void Init(SignalStrategy* signal_strategy, | 50 virtual void Init(SignalStrategy* signal_strategy, |
60 SessionManager::Listener* listener) OVERRIDE; | 51 SessionManager::Listener* listener) OVERRIDE; |
61 virtual scoped_ptr<Session> Connect( | 52 virtual scoped_ptr<Session> Connect( |
62 const std::string& host_jid, | 53 const std::string& host_jid, |
63 scoped_ptr<Authenticator> authenticator, | 54 scoped_ptr<Authenticator> authenticator, |
64 scoped_ptr<CandidateSessionConfig> config) OVERRIDE; | 55 scoped_ptr<CandidateSessionConfig> config) OVERRIDE; |
65 virtual void Close() OVERRIDE; | 56 virtual void Close() OVERRIDE; |
(...skipping 26 matching lines...) Expand all Loading... |
92 scoped_ptr<TransportFactory> transport_factory_; | 83 scoped_ptr<TransportFactory> transport_factory_; |
93 bool fetch_stun_relay_config_; | 84 bool fetch_stun_relay_config_; |
94 | 85 |
95 SignalStrategy* signal_strategy_; | 86 SignalStrategy* signal_strategy_; |
96 scoped_ptr<AuthenticatorFactory> authenticator_factory_; | 87 scoped_ptr<AuthenticatorFactory> authenticator_factory_; |
97 scoped_ptr<IqSender> iq_sender_; | 88 scoped_ptr<IqSender> iq_sender_; |
98 SessionManager::Listener* listener_; | 89 SessionManager::Listener* listener_; |
99 | 90 |
100 bool ready_; | 91 bool ready_; |
101 | 92 |
102 scoped_ptr<JingleInfoRequest> jingle_info_request_; | |
103 | |
104 SessionsMap sessions_; | 93 SessionsMap sessions_; |
105 | 94 |
106 DISALLOW_COPY_AND_ASSIGN(JingleSessionManager); | 95 DISALLOW_COPY_AND_ASSIGN(JingleSessionManager); |
107 }; | 96 }; |
108 | 97 |
109 } // namespace protocol | 98 } // namespace protocol |
110 } // namespace remoting | 99 } // namespace remoting |
111 | 100 |
112 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ | 101 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ |
OLD | NEW |