summaryrefslogtreecommitdiffstats
path: root/remoting/host/host_plugin.cc
diff options
context:
space:
mode:
authorlambroslambrou@google.com <lambroslambrou@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-15 19:29:01 +0000
committerlambroslambrou@google.com <lambroslambrou@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-15 19:29:01 +0000
commit217d63f8020735f190237b3cfc337a794df1d212 (patch)
tree2584f230988d85a60d0b85eeb13daf6e49924c71 /remoting/host/host_plugin.cc
parent63411a0180c7eb6678ca3681578479a3ab003436 (diff)
downloadchromium_src-217d63f8020735f190237b3cfc337a794df1d212.zip
chromium_src-217d63f8020735f190237b3cfc337a794df1d212.tar.gz
chromium_src-217d63f8020735f190237b3cfc337a794df1d212.tar.bz2
Revert 89227 - Run DisconnectWindow::Show/Hide on correct thread.
This is to ensure that the DisconnectWindow UI actions are carried out on the proper thread for making platform-native GUI API calls (for example, GTK on Linux). BUG=None TEST=Manual Review URL: http://codereview.chromium.org/7144010 TBR=lambroslambrou@chromium.org Review URL: http://codereview.chromium.org/7172024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89230 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/host_plugin.cc')
-rw-r--r--remoting/host/host_plugin.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/remoting/host/host_plugin.cc b/remoting/host/host_plugin.cc
index 11b621e..fd8ea75c 100644
--- a/remoting/host/host_plugin.cc
+++ b/remoting/host/host_plugin.cc
@@ -140,8 +140,6 @@ class HostNPScriptObject {
on_state_changed_func_(NULL),
np_thread_id_(base::PlatformThread::CurrentId()) {
LOG(INFO) << "HostNPScriptObject";
- host_context_.SetUITaskPostFunction(base::Bind(
- &HostNPScriptObject::PostTaskToNPThread, base::Unretained(this)));
}
~HostNPScriptObject() {
@@ -366,8 +364,7 @@ class HostNPScriptObject {
NPVariant* result);
// Posts a task on the main NP thread.
- void PostTaskToNPThread(const tracked_objects::Location& from_here,
- Task* task);
+ void PostTaskToNPThread(Task* task);
// Utility function for PostTaskToNPThread.
static void NPTaskSpringboard(void* task);
@@ -527,10 +524,10 @@ void HostNPScriptObject::OnHostShutdown() {
}
void HostNPScriptObject::OnStateChanged(State state) {
- if (!host_context_.IsUIThread()) {
- host_context_.PostToUIThread(
- FROM_HERE,
- NewRunnableMethod(this, &HostNPScriptObject::OnStateChanged, state));
+ if (base::PlatformThread::CurrentId() != np_thread_id_) {
+ PostTaskToNPThread(NewRunnableMethod(this,
+ &HostNPScriptObject::OnStateChanged,
+ state));
return;
}
state_ = state;
@@ -562,12 +559,7 @@ bool HostNPScriptObject::CallJSFunction(NPObject* func,
return is_good;
}
-void HostNPScriptObject::PostTaskToNPThread(
- const tracked_objects::Location& from_here, Task* task) {
- // The NPAPI functions cannot make use of |from_here|, but this method is
- // passed as a callback to ChromotingHostContext, so it needs to have the
- // appropriate signature.
-
+void HostNPScriptObject::PostTaskToNPThread(Task* task) {
// Can be called from any thread.
g_npnetscape_funcs->pluginthreadasynccall(plugin_,
&NPTaskSpringboard,