| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class PepperSessionManager : public SessionManager, | 44 class PepperSessionManager : public SessionManager, |
| 45 public SignalStrategy::Listener { | 45 public SignalStrategy::Listener { |
| 46 public: | 46 public: |
| 47 explicit PepperSessionManager(pp::Instance* pp_instance); | 47 explicit PepperSessionManager(pp::Instance* pp_instance); |
| 48 virtual ~PepperSessionManager(); | 48 virtual ~PepperSessionManager(); |
| 49 | 49 |
| 50 // SessionManager interface. | 50 // SessionManager interface. |
| 51 virtual void Init(const std::string& local_jid, | 51 virtual void Init(const std::string& local_jid, |
| 52 SignalStrategy* signal_strategy, | 52 SignalStrategy* signal_strategy, |
| 53 SessionManager::Listener* listener, | 53 SessionManager::Listener* listener, |
| 54 crypto::RSAPrivateKey* private_key, | |
| 55 const std::string& certificate, | |
| 56 bool allow_nat_traversal) OVERRIDE; | 54 bool allow_nat_traversal) OVERRIDE; |
| 57 virtual Session* Connect( | 55 virtual Session* Connect( |
| 58 const std::string& host_jid, | 56 const std::string& host_jid, |
| 59 const std::string& host_public_key, | 57 Authenticator* authenticator, |
| 60 const std::string& client_token, | |
| 61 CandidateSessionConfig* config, | 58 CandidateSessionConfig* config, |
| 62 const Session::StateChangeCallback& state_change_callback) OVERRIDE; | 59 const Session::StateChangeCallback& state_change_callback) OVERRIDE; |
| 63 virtual void Close() OVERRIDE; | 60 virtual void Close() OVERRIDE; |
| 61 virtual void set_authenticator_factory( |
| 62 AuthenticatorFactory* authenticator_factory) OVERRIDE; |
| 64 | 63 |
| 65 // SignalStrategy::Listener interface. | 64 // SignalStrategy::Listener interface. |
| 66 virtual bool OnIncomingStanza(const buzz::XmlElement* stanza) OVERRIDE; | 65 virtual bool OnIncomingStanza(const buzz::XmlElement* stanza) OVERRIDE; |
| 67 | 66 |
| 68 private: | 67 private: |
| 69 friend class PepperSession; | 68 friend class PepperSession; |
| 70 | 69 |
| 71 typedef std::map<std::string, PepperSession*> SessionsMap; | 70 typedef std::map<std::string, PepperSession*> SessionsMap; |
| 72 | 71 |
| 73 void OnJingleInfo( | 72 void OnJingleInfo( |
| 74 const std::string& relay_token, | 73 const std::string& relay_token, |
| 75 const std::vector<std::string>& relay_hosts, | 74 const std::vector<std::string>& relay_hosts, |
| 76 const std::vector<talk_base::SocketAddress>& stun_hosts); | 75 const std::vector<talk_base::SocketAddress>& stun_hosts); |
| 77 | 76 |
| 78 IqSender* iq_sender() { return iq_sender_.get(); } | 77 IqSender* iq_sender() { return iq_sender_.get(); } |
| 79 void SendReply(const buzz::XmlElement* original_stanza, | 78 void SendReply(const buzz::XmlElement* original_stanza, |
| 80 const JingleMessageReply& reply); | 79 const JingleMessageReply& reply); |
| 81 | 80 |
| 82 // Called by PepperSession when it is being destroyed. | 81 // Called by PepperSession when it is being destroyed. |
| 83 void SessionDestroyed(PepperSession* session); | 82 void SessionDestroyed(PepperSession* session); |
| 84 | 83 |
| 85 pp::Instance* pp_instance_; | 84 pp::Instance* pp_instance_; |
| 86 | 85 |
| 87 std::string local_jid_; | 86 std::string local_jid_; |
| 88 SignalStrategy* signal_strategy_; | 87 SignalStrategy* signal_strategy_; |
| 88 scoped_ptr<AuthenticatorFactory> authenticator_factory_; |
| 89 scoped_ptr<IqSender> iq_sender_; | 89 scoped_ptr<IqSender> iq_sender_; |
| 90 SessionManager::Listener* listener_; | 90 SessionManager::Listener* listener_; |
| 91 scoped_ptr<crypto::RSAPrivateKey> private_key_; | |
| 92 std::string certificate_; | |
| 93 bool allow_nat_traversal_; | 91 bool allow_nat_traversal_; |
| 94 | 92 |
| 95 TransportConfig transport_config_; | 93 TransportConfig transport_config_; |
| 96 | 94 |
| 97 scoped_ptr<JingleInfoRequest> jingle_info_request_; | 95 scoped_ptr<JingleInfoRequest> jingle_info_request_; |
| 98 | 96 |
| 99 SessionsMap sessions_; | 97 SessionsMap sessions_; |
| 100 | 98 |
| 101 DISALLOW_COPY_AND_ASSIGN(PepperSessionManager); | 99 DISALLOW_COPY_AND_ASSIGN(PepperSessionManager); |
| 102 }; | 100 }; |
| 103 | 101 |
| 104 } // namespace protocol | 102 } // namespace protocol |
| 105 } // namespace remoting | 103 } // namespace remoting |
| 106 | 104 |
| 107 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_ | 105 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_ |
| OLD | NEW |