blob: 49f0537817d02e621a32a3ce70c208051b05f765 [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
avi5a080f012015-12-22 23:15:4310#include "base/macros.h"
[email protected]34b99632011-01-01 01:01:0611#include "base/threading/thread.h"
[email protected]4d37c8742010-07-20 00:34:5712
[email protected]6be34a672012-06-12 01:52:5413namespace base {
14class SingleThreadTaskRunner;
15} // namespace base
16
[email protected]4d37c8742010-07-20 00:34:5717namespace remoting {
18
19// A class that manages threads and running context for the chromoting client
[email protected]1e7bea32011-08-04 14:53:4220// process.
[email protected]4d37c8742010-07-20 00:34:5721class ClientContext {
22 public:
[email protected]6be34a672012-06-12 01:52:5423 // |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.
dcheng04e05b52014-08-28 21:39:0125 ClientContext(
26 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner);
[email protected]1e7bea32011-08-04 14:53:4227 virtual ~ClientContext();
[email protected]4d37c8742010-07-20 00:34:5728
29 void Start();
30 void Stop();
31
sergeyu98a89e62014-12-19 03:53:2932 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]4d37c8742010-07-20 00:34:5735
36 private:
[email protected]6be34a672012-06-12 01:52:5437 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
[email protected]4d37c8742010-07-20 00:34:5738
[email protected]22d7f3b2012-08-04 01:15:2039 // A thread that handles all video decode operations.
[email protected]4d37c8742010-07-20 00:34:5740 base::Thread decode_thread_;
41
[email protected]22d7f3b2012-08-04 01:15:2042 // A thread that handles all audio decode operations.
43 base::Thread audio_decode_thread_;
44
[email protected]4d37c8742010-07-20 00:34:5745 DISALLOW_COPY_AND_ASSIGN(ClientContext);
46};
47
48} // namespace remoting
49
50#endif // REMOTING_CLIENT_CLIENT_CONTEXT_H_