summaryrefslogtreecommitdiffstats
path: root/remoting/host
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-07 02:18:46 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-07 02:18:46 +0000
commit5272ff3b41be1ff32138375791e8296095ab964d (patch)
treeaeb4346417b59f26f40ccb2d65768bf9c867b2af /remoting/host
parent464f0010efef2b301fec3ac939824ca52b9fc20f (diff)
downloadchromium_src-5272ff3b41be1ff32138375791e8296095ab964d.zip
chromium_src-5272ff3b41be1ff32138375791e8296095ab964d.tar.gz
chromium_src-5272ff3b41be1ff32138375791e8296095ab964d.tar.bz2
Shutdown JingleSessionManager and SingalStartegy and send OnSignallingDisconnected() on the right thread.
TEST=None BUG=None. Review URL: http://codereview.chromium.org/7314014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/chromoting_host.cc46
-rw-r--r--remoting/host/chromoting_host.h1
2 files changed, 29 insertions, 18 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index f5f0fa9..3923484 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -159,24 +159,7 @@ void ChromotingHost::Shutdown(Task* shutdown_task) {
}
clients_.clear();
- // Stop chromotocol session manager.
- if (session_manager_.get()) {
- session_manager_->Close();
- session_manager_.reset();
- }
-
- // Stop XMPP connection.
- if (signal_strategy_.get()) {
- signal_strategy_->Close();
- signal_strategy_.reset();
-
- for (StatusObserverList::iterator it = status_observers_.begin();
- it != status_observers_.end(); ++it) {
- (*it)->OnSignallingDisconnected();
- }
- }
-
- ShutdownRecorder();
+ ShutdownNetwork();
}
void ChromotingHost::AddStatusObserver(HostStatusObserver* observer) {
@@ -639,6 +622,33 @@ void ChromotingHost::ContinueWindowTimerFunc() {
ShowContinueWindow(true);
}
+void ChromotingHost::ShutdownNetwork() {
+ if (MessageLoop::current() != context_->network_message_loop()) {
+ context_->network_message_loop()->PostTask(
+ FROM_HERE, base::Bind(&ChromotingHost::ShutdownNetwork, this));
+ return;
+ }
+
+ // Stop chromotocol session manager.
+ if (session_manager_.get()) {
+ session_manager_->Close();
+ session_manager_.reset();
+ }
+
+ // Stop XMPP connection.
+ if (signal_strategy_.get()) {
+ signal_strategy_->Close();
+ signal_strategy_.reset();
+
+ for (StatusObserverList::iterator it = status_observers_.begin();
+ it != status_observers_.end(); ++it) {
+ (*it)->OnSignallingDisconnected();
+ }
+ }
+
+ ShutdownRecorder();
+}
+
void ChromotingHost::ShutdownRecorder() {
if (MessageLoop::current() != context_->main_message_loop()) {
context_->main_message_loop()->PostTask(
diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h
index 50dac75..0635dcc 100644
--- a/remoting/host/chromoting_host.h
+++ b/remoting/host/chromoting_host.h
@@ -192,6 +192,7 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
void ContinueWindowTimerFunc();
// The following methods are called during shutdown.
+ void ShutdownNetwork();
void ShutdownRecorder();
void ShutdownFinish();