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

Unified Diff: remoting/host/log_to_server.cc

Issue 10413035: [Chromoting] LogToServer correctly handles multiple simultaneous connections. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync. Created 8 years, 7 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
« no previous file with comments | « remoting/host/log_to_server.h ('k') | remoting/host/log_to_server_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/log_to_server.cc
diff --git a/remoting/host/log_to_server.cc b/remoting/host/log_to_server.cc
index 212143c7b981ee6e805336d852ff2cb4d28aa31a..25e2f77f8b0c0f4d413e3cb11b6983df45214444 100644
--- a/remoting/host/log_to_server.cc
+++ b/remoting/host/log_to_server.cc
@@ -26,8 +26,7 @@ LogToServer::LogToServer(ChromotingHost* host,
SignalStrategy* signal_strategy)
: host_(host),
mode_(mode),
- signal_strategy_(signal_strategy),
- connection_type_set_(false) {
+ signal_strategy_(signal_strategy) {
signal_strategy_->AddListener(this);
// |host| may be NULL in tests.
@@ -41,7 +40,8 @@ LogToServer::~LogToServer() {
host_->RemoveStatusObserver(this);
}
-void LogToServer::LogSessionStateChange(bool connected) {
+void LogToServer::LogSessionStateChange(const std::string& jid,
+ bool connected) {
DCHECK(CalledOnValidThread());
scoped_ptr<ServerLogEntry> entry(
@@ -50,8 +50,8 @@ void LogToServer::LogSessionStateChange(bool connected) {
entry->AddModeField(mode_);
if (connected) {
- DCHECK(connection_type_set_);
- entry->AddConnectionTypeField(connection_type_);
+ DCHECK(connection_route_type_.count(jid) == 1);
+ entry->AddConnectionTypeField(connection_route_type_[jid]);
}
Log(*entry.get());
}
@@ -69,13 +69,13 @@ void LogToServer::OnSignalStrategyStateChange(SignalStrategy::State state) {
void LogToServer::OnClientConnected(const std::string& jid) {
DCHECK(CalledOnValidThread());
- LogSessionStateChange(true);
+ LogSessionStateChange(jid, true);
}
void LogToServer::OnClientDisconnected(const std::string& jid) {
DCHECK(CalledOnValidThread());
- LogSessionStateChange(false);
- connection_type_set_ = false;
+ LogSessionStateChange(jid, false);
+ connection_route_type_.erase(jid);
}
void LogToServer::OnClientRouteChange(const std::string& jid,
@@ -84,8 +84,7 @@ void LogToServer::OnClientRouteChange(const std::string& jid,
// Store connection type for the video channel. It is logged later
// when client authentication is finished.
if (channel_name == kVideoChannelName) {
- connection_type_ = route.type;
- connection_type_set_ = true;
+ connection_route_type_[jid] = route.type;
}
}
« no previous file with comments | « remoting/host/log_to_server.h ('k') | remoting/host/log_to_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698