blob: 4ad0faba196deabfb5fe4747de9f3ee2622d5899 (
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
|
// Copyright (c) 2010 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()
: main_thread_("ChromotingClientMainThread"),
decode_thread_("ChromotingClientDecodeThread"),
network_thread_("ChromotingClientNetworkThread") {
}
ClientContext::~ClientContext() {
}
void ClientContext::Start() {
// Start all the threads.
main_thread_.Start();
decode_thread_.Start();
network_thread_.StartWithOptions(
base::Thread::Options(MessageLoop::TYPE_IO, 0));
}
void ClientContext::Stop() {
// Stop all the threads.
network_thread_.Stop();
decode_thread_.Stop();
main_thread_.Stop();
}
MessageLoop* ClientContext::main_message_loop() {
return main_thread_.message_loop();
}
MessageLoop* ClientContext::decode_message_loop() {
return decode_thread_.message_loop();
}
MessageLoop* ClientContext::network_message_loop() {
return network_thread_.message_loop();
}
} // namespace remoting
|