[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 | |||||
avi | 5a080f01 | 2015-12-22 23:15:43 | [diff] [blame] | 10 | #include "base/macros.h" |
[email protected] | 34b9963 | 2011-01-01 01:01:06 | [diff] [blame] | 11 | #include "base/threading/thread.h" |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 12 | |
[email protected] | 6be34a67 | 2012-06-12 01:52:54 | [diff] [blame] | 13 | namespace base { |
14 | class SingleThreadTaskRunner; | ||||
15 | } // namespace base | ||||
16 | |||||
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 17 | namespace remoting { |
18 | |||||
19 | // A class that manages threads and running context for the chromoting client | ||||
[email protected] | 1e7bea3 | 2011-08-04 14:53:42 | [diff] [blame] | 20 | // process. |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 21 | class ClientContext { |
22 | public: | ||||
[email protected] | 6be34a67 | 2012-06-12 01:52:54 | [diff] [blame] | 23 | // |main_task_runner| is the task runner for the main plugin thread |
24 | // that is used for all PPAPI calls, e.g. network and graphics. | ||||
dcheng | 04e05b5 | 2014-08-28 21:39:01 | [diff] [blame] | 25 | ClientContext( |
26 | const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner); | ||||
[email protected] | 1e7bea3 | 2011-08-04 14:53:42 | [diff] [blame] | 27 | virtual ~ClientContext(); |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 28 | |
29 | void Start(); | ||||
30 | void Stop(); | ||||
31 | |||||
sergeyu | 98a89e6 | 2014-12-19 03:53:29 | [diff] [blame] | 32 | scoped_refptr<base::SingleThreadTaskRunner> main_task_runner() const; |
33 | scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner() const; | ||||
34 | scoped_refptr<base::SingleThreadTaskRunner> audio_decode_task_runner() const; | ||||
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 35 | |
36 | private: | ||||
[email protected] | 6be34a67 | 2012-06-12 01:52:54 | [diff] [blame] | 37 | scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 38 | |
[email protected] | 22d7f3b | 2012-08-04 01:15:20 | [diff] [blame] | 39 | // A thread that handles all video decode operations. |
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 40 | base::Thread decode_thread_; |
41 | |||||
[email protected] | 22d7f3b | 2012-08-04 01:15:20 | [diff] [blame] | 42 | // A thread that handles all audio decode operations. |
43 | base::Thread audio_decode_thread_; | ||||
44 | |||||
[email protected] | 4d37c874 | 2010-07-20 00:34:57 | [diff] [blame] | 45 | DISALLOW_COPY_AND_ASSIGN(ClientContext); |
46 | }; | ||||
47 | |||||
48 | } // namespace remoting | ||||
49 | |||||
50 | #endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_ |