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

Unified Diff: remoting/protocol/connection_to_host.cc

Issue 7218061: Close all writers before JingleSession is destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 6 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
Index: remoting/protocol/connection_to_host.cc
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 03f388ce0ab2fe9ece333ce048589157e1c76dbe..6b7c5c7b9ba8ba46b96171433c69ac8b32327d9b 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -44,11 +44,11 @@ ConnectionToHost::~ConnectionToHost() {
}
InputStub* ConnectionToHost::input_stub() {
- return input_stub_.get();
+ return input_sender_.get();
}
HostStub* ConnectionToHost::host_stub() {
- return host_stub_.get();
+ return host_control_sender_.get();
}
void ConnectionToHost::Connect(scoped_refptr<XmppProxy> xmpp_proxy,
@@ -84,6 +84,12 @@ void ConnectionToHost::Disconnect(const base::Closure& shutdown_task) {
return;
}
+ if (input_sender_.get())
+ input_sender_->Close();
+
+ if (host_control_sender_.get())
+ host_control_sender_->Close();
Wez 2011/06/30 18:27:31 Same as ConnectionToClient.
Sergey Ulanov 2011/06/30 20:55:24 Done.
+
if (session_) {
session_->Close(
NewRunnableMethod(this, &ConnectionToHost::OnDisconnected,
@@ -200,7 +206,8 @@ void ConnectionToHost::OnSessionStateChange(
// Initialize reader and writer.
video_reader_.reset(VideoReader::Create(session_->config()));
video_reader_->Init(session_, video_stub_);
- host_stub_.reset(new HostControlSender(session_->control_channel()));
+ host_control_sender_.reset(
+ new HostControlSender(session_->control_channel()));
dispatcher_->Initialize(session_.get(), client_stub_);
event_callback_->OnConnectionOpened(this);
break;
@@ -217,7 +224,7 @@ void ConnectionToHost::OnClientAuthenticated() {
state_ = STATE_AUTHENTICATED;
// Create and enable the input stub now that we're authenticated.
- input_stub_.reset(new InputSender(session_->event_channel()));
+ input_sender_.reset(new InputSender(session_->event_channel()));
}
ConnectionToHost::State ConnectionToHost::state() const {

Powered by Google App Engine
This is Rietveld 408576698