OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CLIENT_HOST_CONNECTION_H_ | 5 #ifndef REMOTING_CLIENT_HOST_CONNECTION_H_ |
6 #define REMOTING_CLIENT_HOST_CONNECTION_H_ | 6 #define REMOTING_CLIENT_HOST_CONNECTION_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Called when the network connection has failed. | 41 // Called when the network connection has failed. |
42 virtual void OnConnectionFailed(HostConnection* conn) = 0; | 42 virtual void OnConnectionFailed(HostConnection* conn) = 0; |
43 }; | 43 }; |
44 | 44 |
45 // Constructs a HostConnection object. | 45 // Constructs a HostConnection object. |
46 HostConnection(ProtocolDecoder* decoder, EventHandler* handler); | 46 HostConnection(ProtocolDecoder* decoder, EventHandler* handler); |
47 | 47 |
48 virtual ~HostConnection(); | 48 virtual ~HostConnection(); |
49 | 49 |
50 void Connect(const std::string& username, const std::string& auth_token, | 50 void Connect(const std::string& username, const std::string& password, |
51 const std::string& host_jid); | 51 const std::string& host_jid); |
52 void Disconnect(); | 52 void Disconnect(); |
53 | 53 |
54 // JingleChannel::Callback interface. | 54 // JingleChannel::Callback interface. |
55 void OnStateChange(JingleChannel* channel, JingleChannel::State state); | 55 void OnStateChange(JingleChannel* channel, JingleChannel::State state); |
56 void OnPacketReceived(JingleChannel* channel, | 56 void OnPacketReceived(JingleChannel* channel, |
57 scoped_refptr<media::DataBuffer> buffer); | 57 scoped_refptr<media::DataBuffer> buffer); |
58 | 58 |
59 // JingleClient::Callback interface. | 59 // JingleClient::Callback interface. |
60 void OnStateChange(JingleClient* client, JingleClient::State state); | 60 void OnStateChange(JingleClient* client, JingleClient::State state); |
61 bool OnAcceptConnection(JingleClient* client, const std::string& jid, | 61 bool OnAcceptConnection(JingleClient* client, const std::string& jid, |
62 JingleChannel::Callback** callback); | 62 JingleChannel::Callback** callback); |
63 void OnNewConnection(JingleClient* client, | 63 void OnNewConnection(JingleClient* client, |
64 scoped_refptr<JingleChannel> channel); | 64 scoped_refptr<JingleChannel> channel); |
65 | 65 |
66 private: | 66 private: |
67 scoped_refptr<JingleClient> jingle_client_; | 67 scoped_refptr<JingleClient> jingle_client_; |
68 scoped_refptr<JingleChannel> jingle_channel_; | 68 scoped_refptr<JingleChannel> jingle_channel_; |
69 scoped_ptr<ProtocolDecoder> decoder_; | 69 scoped_ptr<ProtocolDecoder> decoder_; |
70 EventHandler* handler_; | 70 EventHandler* handler_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(HostConnection); | 72 DISALLOW_COPY_AND_ASSIGN(HostConnection); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace remoting | 75 } // namespace remoting |
76 | 76 |
77 #endif // REMOTING_CLIENT_HOST_CONNECTION_H_ | 77 #endif // REMOTING_CLIENT_HOST_CONNECTION_H_ |
OLD | NEW |