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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/task.h" | 9 #include "base/task.h" |
10 #include "crypto/rsa_private_key.h" | 10 #include "crypto/rsa_private_key.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 virtual void CreateStreamChannel( | 31 virtual void CreateStreamChannel( |
32 const std::string& name, | 32 const std::string& name, |
33 const StreamChannelCallback& callback) OVERRIDE; | 33 const StreamChannelCallback& callback) OVERRIDE; |
34 virtual void CreateDatagramChannel( | 34 virtual void CreateDatagramChannel( |
35 const std::string& name, | 35 const std::string& name, |
36 const DatagramChannelCallback& callback) OVERRIDE; | 36 const DatagramChannelCallback& callback) OVERRIDE; |
37 virtual net::Socket* control_channel() OVERRIDE; | 37 virtual net::Socket* control_channel() OVERRIDE; |
38 virtual net::Socket* event_channel() OVERRIDE; | 38 virtual net::Socket* event_channel() OVERRIDE; |
39 virtual const std::string& jid() OVERRIDE; | 39 virtual const std::string& jid() OVERRIDE; |
40 virtual const CandidateSessionConfig* candidate_config() OVERRIDE; | 40 virtual const CandidateSessionConfig* candidate_config() OVERRIDE; |
41 virtual const SessionConfig* config() OVERRIDE; | 41 virtual const SessionConfig& config() OVERRIDE; |
42 virtual void set_config(const SessionConfig* config) OVERRIDE; | 42 virtual void set_config(const SessionConfig& config) OVERRIDE; |
43 virtual const std::string& initiator_token() OVERRIDE; | 43 virtual const std::string& initiator_token() OVERRIDE; |
44 virtual void set_initiator_token(const std::string& initiator_token) OVERRIDE; | 44 virtual void set_initiator_token(const std::string& initiator_token) OVERRIDE; |
45 virtual const std::string& receiver_token() OVERRIDE; | 45 virtual const std::string& receiver_token() OVERRIDE; |
46 virtual void set_receiver_token(const std::string& receiver_token) OVERRIDE; | 46 virtual void set_receiver_token(const std::string& receiver_token) OVERRIDE; |
47 virtual void set_shared_secret(const std::string& secret) OVERRIDE; | 47 virtual void set_shared_secret(const std::string& secret) OVERRIDE; |
48 virtual const std::string& shared_secret() OVERRIDE; | 48 virtual const std::string& shared_secret() OVERRIDE; |
49 virtual void Close() OVERRIDE; | 49 virtual void Close() OVERRIDE; |
50 | 50 |
51 private: | 51 private: |
52 friend class JingleDatagramConnector; | 52 friend class JingleDatagramConnector; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 bool closing_; | 153 bool closing_; |
154 | 154 |
155 // JID of the other side. Set when the connection is initialized, | 155 // JID of the other side. Set when the connection is initialized, |
156 // and never changed after that. | 156 // and never changed after that. |
157 std::string jid_; | 157 std::string jid_; |
158 | 158 |
159 // The corresponding libjingle session. | 159 // The corresponding libjingle session. |
160 cricket::Session* cricket_session_; | 160 cricket::Session* cricket_session_; |
161 | 161 |
162 scoped_ptr<const SessionConfig> config_; | 162 SessionConfig config_; |
| 163 bool config_set_; |
163 | 164 |
164 std::string initiator_token_; | 165 std::string initiator_token_; |
165 std::string receiver_token_; | 166 std::string receiver_token_; |
166 | 167 |
167 // These data members are only set on the receiving side. | 168 // These data members are only set on the receiving side. |
168 scoped_ptr<const CandidateSessionConfig> candidate_config_; | 169 scoped_ptr<const CandidateSessionConfig> candidate_config_; |
169 | 170 |
170 // Channels that are currently being connected. | 171 // Channels that are currently being connected. |
171 std::map<std::string, JingleChannelConnector*> channel_connectors_; | 172 std::map<std::string, JingleChannelConnector*> channel_connectors_; |
172 | 173 |
173 scoped_ptr<net::Socket> control_channel_socket_; | 174 scoped_ptr<net::Socket> control_channel_socket_; |
174 scoped_ptr<net::Socket> event_channel_socket_; | 175 scoped_ptr<net::Socket> event_channel_socket_; |
175 | 176 |
176 ScopedRunnableMethodFactory<JingleSession> task_factory_; | 177 ScopedRunnableMethodFactory<JingleSession> task_factory_; |
177 | 178 |
178 DISALLOW_COPY_AND_ASSIGN(JingleSession); | 179 DISALLOW_COPY_AND_ASSIGN(JingleSession); |
179 }; | 180 }; |
180 | 181 |
181 } // namespace protocol | 182 } // namespace protocol |
182 | 183 |
183 } // namespace remoting | 184 } // namespace remoting |
184 | 185 |
185 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 186 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
OLD | NEW |