summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorgarykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 22:27:34 +0000
committergarykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 22:27:34 +0000
commit6d0519776f74a699a5424b721a83a02ce4f9a25e (patch)
tree99778dc87c09d2b32695da42352e6aecad6e5248 /remoting
parent4933589c74b199901f2309eb406a4553700daa76 (diff)
downloadchromium_src-6d0519776f74a699a5424b721a83a02ce4f9a25e.zip
chromium_src-6d0519776f74a699a5424b721a83a02ce4f9a25e.tar.gz
chromium_src-6d0519776f74a699a5424b721a83a02ce4f9a25e.tar.bz2
Use the correct Chrome UI thread when creating the chromoting continue window.
Also, rename the ChromotingHostContext's |ui_thread_| to |desktop_thread_| to reduce the likelihood that we'll make this mistake in the future. BUG=none TEST=none Review URL: http://codereview.chromium.org/7218018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90121 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/chromoting_host.cc6
-rw-r--r--remoting/host/chromoting_host_context.cc10
-rw-r--r--remoting/host/chromoting_host_context.h6
-rw-r--r--remoting/host/simple_host_process.cc3
4 files changed, 13 insertions, 12 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 917edb0..0ebff52 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -45,7 +45,7 @@ ChromotingHost* ChromotingHost::Create(ChromotingHostContext* context,
AccessVerifier* access_verifier) {
Capturer* capturer = Capturer::Create();
EventExecutor* event_executor =
- EventExecutor::Create(context->ui_message_loop(), capturer);
+ EventExecutor::Create(context->desktop_message_loop(), capturer);
Curtain* curtain = Curtain::Create();
DisconnectWindow* disconnect_window = DisconnectWindow::Create();
ContinueWindow* continue_window = ContinueWindow::Create();
@@ -591,8 +591,8 @@ void ChromotingHost::ShowDisconnectWindow(bool show,
}
void ChromotingHost::ShowContinueWindow(bool show) {
- if (context_->ui_message_loop() != MessageLoop::current()) {
- context_->ui_message_loop()->PostTask(
+ if (!context_->IsUIThread()) {
+ context_->PostToUIThread(
FROM_HERE,
NewRunnableMethod(this, &ChromotingHost::ShowContinueWindow, show));
return;
diff --git a/remoting/host/chromoting_host_context.cc b/remoting/host/chromoting_host_context.cc
index bc3601e..93259dd 100644
--- a/remoting/host/chromoting_host_context.cc
+++ b/remoting/host/chromoting_host_context.cc
@@ -14,7 +14,7 @@ namespace remoting {
ChromotingHostContext::ChromotingHostContext()
: main_thread_("ChromotingMainThread"),
encode_thread_("ChromotingEncodeThread"),
- ui_thread_("ChromotingUiThread") {
+ desktop_thread_("ChromotingDesktopThread") {
}
ChromotingHostContext::~ChromotingHostContext() {
@@ -25,7 +25,7 @@ void ChromotingHostContext::Start() {
main_thread_.Start();
encode_thread_.Start();
jingle_thread_.Start();
- ui_thread_.Start();
+ desktop_thread_.Start();
}
void ChromotingHostContext::Stop() {
@@ -33,7 +33,7 @@ void ChromotingHostContext::Stop() {
jingle_thread_.Stop();
encode_thread_.Stop();
main_thread_.Stop();
- ui_thread_.Stop();
+ desktop_thread_.Stop();
}
JingleThread* ChromotingHostContext::jingle_thread() {
@@ -52,8 +52,8 @@ MessageLoop* ChromotingHostContext::network_message_loop() {
return jingle_thread_.message_loop();
}
-MessageLoop* ChromotingHostContext::ui_message_loop() {
- return ui_thread_.message_loop();
+MessageLoop* ChromotingHostContext::desktop_message_loop() {
+ return desktop_thread_.message_loop();
}
void ChromotingHostContext::SetUITaskPostFunction(const base::Callback<void(
diff --git a/remoting/host/chromoting_host_context.h b/remoting/host/chromoting_host_context.h
index 4efcb3d..3f54eb7 100644
--- a/remoting/host/chromoting_host_context.h
+++ b/remoting/host/chromoting_host_context.h
@@ -41,7 +41,7 @@ class ChromotingHostContext {
virtual MessageLoop* main_message_loop();
virtual MessageLoop* encode_message_loop();
virtual MessageLoop* network_message_loop();
- virtual MessageLoop* ui_message_loop();
+ virtual MessageLoop* desktop_message_loop();
// Must be called from the main GUI thread.
void SetUITaskPostFunction(const base::Callback<void(
@@ -62,9 +62,9 @@ class ChromotingHostContext {
// A thread that hosts all encode operations.
base::Thread encode_thread_;
- // A thread that hosts UI integration (capture, input injection, etc)
+ // A thread that hosts desktop integration (capture, input injection, etc)
// This is NOT a Chrome-style UI thread.
- base::Thread ui_thread_;
+ base::Thread desktop_thread_;
base::Callback<void(const tracked_objects::Location& from_here, Task* task)>
ui_poster_;
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index a620fef..0c4ff26 100644
--- a/remoting/host/simple_host_process.cc
+++ b/remoting/host/simple_host_process.cc
@@ -179,7 +179,8 @@ class SimpleHost {
remoting::Capturer* capturer =
new remoting::CapturerFake();
remoting::EventExecutor* event_executor =
- remoting::EventExecutor::Create(context.ui_message_loop(), capturer);
+ remoting::EventExecutor::Create(context.desktop_message_loop(),
+ capturer);
remoting::Curtain* curtain = remoting::Curtain::Create();
remoting::DisconnectWindow* disconnect_window =
remoting::DisconnectWindow::Create();