[email protected] | 1e7bea3 | 2011-08-04 14:53:42 | [diff] [blame^] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef REMOTING_CLIENT_CLIENT_CONTEXT_H_ | ||||
6 | #define REMOTING_CLIENT_CLIENT_CONTEXT_H_ | ||||
7 | |||||
8 | #include <string> | ||||
9 | |||||
[email protected] | 34b9963 | 2011-01-01 01:01:06 | [diff] [blame] | 10 | #include "base/threading/thread.h" |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 11 | #include "remoting/jingle_glue/jingle_thread.h" |
12 | |||||
13 | namespace remoting { | ||||
14 | |||||
15 | // A class that manages threads and running context for the chromoting client | ||||
[email protected] | 1e7bea3 | 2011-08-04 14:53:42 | [diff] [blame^] | 16 | // process. |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 17 | class ClientContext { |
18 | public: | ||||
19 | ClientContext(); | ||||
[email protected] | 1e7bea3 | 2011-08-04 14:53:42 | [diff] [blame^] | 20 | virtual ~ClientContext(); |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 21 | |
22 | void Start(); | ||||
23 | void Stop(); | ||||
24 | |||||
25 | JingleThread* jingle_thread(); | ||||
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 26 | |
27 | MessageLoop* main_message_loop(); | ||||
28 | MessageLoop* decode_message_loop(); | ||||
[email protected] | bfea073c | 2011-06-24 20:11:38 | [diff] [blame] | 29 | MessageLoop* network_message_loop(); |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 30 | |
31 | private: | ||||
32 | // A thread that handles Jingle network operations (used in | ||||
33 | // JingleHostConnection). | ||||
34 | JingleThread jingle_thread_; | ||||
35 | |||||
36 | // A thread that handles capture rate control and sending data to the | ||||
37 | // HostConnection. | ||||
38 | base::Thread main_thread_; | ||||
39 | |||||
40 | // A thread that handles all decode operations. | ||||
41 | base::Thread decode_thread_; | ||||
42 | |||||
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 43 | DISALLOW_COPY_AND_ASSIGN(ClientContext); |
44 | }; | ||||
45 | |||||
46 | } // namespace remoting | ||||
47 | |||||
48 | #endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_ |