diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 02:40:00 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 02:40:00 +0000 |
commit | c49a71c0554b0e57a103207da4b74b2d9f9e4db2 (patch) | |
tree | 8d63086a2bf03681fc7cb620e53acf15f739d95b /remoting | |
parent | 4d80f17af1a06824c36f03c7fef5a926c51921c4 (diff) | |
download | chromium_src-c49a71c0554b0e57a103207da4b74b2d9f9e4db2.zip chromium_src-c49a71c0554b0e57a103207da4b74b2d9f9e4db2.tar.gz chromium_src-c49a71c0554b0e57a103207da4b74b2d9f9e4db2.tar.bz2 |
Shutdown It2Me host UI only after the host is stopped.
Currently user interface object is destroyed before host is stopped.
The destructor for UserInterface object doesn't unregister that object
from list of host status observers, and it cannot do that because the
destructor is executed on the UI thread. In the same time it's no
longer necessary to destroy UI before the host is stopped. Changed
plugin destruction sequence so that UI is destroyed only after the
host is stopped.
BUG=130596
Review URL: https://chromiumcodereview.appspot.com/10533138
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/plugin/host_script_object.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index 9158752..6a56ff7 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -96,10 +96,6 @@ HostNPScriptObject::HostNPScriptObject( HostNPScriptObject::~HostNPScriptObject() { CHECK_EQ(base::PlatformThread::CurrentId(), np_thread_id_); - // Shutdown It2MeHostUserInterface first so that it doesn't try to post - // tasks on the UI thread while we are stopping the host. - it2me_host_user_interface_.reset(); - HostLogHandler::UnregisterLoggingScriptObject(this); plugin_message_loop_proxy_->Detach(); @@ -121,6 +117,13 @@ HostNPScriptObject::~HostNPScriptObject() { DisconnectInternal(); disconnected_event_.Wait(); + // UI needs to be shut down on the UI thread before we destroy the + // host context (because it depends on the context object), but + // only after the host has been shut down (becase the UI object is + // registered as status observer for the host, and we can't + // unregister it from this thread). + it2me_host_user_interface_.reset(); + // Stops all threads. host_context_.reset(); } |