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_CLIENT_CONTEXT_H_ | 5 #ifndef REMOTING_CLIENT_CLIENT_CONTEXT_H_ |
6 #define REMOTING_CLIENT_CLIENT_CONTEXT_H_ | 6 #define REMOTING_CLIENT_CLIENT_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "base/message_loop_proxy.h" |
10 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
11 | 12 |
12 namespace remoting { | 13 namespace remoting { |
13 | 14 |
14 // A class that manages threads and running context for the chromoting client | 15 // A class that manages threads and running context for the chromoting client |
15 // process. | 16 // process. |
16 class ClientContext { | 17 class ClientContext { |
17 public: | 18 public: |
18 ClientContext(); | 19 ClientContext(); |
19 virtual ~ClientContext(); | 20 virtual ~ClientContext(); |
20 | 21 |
21 void Start(); | 22 void Start(); |
22 void Stop(); | 23 void Stop(); |
23 | 24 |
24 MessageLoop* main_message_loop(); | 25 MessageLoop* main_message_loop(); |
25 MessageLoop* decode_message_loop(); | 26 MessageLoop* decode_message_loop(); |
26 MessageLoop* network_message_loop(); | 27 base::MessageLoopProxy* network_message_loop(); |
27 | 28 |
28 private: | 29 private: |
29 // A thread that handles capture rate control and sending data to the | 30 // A thread that handles capture rate control and sending data to the |
30 // HostConnection. | 31 // HostConnection. |
31 base::Thread main_thread_; | 32 base::Thread main_thread_; |
32 | 33 |
33 // A thread that handles all decode operations. | 34 // A thread that handles all decode operations. |
34 base::Thread decode_thread_; | 35 base::Thread decode_thread_; |
35 | 36 |
36 // A thread that handles all network IO. | 37 // A thread that handles all network IO. |
| 38 // |
| 39 // TODO(sergeyu): Remove |network_thread_| and use main plugin |
| 40 // message loop for network IO. |
37 base::Thread network_thread_; | 41 base::Thread network_thread_; |
38 | 42 |
| 43 scoped_refptr<base::MessageLoopProxy> network_message_loop_; |
| 44 |
39 DISALLOW_COPY_AND_ASSIGN(ClientContext); | 45 DISALLOW_COPY_AND_ASSIGN(ClientContext); |
40 }; | 46 }; |
41 | 47 |
42 } // namespace remoting | 48 } // namespace remoting |
43 | 49 |
44 #endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_ | 50 #endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_ |
OLD | NEW |