• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
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 
10 #include "base/threading/thread.h"
11 
12 namespace base {
13 class SingleThreadTaskRunner;
14 }  // namespace base
15 
16 namespace remoting {
17 
18 // A class that manages threads and running context for the chromoting client
19 // process.
20 class ClientContext {
21  public:
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);
25   virtual ~ClientContext();
26 
27   void Start();
28   void Stop();
29 
30   base::SingleThreadTaskRunner* main_task_runner();
31   base::SingleThreadTaskRunner* decode_task_runner();
32   base::SingleThreadTaskRunner* audio_decode_task_runner();
33 
34  private:
35   scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
36 
37   // A thread that handles all video decode operations.
38   base::Thread decode_thread_;
39 
40   // A thread that handles all audio decode operations.
41   base::Thread audio_decode_thread_;
42 
43   DISALLOW_COPY_AND_ASSIGN(ClientContext);
44 };
45 
46 }  // namespace remoting
47 
48 #endif  // REMOTING_CLIENT_CLIENT_CONTEXT_H_
49