diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-18 22:55:42 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-18 22:55:42 +0000 |
commit | 708cd3cb0c7cc991b31ade26abc96f0e503ef485 (patch) | |
tree | 678786fa5387a557f57b33ea42500a889a2fcb78 /remoting/host | |
parent | 269200b1c5008621167dbd619576281337b421a4 (diff) | |
download | chromium_src-708cd3cb0c7cc991b31ade26abc96f0e503ef485.zip chromium_src-708cd3cb0c7cc991b31ade26abc96f0e503ef485.tar.gz chromium_src-708cd3cb0c7cc991b31ade26abc96f0e503ef485.tar.bz2 |
Remove capture thread in Chromoting host
Move operations from capture thread to main thread. Also move operations in SessionManager on main thread to network thread.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/5123002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
-rw-r--r-- | remoting/host/chromoting_host.cc | 22 | ||||
-rw-r--r-- | remoting/host/chromoting_host_context.cc | 11 | ||||
-rw-r--r-- | remoting/host/chromoting_host_context.h | 5 | ||||
-rw-r--r-- | remoting/host/chromoting_host_context_unittest.cc | 2 | ||||
-rw-r--r-- | remoting/host/simple_host_process.cc | 2 |
5 files changed, 17 insertions, 25 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index e8b2ccc..67798a9 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc @@ -42,19 +42,19 @@ ChromotingHost::ChromotingHost(ChromotingHostContext* context, config_(config), #if defined(OS_WIN) capturer_(new remoting::CapturerGdi( - context->capture_message_loop())), + context->main_message_loop())), input_stub_(new remoting::EventExecutorWin( - context->capture_message_loop(), capturer_.get())), + context->main_message_loop(), capturer_.get())), #elif defined(OS_LINUX) capturer_(new remoting::CapturerLinux( - context->capture_message_loop())), + context->main_message_loop())), input_stub_(new remoting::EventExecutorLinux( - context->capture_message_loop(), capturer_.get())), + context->main_message_loop(), capturer_.get())), #elif defined(OS_MACOSX) capturer_(new remoting::CapturerMac( - context->capture_message_loop())), + context->main_message_loop())), input_stub_(new remoting::EventExecutorMac( - context->capture_message_loop(), capturer_.get())), + context->main_message_loop(), capturer_.get())), #endif host_stub_(new HostStubFake()), state_(kInitial) { @@ -67,13 +67,13 @@ ChromotingHost::ChromotingHost(ChromotingHostContext* context, capturer_(capturer), #if defined(OS_WIN) input_stub_(new remoting::EventExecutorWin( - context->capture_message_loop(), capturer)), + context->main_message_loop(), capturer)), #elif defined(OS_LINUX) input_stub_(new remoting::EventExecutorLinux( - context->capture_message_loop(), capturer)), + context->main_message_loop(), capturer)), #elif defined(OS_MACOSX) input_stub_(new remoting::EventExecutorMac( - context->capture_message_loop(), capturer)), + context->main_message_loop(), capturer)), #endif host_stub_(new HostStubFake()), state_(kInitial) { @@ -191,9 +191,9 @@ void ChromotingHost::OnClientConnected(ConnectionToClient* connection) { Encoder* encoder = CreateEncoder(connection->session()->config()); - session_ = new SessionManager(context_->capture_message_loop(), + session_ = new SessionManager(context_->main_message_loop(), context_->encode_message_loop(), - context_->main_message_loop(), + context_->network_message_loop(), capturer_.release(), encoder); } diff --git a/remoting/host/chromoting_host_context.cc b/remoting/host/chromoting_host_context.cc index b3cdaf6..560803d 100644 --- a/remoting/host/chromoting_host_context.cc +++ b/remoting/host/chromoting_host_context.cc @@ -13,7 +13,6 @@ namespace remoting { ChromotingHostContext::ChromotingHostContext() : main_thread_("ChromotingMainThread"), - capture_thread_("ChromotingCaptureThread"), encode_thread_("ChromotingEncodeThread") { } @@ -23,7 +22,6 @@ ChromotingHostContext::~ChromotingHostContext() { void ChromotingHostContext::Start() { // Start all the threads. main_thread_.Start(); - capture_thread_.Start(); encode_thread_.Start(); jingle_thread_.Start(); } @@ -32,7 +30,6 @@ void ChromotingHostContext::Stop() { // Stop all the threads. jingle_thread_.Stop(); encode_thread_.Stop(); - capture_thread_.Stop(); main_thread_.Stop(); } @@ -44,12 +41,12 @@ MessageLoop* ChromotingHostContext::main_message_loop() { return main_thread_.message_loop(); } -MessageLoop* ChromotingHostContext::capture_message_loop() { - return capture_thread_.message_loop(); -} - MessageLoop* ChromotingHostContext::encode_message_loop() { return encode_thread_.message_loop(); } +MessageLoop* ChromotingHostContext::network_message_loop() { + return jingle_thread_.message_loop(); +} + } // namespace remoting diff --git a/remoting/host/chromoting_host_context.h b/remoting/host/chromoting_host_context.h index f5b2783..6a82320 100644 --- a/remoting/host/chromoting_host_context.h +++ b/remoting/host/chromoting_host_context.h @@ -31,8 +31,8 @@ class ChromotingHostContext { // TODO(hclam): Change these all to MessageLoopProxy. virtual MessageLoop* main_message_loop(); - virtual MessageLoop* capture_message_loop(); virtual MessageLoop* encode_message_loop(); + virtual MessageLoop* network_message_loop(); private: FRIEND_TEST_ALL_PREFIXES(ChromotingHostContextTest, StartAndStop); @@ -43,9 +43,6 @@ class ChromotingHostContext { // A thread that hosts ChromotingHost and performs rate control. base::Thread main_thread_; - // A thread that hosts all capture operations. - base::Thread capture_thread_; - // A thread that hosts all encode operations. base::Thread encode_thread_; diff --git a/remoting/host/chromoting_host_context_unittest.cc b/remoting/host/chromoting_host_context_unittest.cc index 6b481d7..827ad37 100644 --- a/remoting/host/chromoting_host_context_unittest.cc +++ b/remoting/host/chromoting_host_context_unittest.cc @@ -15,13 +15,11 @@ TEST(ChromotingHostContextTest, StartAndStop) { context.Start(); EXPECT_TRUE(context.jingle_thread()); EXPECT_TRUE(context.main_message_loop()); - EXPECT_TRUE(context.capture_message_loop()); EXPECT_TRUE(context.encode_message_loop()); context.Stop(); // Expect all the threads are stopped. EXPECT_FALSE(context.main_thread_.IsRunning()); - EXPECT_FALSE(context.capture_thread_.IsRunning()); EXPECT_FALSE(context.encode_thread_.IsRunning()); } diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc index 5decb81..269b76f 100644 --- a/remoting/host/simple_host_process.cc +++ b/remoting/host/simple_host_process.cc @@ -104,7 +104,7 @@ int main(int argc, char** argv) { if (fake) { host = new remoting::ChromotingHost( &context, config, - new remoting::CapturerFake(context.capture_message_loop())); + new remoting::CapturerFake(context.main_message_loop())); } else { host = new remoting::ChromotingHost(&context, config); } |