OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/chromoting_host_context.h" | 5 #include "remoting/host/chromoting_host_context.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/thread.h" | 9 #include "base/thread.h" |
10 #include "remoting/jingle_glue/jingle_thread.h" | 10 #include "remoting/jingle_glue/jingle_thread.h" |
11 | 11 |
12 namespace remoting { | 12 namespace remoting { |
13 | 13 |
14 ChromotingHostContext::ChromotingHostContext() | 14 ChromotingHostContext::ChromotingHostContext() |
15 : main_thread_("ChromotingMainThread"), | 15 : main_thread_("ChromotingMainThread"), |
16 capture_thread_("ChromotingCaptureThread"), | |
17 encode_thread_("ChromotingEncodeThread") { | 16 encode_thread_("ChromotingEncodeThread") { |
18 } | 17 } |
19 | 18 |
20 ChromotingHostContext::~ChromotingHostContext() { | 19 ChromotingHostContext::~ChromotingHostContext() { |
21 } | 20 } |
22 | 21 |
23 void ChromotingHostContext::Start() { | 22 void ChromotingHostContext::Start() { |
24 // Start all the threads. | 23 // Start all the threads. |
25 main_thread_.Start(); | 24 main_thread_.Start(); |
26 capture_thread_.Start(); | |
27 encode_thread_.Start(); | 25 encode_thread_.Start(); |
28 jingle_thread_.Start(); | 26 jingle_thread_.Start(); |
29 } | 27 } |
30 | 28 |
31 void ChromotingHostContext::Stop() { | 29 void ChromotingHostContext::Stop() { |
32 // Stop all the threads. | 30 // Stop all the threads. |
33 jingle_thread_.Stop(); | 31 jingle_thread_.Stop(); |
34 encode_thread_.Stop(); | 32 encode_thread_.Stop(); |
35 capture_thread_.Stop(); | |
36 main_thread_.Stop(); | 33 main_thread_.Stop(); |
37 } | 34 } |
38 | 35 |
39 JingleThread* ChromotingHostContext::jingle_thread() { | 36 JingleThread* ChromotingHostContext::jingle_thread() { |
40 return &jingle_thread_; | 37 return &jingle_thread_; |
41 } | 38 } |
42 | 39 |
43 MessageLoop* ChromotingHostContext::main_message_loop() { | 40 MessageLoop* ChromotingHostContext::main_message_loop() { |
44 return main_thread_.message_loop(); | 41 return main_thread_.message_loop(); |
45 } | 42 } |
46 | 43 |
47 MessageLoop* ChromotingHostContext::capture_message_loop() { | |
48 return capture_thread_.message_loop(); | |
49 } | |
50 | |
51 MessageLoop* ChromotingHostContext::encode_message_loop() { | 44 MessageLoop* ChromotingHostContext::encode_message_loop() { |
52 return encode_thread_.message_loop(); | 45 return encode_thread_.message_loop(); |
53 } | 46 } |
54 | 47 |
| 48 MessageLoop* ChromotingHostContext::network_message_loop() { |
| 49 return jingle_thread_.message_loop(); |
| 50 } |
| 51 |
55 } // namespace remoting | 52 } // namespace remoting |
OLD | NEW |