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

Unified Diff: remoting/client/client_context.cc

Issue 7635030: Add PluginMessageLoopProxy and use it for Host plugin UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang Created 9 years, 4 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 | « remoting/client/client_context.h ('k') | remoting/host/chromoting_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/client_context.cc
diff --git a/remoting/client/client_context.cc b/remoting/client/client_context.cc
index ca12714cf6dc8c2877ff25e9b6329ec5c0eaf79e..908602e864b281ad1773257d6f7ff9426ad00104 100644
--- a/remoting/client/client_context.cc
+++ b/remoting/client/client_context.cc
@@ -4,8 +4,21 @@
#include "remoting/client/client_context.h"
+#include "base/bind.h"
+#include "base/synchronization/waitable_event.h"
+
namespace remoting {
+namespace {
awong 2011/08/15 20:17:53 add newline.
Sergey Ulanov 2011/08/15 22:39:52 This code is gone now.
+void InitializeMessageLoopProxy(
+ scoped_refptr<base::MessageLoopProxy>* proxy,
+ base::WaitableEvent* done) {
+ *proxy = base::MessageLoopProxy::CreateForCurrentThread();
+ done->Signal();
+}
+
+} // namespace
+
ClientContext::ClientContext()
: main_thread_("ChromotingClientMainThread"),
decode_thread_("ChromotingClientDecodeThread"),
@@ -21,6 +34,12 @@ void ClientContext::Start() {
decode_thread_.Start();
network_thread_.StartWithOptions(
base::Thread::Options(MessageLoop::TYPE_IO, 0));
+
+ // Initialize |network_message_loop_| on the network thread.
+ base::WaitableEvent proxy_event(true, false);
+ network_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
+ &InitializeMessageLoopProxy, &network_message_loop_, &proxy_event));
+ proxy_event.Wait();
}
void ClientContext::Stop() {
@@ -39,7 +58,7 @@ MessageLoop* ClientContext::decode_message_loop() {
}
base::MessageLoopProxy* ClientContext::network_message_loop() {
- return network_thread_.message_loop_proxy();
+ return network_message_loop_;
}
} // namespace remoting
« no previous file with comments | « remoting/client/client_context.h ('k') | remoting/host/chromoting_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698