Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: remoting/protocol/jingle_session_manager.h

Issue 10233021: Move PortAllocator creation out of LibjingleTransportFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_PEPPER_SESSION_MANAGER_H_ 5 #ifndef REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_
6 #define REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_ 6 #define REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 27 matching lines...) Expand all
38 38
39 class JingleSession; 39 class JingleSession;
40 40
41 // JingleSessionManager and JingleSession implement the subset of the 41 // JingleSessionManager and JingleSession implement the subset of the
42 // Jingle protocol used in Chromoting. JingleSessionManager provides 42 // Jingle protocol used in Chromoting. JingleSessionManager provides
43 // the protocol::SessionManager interface for accepting incoming and 43 // the protocol::SessionManager interface for accepting incoming and
44 // creating outgoing sessions. 44 // creating outgoing sessions.
45 class JingleSessionManager : public SessionManager, 45 class JingleSessionManager : public SessionManager,
46 public SignalStrategy::Listener { 46 public SignalStrategy::Listener {
47 public: 47 public:
48 // When |fetch_nat_traversal_config| is set to true then
49 // JingleSessionManager will also try to query configuration of STUN
50 // and Relay servers from the signaling server.
51 //
52 // TODO(sergeyu): Move NAT-traversal config fetching to a separate
53 // class.
48 explicit JingleSessionManager( 54 explicit JingleSessionManager(
49 scoped_ptr<TransportFactory> transport_factory); 55 scoped_ptr<TransportFactory> transport_factory,
56 bool fetch_nat_traversal_config);
Wez 2012/04/27 17:58:51 nit: At a glance this name suggests it's fetching
Sergey Ulanov 2012/04/27 22:51:14 Renamed to fetch_stun_relay_config
50 virtual ~JingleSessionManager(); 57 virtual ~JingleSessionManager();
51 58
52 // SessionManager interface. 59 // SessionManager interface.
53 virtual void Init(SignalStrategy* signal_strategy, 60 virtual void Init(SignalStrategy* signal_strategy,
54 SessionManager::Listener* listener, 61 SessionManager::Listener* listener) OVERRIDE;
55 const NetworkSettings& network_settings) OVERRIDE;
56 virtual scoped_ptr<Session> Connect( 62 virtual scoped_ptr<Session> Connect(
57 const std::string& host_jid, 63 const std::string& host_jid,
58 scoped_ptr<Authenticator> authenticator, 64 scoped_ptr<Authenticator> authenticator,
59 scoped_ptr<CandidateSessionConfig> config, 65 scoped_ptr<CandidateSessionConfig> config,
60 const Session::StateChangeCallback& state_change_callback) OVERRIDE; 66 const Session::StateChangeCallback& state_change_callback) OVERRIDE;
61 virtual void Close() OVERRIDE; 67 virtual void Close() OVERRIDE;
62 virtual void set_authenticator_factory( 68 virtual void set_authenticator_factory(
63 scoped_ptr<AuthenticatorFactory> authenticator_factory) OVERRIDE; 69 scoped_ptr<AuthenticatorFactory> authenticator_factory) OVERRIDE;
64 70
65 // SignalStrategy::Listener interface. 71 // SignalStrategy::Listener interface.
(...skipping 13 matching lines...) Expand all
79 const std::vector<talk_base::SocketAddress>& stun_hosts); 85 const std::vector<talk_base::SocketAddress>& stun_hosts);
80 86
81 IqSender* iq_sender() { return iq_sender_.get(); } 87 IqSender* iq_sender() { return iq_sender_.get(); }
82 void SendReply(const buzz::XmlElement* original_stanza, 88 void SendReply(const buzz::XmlElement* original_stanza,
83 JingleMessageReply::ErrorType error); 89 JingleMessageReply::ErrorType error);
84 90
85 // Called by JingleSession when it is being destroyed. 91 // Called by JingleSession when it is being destroyed.
86 void SessionDestroyed(JingleSession* session); 92 void SessionDestroyed(JingleSession* session);
87 93
88 scoped_ptr<TransportFactory> transport_factory_; 94 scoped_ptr<TransportFactory> transport_factory_;
95 bool fetch_nat_traversal_config_;
89 96
90 SignalStrategy* signal_strategy_; 97 SignalStrategy* signal_strategy_;
98 bool nat_travesal_;
Wez 2012/04/27 17:58:51 typo: nat_travesal_
Wez 2012/04/27 17:58:51 Name this |allow_nat_traversal_| or similar, to ex
Wez 2012/04/27 17:58:51 Is this used?
Sergey Ulanov 2012/04/27 22:51:14 Done.
Sergey Ulanov 2012/04/27 22:51:14 Done.
Sergey Ulanov 2012/04/27 22:51:14 No, removed it.
91 scoped_ptr<AuthenticatorFactory> authenticator_factory_; 99 scoped_ptr<AuthenticatorFactory> authenticator_factory_;
92 scoped_ptr<IqSender> iq_sender_; 100 scoped_ptr<IqSender> iq_sender_;
93 SessionManager::Listener* listener_; 101 SessionManager::Listener* listener_;
94 102
95 bool ready_; 103 bool ready_;
96 104
97 TransportConfig transport_config_; 105 TransportConfig transport_config_;
98 106
99 scoped_ptr<JingleInfoRequest> jingle_info_request_; 107 scoped_ptr<JingleInfoRequest> jingle_info_request_;
100 108
101 SessionsMap sessions_; 109 SessionsMap sessions_;
102 110
103 DISALLOW_COPY_AND_ASSIGN(JingleSessionManager); 111 DISALLOW_COPY_AND_ASSIGN(JingleSessionManager);
104 }; 112 };
105 113
106 } // namespace protocol 114 } // namespace protocol
107 } // namespace remoting 115 } // namespace remoting
108 116
109 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_ 117 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698