[email protected] | 60398cc | 2012-01-04 03:36:18 | [diff] [blame] | 1 | // Copyright (c) 2012 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 | |
[email protected] | 6be34a67 | 2012-06-12 01:52:54 | [diff] [blame] | 12 | namespace base { |
13 | class SingleThreadTaskRunner; | ||||
14 | } // namespace base | ||||
15 | |||||
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 16 | namespace remoting { |
17 | |||||
18 | // A class that manages threads and running context for the chromoting client | ||||
[email protected] | 1e7bea3 | 2011-08-04 14:53:42 | [diff] [blame] | 19 | // process. |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 20 | class ClientContext { |
21 | public: | ||||
[email protected] | 6be34a67 | 2012-06-12 01:52:54 | [diff] [blame] | 22 | // |main_task_runner| is the task runner for the main plugin thread |
23 | // that is used for all PPAPI calls, e.g. network and graphics. | ||||
24 | ClientContext(base::SingleThreadTaskRunner* main_task_runner); | ||||
[email protected] | 1e7bea3 | 2011-08-04 14:53:42 | [diff] [blame] | 25 | virtual ~ClientContext(); |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 26 | |
27 | void Start(); | ||||
28 | void Stop(); | ||||
29 | |||||
[email protected] | 6be34a67 | 2012-06-12 01:52:54 | [diff] [blame] | 30 | base::SingleThreadTaskRunner* main_task_runner(); |
31 | base::SingleThreadTaskRunner* decode_task_runner(); | ||||
[email protected] | 22d7f3b | 2012-08-04 01:15:20 | [diff] [blame^] | 32 | base::SingleThreadTaskRunner* audio_decode_task_runner(); |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 33 | |
34 | private: | ||||
[email protected] | 6be34a67 | 2012-06-12 01:52:54 | [diff] [blame] | 35 | scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 36 | |
[email protected] | 22d7f3b | 2012-08-04 01:15:20 | [diff] [blame^] | 37 | // A thread that handles all video decode operations. |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 38 | base::Thread decode_thread_; |
39 | |||||
[email protected] | 22d7f3b | 2012-08-04 01:15:20 | [diff] [blame^] | 40 | // A thread that handles all audio decode operations. |
41 | base::Thread audio_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_ |