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_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 <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "net/base/x509_certificate.h" | 12 #include "net/base/x509_certificate.h" |
13 #include "remoting/protocol/jingle_session.h" | 13 #include "remoting/protocol/jingle_session.h" |
14 #include "remoting/protocol/session_manager.h" | 14 #include "remoting/protocol/session_manager.h" |
15 #include "third_party/libjingle/source/talk/p2p/base/session.h" | 15 #include "third_party/libjingle/source/talk/p2p/base/session.h" |
16 #include "third_party/libjingle/source/talk/p2p/base/sessionclient.h" | 16 #include "third_party/libjingle/source/talk/p2p/base/sessionclient.h" |
17 #include "third_party/libjingle/source/talk/p2p/base/sessiondescription.h" | 17 #include "third_party/libjingle/source/talk/p2p/base/sessiondescription.h" |
18 | 18 |
19 class MessageLoop; | 19 class MessageLoop; |
20 | 20 |
21 namespace base { | 21 namespace crypto { |
22 class RSAPrivateKey; | 22 class RSAPrivateKey; |
23 } // namespace base | 23 } // namespace base |
24 | 24 |
25 namespace cricket { | 25 namespace cricket { |
26 class SessionManager; | 26 class SessionManager; |
27 } // namespace cricket | 27 } // namespace cricket |
28 | 28 |
29 namespace remoting { | 29 namespace remoting { |
30 | 30 |
31 class JingleThread; | 31 class JingleThread; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // |session_manager|. Close() must be called _before_ the |session_manager| | 77 // |session_manager|. Close() must be called _before_ the |session_manager| |
78 // is destroyed. | 78 // is destroyed. |
79 // If this object is used in server mode, then |private_key| and | 79 // If this object is used in server mode, then |private_key| and |
80 // |certificate| are used to establish a secured communication with the | 80 // |certificate| are used to establish a secured communication with the |
81 // client. It will also take ownership of these objects. | 81 // client. It will also take ownership of these objects. |
82 // In case this is used in client mode, pass in NULL for both private key and | 82 // In case this is used in client mode, pass in NULL for both private key and |
83 // certificate. | 83 // certificate. |
84 virtual void Init(const std::string& local_jid, | 84 virtual void Init(const std::string& local_jid, |
85 cricket::SessionManager* cricket_session_manager, | 85 cricket::SessionManager* cricket_session_manager, |
86 IncomingSessionCallback* incoming_session_callback, | 86 IncomingSessionCallback* incoming_session_callback, |
87 base::RSAPrivateKey* private_key, | 87 crypto::RSAPrivateKey* private_key, |
88 scoped_refptr<net::X509Certificate> certificate); | 88 scoped_refptr<net::X509Certificate> certificate); |
89 | 89 |
90 // SessionManager interface. | 90 // SessionManager interface. |
91 virtual scoped_refptr<protocol::Session> Connect( | 91 virtual scoped_refptr<protocol::Session> Connect( |
92 const std::string& jid, | 92 const std::string& jid, |
93 const std::string& client_token, | 93 const std::string& client_token, |
94 CandidateSessionConfig* candidate_config, | 94 CandidateSessionConfig* candidate_config, |
95 protocol::Session::StateChangeCallback* state_change_callback); | 95 protocol::Session::StateChangeCallback* state_change_callback); |
96 virtual void Close(Task* closed_task); | 96 virtual void Close(Task* closed_task); |
97 | 97 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 std::string local_jid_; // Full jid for the local side of the session. | 142 std::string local_jid_; // Full jid for the local side of the session. |
143 JingleThread* jingle_thread_; | 143 JingleThread* jingle_thread_; |
144 cricket::SessionManager* cricket_session_manager_; | 144 cricket::SessionManager* cricket_session_manager_; |
145 scoped_ptr<IncomingSessionCallback> incoming_session_callback_; | 145 scoped_ptr<IncomingSessionCallback> incoming_session_callback_; |
146 bool allow_local_ips_; | 146 bool allow_local_ips_; |
147 bool closed_; | 147 bool closed_; |
148 | 148 |
149 std::list<scoped_refptr<JingleSession> > sessions_; | 149 std::list<scoped_refptr<JingleSession> > sessions_; |
150 | 150 |
151 scoped_refptr<net::X509Certificate> certificate_; | 151 scoped_refptr<net::X509Certificate> certificate_; |
152 scoped_ptr<base::RSAPrivateKey> private_key_; | 152 scoped_ptr<crypto::RSAPrivateKey> private_key_; |
153 | 153 |
154 DISALLOW_COPY_AND_ASSIGN(JingleSessionManager); | 154 DISALLOW_COPY_AND_ASSIGN(JingleSessionManager); |
155 }; | 155 }; |
156 | 156 |
157 } // namespace protocol | 157 } // namespace protocol |
158 | 158 |
159 } // namespace remoting | 159 } // namespace remoting |
160 | 160 |
161 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ | 161 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ |
OLD | NEW |