summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 23:47:57 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 23:47:57 +0000
commit662256279693de926046e988d1136469e1125daf (patch)
tree38f6f689a5099d49ca7c491395c8bb53a7787456 /remoting
parent9ec5273f4d103f6f08ff4708656fe592cdcb2119 (diff)
downloadchromium_src-662256279693de926046e988d1136469e1125daf.zip
chromium_src-662256279693de926046e988d1136469e1125daf.tar.gz
chromium_src-662256279693de926046e988d1136469e1125daf.tar.bz2
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
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/simple_host.cc17
1 files changed, 13 insertions, 4 deletions
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();
}