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 19 matching lines...) Expand all Loading... |
30 virtual void SetStateChangeCallback( | 30 virtual void SetStateChangeCallback( |
31 const StateChangeCallback& callback) OVERRIDE; | 31 const StateChangeCallback& callback) OVERRIDE; |
32 virtual Error error() OVERRIDE; | 32 virtual Error error() OVERRIDE; |
33 virtual void CreateStreamChannel( | 33 virtual void CreateStreamChannel( |
34 const std::string& name, | 34 const std::string& name, |
35 const StreamChannelCallback& callback) OVERRIDE; | 35 const StreamChannelCallback& callback) OVERRIDE; |
36 virtual void CreateDatagramChannel( | 36 virtual void CreateDatagramChannel( |
37 const std::string& name, | 37 const std::string& name, |
38 const DatagramChannelCallback& callback) OVERRIDE; | 38 const DatagramChannelCallback& callback) OVERRIDE; |
39 virtual void CancelChannelCreation(const std::string& name) OVERRIDE; | 39 virtual void CancelChannelCreation(const std::string& name) OVERRIDE; |
40 virtual net::Socket* control_channel() OVERRIDE; | |
41 virtual net::Socket* event_channel() OVERRIDE; | |
42 virtual const std::string& jid() OVERRIDE; | 40 virtual const std::string& jid() OVERRIDE; |
43 virtual const CandidateSessionConfig* candidate_config() OVERRIDE; | 41 virtual const CandidateSessionConfig* candidate_config() OVERRIDE; |
44 virtual const SessionConfig& config() OVERRIDE; | 42 virtual const SessionConfig& config() OVERRIDE; |
45 virtual void set_config(const SessionConfig& config) OVERRIDE; | 43 virtual void set_config(const SessionConfig& config) OVERRIDE; |
46 virtual const std::string& initiator_token() OVERRIDE; | 44 virtual const std::string& initiator_token() OVERRIDE; |
47 virtual void set_initiator_token(const std::string& initiator_token) OVERRIDE; | 45 virtual void set_initiator_token(const std::string& initiator_token) OVERRIDE; |
48 virtual const std::string& receiver_token() OVERRIDE; | 46 virtual const std::string& receiver_token() OVERRIDE; |
49 virtual void set_receiver_token(const std::string& receiver_token) OVERRIDE; | 47 virtual void set_receiver_token(const std::string& receiver_token) OVERRIDE; |
50 virtual void set_shared_secret(const std::string& secret) OVERRIDE; | 48 virtual void set_shared_secret(const std::string& secret) OVERRIDE; |
51 virtual const std::string& shared_secret() OVERRIDE; | 49 virtual const std::string& shared_secret() OVERRIDE; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 112 |
115 void AddChannelConnector(const std::string& name, | 113 void AddChannelConnector(const std::string& name, |
116 JingleChannelConnector* connector); | 114 JingleChannelConnector* connector); |
117 | 115 |
118 // Called by JingleChannelConnector when it has finished connecting | 116 // Called by JingleChannelConnector when it has finished connecting |
119 // the channel, to remove itself from the table of pending connectors. The | 117 // the channel, to remove itself from the table of pending connectors. The |
120 // connector assumes responsibility for destroying itself after this call. | 118 // connector assumes responsibility for destroying itself after this call. |
121 void OnChannelConnectorFinished(const std::string& name, | 119 void OnChannelConnectorFinished(const std::string& name, |
122 JingleChannelConnector* connector); | 120 JingleChannelConnector* connector); |
123 | 121 |
124 // Creates channels after session has been accepted. | |
125 // TODO(sergeyu): Don't create channels in JingleSession. | |
126 void CreateChannels(); | |
127 | |
128 // Callbacks for the channels created in JingleSession. | |
129 // TODO(sergeyu): Remove this method once *_channel() methods are | |
130 // removed from Session interface. | |
131 void OnChannelConnected(scoped_ptr<net::Socket>* socket_container, | |
132 net::StreamSocket* socket); | |
133 | |
134 const cricket::ContentInfo* GetContentInfo() const; | 122 const cricket::ContentInfo* GetContentInfo() const; |
135 | 123 |
136 void SetState(State new_state); | 124 void SetState(State new_state); |
137 | 125 |
138 // JingleSessionManager that created this session. Guaranteed to | 126 // JingleSessionManager that created this session. Guaranteed to |
139 // exist throughout the lifetime of the session. | 127 // exist throughout the lifetime of the session. |
140 JingleSessionManager* jingle_session_manager_; | 128 JingleSessionManager* jingle_session_manager_; |
141 | 129 |
142 // Certificates used for connection. Currently only receiving side | 130 // Certificates used for connection. Currently only receiving side |
143 // has a certificate. | 131 // has a certificate. |
(...skipping 29 matching lines...) Expand all Loading... |
173 | 161 |
174 std::string initiator_token_; | 162 std::string initiator_token_; |
175 std::string receiver_token_; | 163 std::string receiver_token_; |
176 | 164 |
177 // These data members are only set on the receiving side. | 165 // These data members are only set on the receiving side. |
178 scoped_ptr<const CandidateSessionConfig> candidate_config_; | 166 scoped_ptr<const CandidateSessionConfig> candidate_config_; |
179 | 167 |
180 // Channels that are currently being connected. | 168 // Channels that are currently being connected. |
181 ChannelConnectorsMap channel_connectors_; | 169 ChannelConnectorsMap channel_connectors_; |
182 | 170 |
183 scoped_ptr<net::Socket> control_channel_socket_; | |
184 scoped_ptr<net::Socket> event_channel_socket_; | |
185 | |
186 ScopedRunnableMethodFactory<JingleSession> task_factory_; | 171 ScopedRunnableMethodFactory<JingleSession> task_factory_; |
187 | 172 |
188 DISALLOW_COPY_AND_ASSIGN(JingleSession); | 173 DISALLOW_COPY_AND_ASSIGN(JingleSession); |
189 }; | 174 }; |
190 | 175 |
191 } // namespace protocol | 176 } // namespace protocol |
192 | 177 |
193 } // namespace remoting | 178 } // namespace remoting |
194 | 179 |
195 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ | 180 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ |
OLD | NEW |