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_H_ | 5 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
7 | 7 |
8 #include "base/crypto/rsa_private_key.h" | |
9 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "crypto/rsa_private_key.h" |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
11 #include "remoting/protocol/session.h" | 11 #include "remoting/protocol/session.h" |
12 #include "third_party/libjingle/source/talk/base/sigslot.h" | 12 #include "third_party/libjingle/source/talk/base/sigslot.h" |
13 #include "third_party/libjingle/source/talk/p2p/base/session.h" | 13 #include "third_party/libjingle/source/talk/p2p/base/session.h" |
14 | 14 |
15 namespace cricket { | 15 namespace cricket { |
16 class PseudoTcpChannel; | 16 class PseudoTcpChannel; |
17 } // namespace cricket | 17 } // namespace cricket |
18 | 18 |
19 namespace jingle_glue { | 19 namespace jingle_glue { |
(...skipping 26 matching lines...) Expand all Loading... |
46 | 46 |
47 // Create a JingleSession used in client mode. A server certificate is | 47 // Create a JingleSession used in client mode. A server certificate is |
48 // required. | 48 // required. |
49 static JingleSession* CreateClientSession(JingleSessionManager* manager); | 49 static JingleSession* CreateClientSession(JingleSessionManager* manager); |
50 | 50 |
51 // Create a JingleSession used in server mode. A server certificate and | 51 // Create a JingleSession used in server mode. A server certificate and |
52 // private key is provided. |key| is copied in the constructor. | 52 // private key is provided. |key| is copied in the constructor. |
53 static JingleSession* CreateServerSession( | 53 static JingleSession* CreateServerSession( |
54 JingleSessionManager* manager, | 54 JingleSessionManager* manager, |
55 scoped_refptr<net::X509Certificate> certificate, | 55 scoped_refptr<net::X509Certificate> certificate, |
56 base::RSAPrivateKey* key); | 56 crypto::RSAPrivateKey* key); |
57 | 57 |
58 // Chromotocol Session interface. | 58 // Chromotocol Session interface. |
59 virtual void SetStateChangeCallback(StateChangeCallback* callback); | 59 virtual void SetStateChangeCallback(StateChangeCallback* callback); |
60 | 60 |
61 virtual net::Socket* control_channel(); | 61 virtual net::Socket* control_channel(); |
62 virtual net::Socket* event_channel(); | 62 virtual net::Socket* event_channel(); |
63 virtual net::Socket* video_channel(); | 63 virtual net::Socket* video_channel(); |
64 | 64 |
65 virtual net::Socket* video_rtp_channel(); | 65 virtual net::Socket* video_rtp_channel(); |
66 virtual net::Socket* video_rtcp_channel(); | 66 virtual net::Socket* video_rtcp_channel(); |
(...skipping 12 matching lines...) Expand all Loading... |
79 // These fields are only set on the receiving side. | 79 // These fields are only set on the receiving side. |
80 virtual const CandidateSessionConfig* candidate_config(); | 80 virtual const CandidateSessionConfig* candidate_config(); |
81 | 81 |
82 virtual void Close(Task* closed_task); | 82 virtual void Close(Task* closed_task); |
83 | 83 |
84 private: | 84 private: |
85 friend class JingleSessionManager; | 85 friend class JingleSessionManager; |
86 | 86 |
87 JingleSession(JingleSessionManager* client, | 87 JingleSession(JingleSessionManager* client, |
88 scoped_refptr<net::X509Certificate> server_cert, | 88 scoped_refptr<net::X509Certificate> server_cert, |
89 base::RSAPrivateKey* key); | 89 crypto::RSAPrivateKey* key); |
90 virtual ~JingleSession(); | 90 virtual ~JingleSession(); |
91 | 91 |
92 // Called by JingleSessionManager. | 92 // Called by JingleSessionManager. |
93 void set_candidate_config(const CandidateSessionConfig* candidate_config); | 93 void set_candidate_config(const CandidateSessionConfig* candidate_config); |
94 scoped_refptr<net::X509Certificate> server_certificate() const; | 94 scoped_refptr<net::X509Certificate> server_certificate() const; |
95 void Init(cricket::Session* cricket_session); | 95 void Init(cricket::Session* cricket_session); |
96 | 96 |
97 // Close all the channels and terminate the session. | 97 // Close all the channels and terminate the session. |
98 void CloseInternal(int result, bool failed); | 98 void CloseInternal(int result, bool failed); |
99 | 99 |
(...skipping 22 matching lines...) Expand all Loading... |
122 | 122 |
123 void SetState(State new_state); | 123 void SetState(State new_state); |
124 | 124 |
125 // JingleSessionManager that created this session. | 125 // JingleSessionManager that created this session. |
126 scoped_refptr<JingleSessionManager> jingle_session_manager_; | 126 scoped_refptr<JingleSessionManager> jingle_session_manager_; |
127 | 127 |
128 // Server certificate used in SSL connections. | 128 // Server certificate used in SSL connections. |
129 scoped_refptr<net::X509Certificate> server_cert_; | 129 scoped_refptr<net::X509Certificate> server_cert_; |
130 | 130 |
131 // Private key used in SSL server sockets. | 131 // Private key used in SSL server sockets. |
132 scoped_ptr<base::RSAPrivateKey> key_; | 132 scoped_ptr<crypto::RSAPrivateKey> key_; |
133 | 133 |
134 State state_; | 134 State state_; |
135 scoped_ptr<StateChangeCallback> state_change_callback_; | 135 scoped_ptr<StateChangeCallback> state_change_callback_; |
136 | 136 |
137 bool closed_; | 137 bool closed_; |
138 bool closing_; | 138 bool closing_; |
139 | 139 |
140 // JID of the other side. Set when the connection is initialized, | 140 // JID of the other side. Set when the connection is initialized, |
141 // and never changed after that. | 141 // and never changed after that. |
142 std::string jid_; | 142 std::string jid_; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 scoped_ptr<net::CompletionCallback> connect_callback_; | 181 scoped_ptr<net::CompletionCallback> connect_callback_; |
182 | 182 |
183 DISALLOW_COPY_AND_ASSIGN(JingleSession); | 183 DISALLOW_COPY_AND_ASSIGN(JingleSession); |
184 }; | 184 }; |
185 | 185 |
186 } // namespace protocol | 186 } // namespace protocol |
187 | 187 |
188 } // namespace remoting | 188 } // namespace remoting |
189 | 189 |
190 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 190 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
OLD | NEW |