summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 00:45:32 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 00:45:32 +0000
commit58b48978267e72777344231c4680e68aa94c6add (patch)
tree28f527b6297c4ac93a03a2ed64e91409e65daf46
parent74ecb5a48410545f8b52019e0466fa4ab4336740 (diff)
downloadchromium_src-58b48978267e72777344231c4680e68aa94c6add.zip
chromium_src-58b48978267e72777344231c4680e68aa94c6add.tar.gz
chromium_src-58b48978267e72777344231c4680e68aa94c6add.tar.bz2
Allows chromoting host to be connected again after connection drops.
BUG=52890 TEST=Connects to chromoting disconnect, and then try again This allows basic reconnect functions of the chromoting host. We still have the following problems: 1. We don't have a disconnect command. 2. If we are waiting for client connection to time out we don't allow second connection. 3. Need to force a full frame update after a new client is connected. I am going to solve the above problems in separate patches but this patch will allow basic reconnect to work. Review URL: http://codereview.chromium.org/3320003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58441 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/host/chromoting_host.cc18
-rw-r--r--remoting/host/session_manager.cc4
2 files changed, 10 insertions, 12 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 18f6399..740f0f6 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -68,15 +68,12 @@ void ChromotingHost::OnClientConnected(ClientConnection* client) {
context_->main_message_loop(),
capturer_.get(),
encoder_.get());
-
- // Immediately add the client and start the session.
- session_->AddClient(client);
- session_->Start();
- LOG(INFO) << "Session manager started";
- } else {
- // If a session manager already exists we simply add the new client.
- session_->AddClient(client);
}
+
+ // Immediately add the client and start the session.
+ session_->AddClient(client);
+ session_->Start();
+ LOG(INFO) << "Session manager started";
}
void ChromotingHost::OnClientDisconnected(ClientConnection* client) {
@@ -89,6 +86,9 @@ void ChromotingHost::OnClientDisconnected(ClientConnection* client) {
session_->Pause();
}
+ // Close the connection to client just to be safe.
+ client->Disconnect();
+
// Also remove reference to ClientConnection from this object.
client_ = NULL;
}
@@ -117,7 +117,6 @@ void ChromotingHost::OnConnectionOpened(ClientConnection* client) {
void ChromotingHost::OnConnectionClosed(ClientConnection* client) {
DCHECK_EQ(context_->main_message_loop(), MessageLoop::current());
- // Completes the client connection.
LOG(INFO) << "Connection to client closed.";
OnClientDisconnected(client_.get());
}
@@ -125,7 +124,6 @@ void ChromotingHost::OnConnectionClosed(ClientConnection* client) {
void ChromotingHost::OnConnectionFailed(ClientConnection* client) {
DCHECK_EQ(context_->main_message_loop(), MessageLoop::current());
- // The client has disconnected.
LOG(ERROR) << "Connection failed unexpectedly.";
OnClientDisconnected(client_.get());
}
diff --git a/remoting/host/session_manager.cc b/remoting/host/session_manager.cc
index 3da20b7..7982b16 100644
--- a/remoting/host/session_manager.cc
+++ b/remoting/host/session_manager.cc
@@ -111,7 +111,7 @@ void SessionManager::DoStart() {
DCHECK_EQ(capture_loop_, MessageLoop::current());
if (started_) {
- NOTREACHED() << "Record session already started";
+ NOTREACHED() << "Record session already started.";
return;
}
@@ -128,7 +128,7 @@ void SessionManager::DoPause() {
DCHECK_EQ(capture_loop_, MessageLoop::current());
if (!started_) {
- NOTREACHED() << "Record session not started";
+ NOTREACHED() << "Record session not started.";
return;
}