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

Unified Diff: remoting/host/log_to_server.cc

Issue 9727005: Log connection type to syslogs and to the server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 f75764ade6c773917a0a70641f3c988928ff36ad..7decddb0c8066920c490a6e3cf9d87cae8beb54e 100644
--- a/remoting/host/log_to_server.cc
+++ b/remoting/host/log_to_server.cc
@@ -12,6 +12,7 @@
#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/jingle_glue/jingle_thread.h"
#include "remoting/jingle_glue/signal_strategy.h"
+#include "remoting/protocol/transport.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
#include "third_party/libjingle/source/talk/xmpp/constants.h"
@@ -29,7 +30,8 @@ LogToServer::LogToServer(ChromotingHost* host,
SignalStrategy* signal_strategy)
: host_(host),
mode_(mode),
- signal_strategy_(signal_strategy) {
+ signal_strategy_(signal_strategy),
+ connection_type_set_(false) {
signal_strategy_->AddListener(this);
// |host| may be NULL in tests.
@@ -46,10 +48,15 @@ LogToServer::~LogToServer() {
void LogToServer::LogSessionStateChange(bool connected) {
DCHECK(CalledOnValidThread());
- scoped_ptr<ServerLogEntry> entry(ServerLogEntry::MakeSessionStateChange(
- connected));
+ scoped_ptr<ServerLogEntry> entry(
+ ServerLogEntry::MakeSessionStateChange(connected));
entry->AddHostFields();
entry->AddModeField(mode_);
+
+ if (connected) {
+ DCHECK(connection_type_set_);
+ entry->AddConnectionTypeField(connection_type_);
+ }
Log(*entry.get());
}
@@ -72,11 +79,23 @@ void LogToServer::OnClientAuthenticated(const std::string& jid) {
void LogToServer::OnClientDisconnected(const std::string& jid) {
DCHECK(CalledOnValidThread());
LogSessionStateChange(false);
+ connection_type_set_ = false;
}
void LogToServer::OnAccessDenied(const std::string& jid) {
}
+void LogToServer::OnClientRouteChange(const std::string& jid,
+ const std::string& channel_name,
+ const protocol::TransportRoute& route) {
+ // 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;
+ }
+}
+
void LogToServer::OnShutdown() {
}
« 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