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_STREAM_CONNECTOR_H_ | 5 #ifndef REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_ |
6 #define REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_ | 6 #define REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // based on a secret shared by the two parties, and keying material derived | 35 // based on a secret shared by the two parties, and keying material derived |
36 // from the SSL session's master secret and nonces. | 36 // from the SSL session's master secret and nonces. |
37 class JingleStreamConnector : public JingleChannelConnector { | 37 class JingleStreamConnector : public JingleChannelConnector { |
38 public: | 38 public: |
39 JingleStreamConnector(JingleSession* session, | 39 JingleStreamConnector(JingleSession* session, |
40 const std::string& name, | 40 const std::string& name, |
41 const Session::StreamChannelCallback& callback); | 41 const Session::StreamChannelCallback& callback); |
42 virtual ~JingleStreamConnector(); | 42 virtual ~JingleStreamConnector(); |
43 | 43 |
44 // JingleChannelConnector implementation. | 44 // JingleChannelConnector implementation. |
45 virtual void Connect(ChannelAuthenticator* authenticator, | 45 virtual void Connect(scoped_ptr<ChannelAuthenticator> authenticator, |
46 cricket::TransportChannel* raw_channel) OVERRIDE; | 46 cricket::TransportChannel* raw_channel) OVERRIDE; |
47 | 47 |
48 private: | 48 private: |
49 bool EstablishTCPConnection(net::Socket* socket); | 49 bool EstablishTCPConnection(net::Socket* socket); |
50 void OnTCPConnect(int result); | 50 void OnTCPConnect(int result); |
51 void OnAuthenticationDone(net::Error error, net::StreamSocket* socket); | 51 void OnAuthenticationDone(net::Error error, net::StreamSocket* socket); |
52 | 52 |
53 void NotifyDone(net::StreamSocket* socket); | 53 void NotifyDone(net::StreamSocket* socket); |
54 void NotifyError(); | 54 void NotifyError(); |
55 | 55 |
56 JingleSession* session_; | 56 JingleSession* session_; |
57 std::string name_; | 57 std::string name_; |
58 Session::StreamChannelCallback callback_; | 58 Session::StreamChannelCallback callback_; |
59 | 59 |
60 cricket::TransportChannel* raw_channel_; | 60 cricket::TransportChannel* raw_channel_; |
61 scoped_ptr<net::StreamSocket> tcp_socket_; | 61 scoped_ptr<net::StreamSocket> tcp_socket_; |
62 scoped_ptr<net::SSLSocket> socket_; | 62 scoped_ptr<net::SSLSocket> socket_; |
63 | 63 |
64 scoped_ptr<ChannelAuthenticator> authenticator_; | 64 scoped_ptr<ChannelAuthenticator> authenticator_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(JingleStreamConnector); | 66 DISALLOW_COPY_AND_ASSIGN(JingleStreamConnector); |
67 }; | 67 }; |
68 | 68 |
69 } // namespace protocol | 69 } // namespace protocol |
70 } // namespace remoting | 70 } // namespace remoting |
71 | 71 |
72 #endif // REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_ | 72 #endif // REMOTING_PROTOCOL_JINGLE_STREAM_CONNECTOR_H_ |
OLD | NEW |