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 // JingleHostConnection implements the HostConnection interface using | 5 // JingleHostConnection implements the HostConnection interface using |
6 // libjingle as the transport protocol. | 6 // libjingle as the transport protocol. |
7 // | 7 // |
8 // Much of this class focuses on translating JingleClient and | 8 // Much of this class focuses on translating JingleClient and |
9 // ChromotingConnection callbacks into HostConnection::HostEventCallback | 9 // ChromotingConnection callbacks into HostConnection::HostEventCallback |
10 // messages. | 10 // messages. |
11 // | 11 // |
12 // The public API of this class is designed to be asynchronous, and thread | 12 // The public API of this class is designed to be asynchronous, and thread |
13 // safe for invocation from other threads. | 13 // safe for invocation from other threads. |
14 // | 14 // |
15 // Internally though, all work delegeated to the |network_thread| given | 15 // Internally though, all work delegeated to the |network_thread| given |
16 // during construction. Any event handlers running on the |network_thread| | 16 // during construction. Any event handlers running on the |network_thread| |
17 // should not block. | 17 // should not block. |
18 | 18 |
19 #ifndef REMOTING_CLIENT_JINGLE_HOST_CONNECTION_H_ | 19 #ifndef REMOTING_CLIENT_JINGLE_HOST_CONNECTION_H_ |
20 #define REMOTING_CLIENT_JINGLE_HOST_CONNECTION_H_ | 20 #define REMOTING_CLIENT_JINGLE_HOST_CONNECTION_H_ |
21 | 21 |
22 #include "base/ref_counted.h" | 22 #include "base/ref_counted.h" |
23 #include "base/scoped_ptr.h" | 23 #include "base/scoped_ptr.h" |
24 #include "base/task.h" | 24 #include "base/task.h" |
25 #include "remoting/client/client_context.h" | 25 #include "remoting/client/client_context.h" |
26 #include "remoting/client/host_connection.h" | 26 #include "remoting/client/host_connection.h" |
27 #include "remoting/jingle_glue/jingle_client.h" | 27 #include "remoting/jingle_glue/jingle_client.h" |
| 28 #include "remoting/protocol/message_reader.h" |
28 #include "remoting/protocol/chromotocol_connection.h" | 29 #include "remoting/protocol/chromotocol_connection.h" |
29 #include "remoting/protocol/chromotocol_server.h" | 30 #include "remoting/protocol/chromotocol_server.h" |
30 #include "remoting/protocol/stream_reader.h" | |
31 #include "remoting/protocol/stream_writer.h" | 31 #include "remoting/protocol/stream_writer.h" |
32 | 32 |
33 class MessageLoop; | 33 class MessageLoop; |
34 | 34 |
35 namespace remoting { | 35 namespace remoting { |
36 | 36 |
37 class JingleThread; | 37 class JingleThread; |
38 | 38 |
39 struct ClientConfig; | 39 struct ClientConfig; |
40 | 40 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void OnDisconnected(); | 78 void OnDisconnected(); |
79 void OnServerClosed(); | 79 void OnServerClosed(); |
80 | 80 |
81 ClientContext* context_; | 81 ClientContext* context_; |
82 | 82 |
83 scoped_refptr<JingleClient> jingle_client_; | 83 scoped_refptr<JingleClient> jingle_client_; |
84 scoped_refptr<ChromotocolServer> chromotocol_server_; | 84 scoped_refptr<ChromotocolServer> chromotocol_server_; |
85 scoped_refptr<ChromotocolConnection> connection_; | 85 scoped_refptr<ChromotocolConnection> connection_; |
86 | 86 |
87 EventStreamWriter event_writer_; | 87 EventStreamWriter event_writer_; |
88 VideoStreamReader video_reader_; | 88 MessageReader video_reader_; |
89 | 89 |
90 HostEventCallback* event_callback_; | 90 HostEventCallback* event_callback_; |
91 | 91 |
92 std::string host_jid_; | 92 std::string host_jid_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(JingleHostConnection); | 94 DISALLOW_COPY_AND_ASSIGN(JingleHostConnection); |
95 }; | 95 }; |
96 | 96 |
97 } // namespace remoting | 97 } // namespace remoting |
98 | 98 |
99 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::JingleHostConnection); | 99 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::JingleHostConnection); |
100 | 100 |
101 #endif // REMOTING_CLIENT_JINGLE_HOST_CONNECTION_H_ | 101 #endif // REMOTING_CLIENT_JINGLE_HOST_CONNECTION_H_ |
OLD | NEW |