| 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/threading/thread.h" | 9 #include "base/threading/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(MessageLoop* ui_message_loop) |
| 15 : main_thread_("ChromotingMainThread"), | 15 : main_thread_("ChromotingMainThread"), |
| 16 encode_thread_("ChromotingEncodeThread") { | 16 encode_thread_("ChromotingEncodeThread"), |
| 17 ui_message_loop_(ui_message_loop) { |
| 17 } | 18 } |
| 18 | 19 |
| 19 ChromotingHostContext::~ChromotingHostContext() { | 20 ChromotingHostContext::~ChromotingHostContext() { |
| 20 } | 21 } |
| 21 | 22 |
| 22 void ChromotingHostContext::Start() { | 23 void ChromotingHostContext::Start() { |
| 23 // Start all the threads. | 24 // Start all the threads. |
| 24 main_thread_.Start(); | 25 main_thread_.Start(); |
| 25 encode_thread_.Start(); | 26 encode_thread_.Start(); |
| 26 jingle_thread_.Start(); | 27 jingle_thread_.Start(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 42 } | 43 } |
| 43 | 44 |
| 44 MessageLoop* ChromotingHostContext::encode_message_loop() { | 45 MessageLoop* ChromotingHostContext::encode_message_loop() { |
| 45 return encode_thread_.message_loop(); | 46 return encode_thread_.message_loop(); |
| 46 } | 47 } |
| 47 | 48 |
| 48 MessageLoop* ChromotingHostContext::network_message_loop() { | 49 MessageLoop* ChromotingHostContext::network_message_loop() { |
| 49 return jingle_thread_.message_loop(); | 50 return jingle_thread_.message_loop(); |
| 50 } | 51 } |
| 51 | 52 |
| 53 MessageLoop* ChromotingHostContext::ui_message_loop() { |
| 54 return ui_message_loop_; |
| 55 } |
| 56 |
| 52 } // namespace remoting | 57 } // namespace remoting |
| OLD | NEW |