• 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 #include "remoting/client/client_context.h"
6 
7 namespace remoting {
8 
ClientContext(const scoped_refptr<base::SingleThreadTaskRunner> & main_task_runner)9 ClientContext::ClientContext(
10     const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner)
11     : main_task_runner_(main_task_runner),
12       decode_thread_("ChromotingClientDecodeThread"),
13       audio_decode_thread_("ChromotingClientAudioDecodeThread") {
14 }
15 
~ClientContext()16 ClientContext::~ClientContext() {
17 }
18 
Start()19 void ClientContext::Start() {
20   // Start all the threads.
21   decode_thread_.Start();
22   audio_decode_thread_.Start();
23 }
24 
Stop()25 void ClientContext::Stop() {
26   // Stop all the threads.
27   decode_thread_.Stop();
28   audio_decode_thread_.Stop();
29 }
30 
main_task_runner()31 base::SingleThreadTaskRunner* ClientContext::main_task_runner() {
32   return main_task_runner_.get();
33 }
34 
decode_task_runner()35 base::SingleThreadTaskRunner* ClientContext::decode_task_runner() {
36   return decode_thread_.message_loop_proxy().get();
37 }
38 
audio_decode_task_runner()39 base::SingleThreadTaskRunner* ClientContext::audio_decode_task_runner() {
40   return audio_decode_thread_.message_loop_proxy().get();
41 }
42 
43 }  // namespace remoting
44