blob: 19c36f3c3564d7654d9561e81100a237b244a721 [file] [log] [blame]
[email protected]60398cc2012-01-04 03:36:181// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]4d37c8742010-07-20 00:34:572// 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]34b99632011-01-01 01:01:0610#include "base/threading/thread.h"
[email protected]4d37c8742010-07-20 00:34:5711
[email protected]6be34a672012-06-12 01:52:5412namespace base {
13class SingleThreadTaskRunner;
14} // namespace base
15
[email protected]4d37c8742010-07-20 00:34:5716namespace remoting {
17
18// A class that manages threads and running context for the chromoting client
[email protected]1e7bea32011-08-04 14:53:4219// process.
[email protected]4d37c8742010-07-20 00:34:5720class ClientContext {
21 public:
[email protected]6be34a672012-06-12 01:52:5422 // |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]1e7bea32011-08-04 14:53:4225 virtual ~ClientContext();
[email protected]4d37c8742010-07-20 00:34:5726
27 void Start();
28 void Stop();
29
[email protected]6be34a672012-06-12 01:52:5430 base::SingleThreadTaskRunner* main_task_runner();
31 base::SingleThreadTaskRunner* decode_task_runner();
[email protected]22d7f3b2012-08-04 01:15:2032 base::SingleThreadTaskRunner* audio_decode_task_runner();
[email protected]4d37c8742010-07-20 00:34:5733
34 private:
[email protected]6be34a672012-06-12 01:52:5435 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
[email protected]4d37c8742010-07-20 00:34:5736
[email protected]22d7f3b2012-08-04 01:15:2037 // A thread that handles all video decode operations.
[email protected]4d37c8742010-07-20 00:34:5738 base::Thread decode_thread_;
39
[email protected]22d7f3b2012-08-04 01:15:2040 // A thread that handles all audio decode operations.
41 base::Thread audio_decode_thread_;
42
[email protected]4d37c8742010-07-20 00:34:5743 DISALLOW_COPY_AND_ASSIGN(ClientContext);
44};
45
46} // namespace remoting
47
48#endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_