From 662256279693de926046e988d1136469e1125daf Mon Sep 17 00:00:00 2001 From: "dmaclach@chromium.org" Date: Wed, 9 Jun 2010 23:47:57 +0000 Subject: Set up the message loop of the mac host to be UI based so that it can pick up the system callbacks about screen changes. Also clean up some comments. BUG=none TEST=none Review URL: http://codereview.chromium.org/2790002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49342 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/simple_host.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'remoting/host') diff --git a/remoting/host/simple_host.cc b/remoting/host/simple_host.cc index ab9f6b7..bfff330 100644 --- a/remoting/host/simple_host.cc +++ b/remoting/host/simple_host.cc @@ -13,12 +13,21 @@ namespace remoting { +#if defined (OS_MACOSX) +// The Mac depends on system callbacks to tell it what rectangles need to +// be updated, so we need to use the system message loop. +const MessageLoop::Type kSimpleHostMessageLoopType = MessageLoop::TYPE_UI; +#else +const MessageLoop::Type kSimpleHostMessageLoopType = MessageLoop::TYPE_DEFAULT; +#endif // defined (OS_MACOSX) + SimpleHost::SimpleHost(const std::string& username, const std::string& auth_token, Capturer* capturer, Encoder* encoder, EventExecutor* executor) - : capture_thread_("CaptureThread"), + : main_loop_(kSimpleHostMessageLoopType), + capture_thread_("CaptureThread"), encode_thread_("EncodeThread"), username_(username), auth_token_(auth_token), @@ -39,7 +48,7 @@ void SimpleHost::Run() { main_loop_.Run(); } -// This method is called when we need to the host process. +// This method is called when we need to destroy the host process. void SimpleHost::DestroySession() { DCHECK_EQ(&main_loop_, MessageLoop::current()); @@ -112,9 +121,9 @@ void SimpleHost::OnClientDisconnected(ClientConnection* client) { // Also remove reference to ClientConnection from this object. client_ = NULL; - // TODO(hclam): If the last client has disconnected we need destroy + // TODO(hclam): If the last client has disconnected we need to destroy // the session manager and shutdown the capture and encode threads. - // Right now we assume there's only one client. + // Right now we assume that there's only one client. DestroySession(); } -- cgit v1.1