Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Unified Diff: remoting/host/simple_host.cc

Issue 2790002: Set up the message loop of the mac host to be UI based so that it can pick up... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/simple_host.cc
===================================================================
--- remoting/host/simple_host.cc (revision 49219)
+++ remoting/host/simple_host.cc (working copy)
@@ -12,12 +12,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& password,
Capturer* capturer,
Encoder* encoder,
EventExecutor* executor)
- : capture_thread_("CaptureThread"),
+ : main_loop_(kSimpleHostMessageLoopType),
+ capture_thread_("CaptureThread"),
encode_thread_("EncodeThread"),
username_(username),
password_(password),
@@ -38,7 +47,7 @@
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());
@@ -105,9 +114,9 @@
// 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();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698