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

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

Issue 9325036: Add abstract interfaces for the transport layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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>
11 11
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "net/base/x509_certificate.h" 13 #include "net/base/x509_certificate.h"
14 #include "remoting/jingle_glue/signal_strategy.h" 14 #include "remoting/jingle_glue/signal_strategy.h"
15 #include "remoting/protocol/pepper_channel.h"
16 #include "remoting/protocol/session_manager.h" 15 #include "remoting/protocol/session_manager.h"
16 #include "remoting/protocol/transport.h"
17 #include "remoting/protocol/transport_config.h" 17 #include "remoting/protocol/transport_config.h"
18 18
19 namespace pp { 19 namespace pp {
20 class Instance; 20 class Instance;
21 } // namespace pp 21 } // namespace pp
22 22
23 namespace buzz { 23 namespace buzz {
24 class XmlElement; 24 class XmlElement;
25 } // namespace buzz 25 } // namespace buzz
26 26
(...skipping 10 matching lines...) Expand all
37 37
38 struct JingleMessage; 38 struct JingleMessage;
39 struct JingleMessageReply; 39 struct JingleMessageReply;
40 class PepperSession; 40 class PepperSession;
41 41
42 // This class implements SessionManager interface on top of the Pepper 42 // This class implements SessionManager interface on top of the Pepper
43 // P2P Transport API. 43 // P2P Transport API.
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(
48 scoped_ptr<TransportFactory> transport_factory);
Wez 2012/02/07 01:17:37 Why have the TransportFactory passed in here, give
Sergey Ulanov 2012/02/07 04:41:12 Yes. The idea is to make this class generic and no
48 virtual ~PepperSessionManager(); 49 virtual ~PepperSessionManager();
49 50
50 // SessionManager interface. 51 // SessionManager interface.
51 virtual void Init(SignalStrategy* signal_strategy, 52 virtual void Init(SignalStrategy* signal_strategy,
52 SessionManager::Listener* listener, 53 SessionManager::Listener* listener,
53 const NetworkSettings& network_settings) OVERRIDE; 54 const NetworkSettings& network_settings) OVERRIDE;
54 virtual scoped_ptr<Session> Connect( 55 virtual scoped_ptr<Session> Connect(
55 const std::string& host_jid, 56 const std::string& host_jid,
56 scoped_ptr<Authenticator> authenticator, 57 scoped_ptr<Authenticator> authenticator,
57 scoped_ptr<CandidateSessionConfig> config, 58 scoped_ptr<CandidateSessionConfig> config,
(...skipping 18 matching lines...) Expand all
76 const std::vector<std::string>& relay_hosts, 77 const std::vector<std::string>& relay_hosts,
77 const std::vector<talk_base::SocketAddress>& stun_hosts); 78 const std::vector<talk_base::SocketAddress>& stun_hosts);
78 79
79 IqSender* iq_sender() { return iq_sender_.get(); } 80 IqSender* iq_sender() { return iq_sender_.get(); }
80 void SendReply(const buzz::XmlElement* original_stanza, 81 void SendReply(const buzz::XmlElement* original_stanza,
81 const JingleMessageReply& reply); 82 const JingleMessageReply& reply);
82 83
83 // Called by PepperSession when it is being destroyed. 84 // Called by PepperSession when it is being destroyed.
84 void SessionDestroyed(PepperSession* session); 85 void SessionDestroyed(PepperSession* session);
85 86
86 pp::Instance* pp_instance_; 87 scoped_ptr<TransportFactory> transport_factory_;
87 88
88 SignalStrategy* signal_strategy_; 89 SignalStrategy* signal_strategy_;
89 scoped_ptr<AuthenticatorFactory> authenticator_factory_; 90 scoped_ptr<AuthenticatorFactory> authenticator_factory_;
90 scoped_ptr<IqSender> iq_sender_; 91 scoped_ptr<IqSender> iq_sender_;
91 SessionManager::Listener* listener_; 92 SessionManager::Listener* listener_;
92 93
93 bool ready_; 94 bool ready_;
94 95
95 TransportConfig transport_config_; 96 TransportConfig transport_config_;
96 97
97 scoped_ptr<JingleInfoRequest> jingle_info_request_; 98 scoped_ptr<JingleInfoRequest> jingle_info_request_;
98 99
99 SessionsMap sessions_; 100 SessionsMap sessions_;
100 101
101 DISALLOW_COPY_AND_ASSIGN(PepperSessionManager); 102 DISALLOW_COPY_AND_ASSIGN(PepperSessionManager);
102 }; 103 };
103 104
104 } // namespace protocol 105 } // namespace protocol
105 } // namespace remoting 106 } // namespace remoting
106 107
107 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_ 108 #endif // REMOTING_PROTOCOL_PEPPER_SESSION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698