summaryrefslogtreecommitdiffstats
path: root/remoting/client/client_context.cc
blob: 163bd0bffc1aedaa492c9ce0e383f97cabffe3c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "remoting/client/client_context.h"

namespace remoting {

ClientContext::ClientContext(
    const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner)
    : main_task_runner_(main_task_runner),
      decode_thread_("ChromotingClientDecodeThread"),
      audio_decode_thread_("ChromotingClientAudioDecodeThread") {
}

ClientContext::~ClientContext() {
}

void ClientContext::Start() {
  // Start all the threads.
  decode_thread_.Start();
  audio_decode_thread_.Start();
}

void ClientContext::Stop() {
  // Stop all the threads.
  decode_thread_.Stop();
  audio_decode_thread_.Stop();
}

scoped_refptr<base::SingleThreadTaskRunner> ClientContext::main_task_runner()
    const {
  return main_task_runner_;
}

scoped_refptr<base::SingleThreadTaskRunner> ClientContext::decode_task_runner()
    const {
  return decode_thread_.task_runner();
}

scoped_refptr<base::SingleThreadTaskRunner>
ClientContext::audio_decode_task_runner() const {
  return audio_decode_thread_.task_runner();
}

}  // namespace remoting