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

Unified Diff: remoting/client/log_to_server.cc

Issue 282063005: Pull out common code from client and host versions of ServerLogEntry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move ServerLogEntry to jingle_glue Created 6 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/client/log_to_server.h ('k') | remoting/client/server_log_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/log_to_server.cc
diff --git a/remoting/client/log_to_server.cc b/remoting/client/log_to_server.cc
index c45ad386cb265294af42c52a783c18e60264d57c..e29de13584babf3a25cc8cf46d6c87a54063303d 100644
--- a/remoting/client/log_to_server.cc
+++ b/remoting/client/log_to_server.cc
@@ -8,6 +8,7 @@
#include "base/rand_util.h"
#include "remoting/base/constants.h"
#include "remoting/client/chromoting_stats.h"
+#include "remoting/client/server_log_entry_client.h"
#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/jingle_glue/signal_strategy.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
@@ -69,8 +70,8 @@ void LogToServer::LogSessionStateChange(
DCHECK(CalledOnValidThread());
scoped_ptr<ServerLogEntry> entry(
- ServerLogEntry::MakeForSessionStateChange(state, error));
- entry->AddClientFields();
+ MakeLogEntryForSessionStateChange(state, error));
+ AddClientFieldsToLogEntry(entry.get());
entry->AddModeField(mode_);
MaybeExpireSessionId();
@@ -85,12 +86,13 @@ void LogToServer::LogSessionStateChange(
}
if (!session_id_.empty()) {
- entry->AddSessionId(session_id_);
+ AddSessionIdToLogEntry(entry.get(), session_id_);
}
// Maybe clear the session start time and log the session duration.
if (ShouldAddDuration(state) && !session_start_time_.is_null()) {
- entry->AddSessionDuration(base::TimeTicks::Now() - session_start_time_);
+ AddSessionDurationToLogEntry(entry.get(),
+ base::TimeTicks::Now() - session_start_time_);
}
if (IsEndOfSession(state)) {
@@ -106,11 +108,10 @@ void LogToServer::LogStatistics(ChromotingStats* statistics) {
MaybeExpireSessionId();
- scoped_ptr<ServerLogEntry> entry(
- ServerLogEntry::MakeForStatistics(statistics));
- entry->AddClientFields();
+ scoped_ptr<ServerLogEntry> entry(MakeLogEntryForStatistics(statistics));
+ AddClientFieldsToLogEntry(entry.get());
entry->AddModeField(mode_);
- entry->AddSessionId(session_id_);
+ AddSessionIdToLogEntry(entry.get(), session_id_);
Log(*entry.get());
}
@@ -174,8 +175,7 @@ void LogToServer::MaybeExpireSessionId() {
base::TimeDelta max_age = base::TimeDelta::FromDays(kMaxSessionIdAgeDays);
if (base::TimeTicks::Now() - session_id_generation_time_ > max_age) {
// Log the old session ID.
- scoped_ptr<ServerLogEntry> entry(
- ServerLogEntry::MakeForSessionIdOld(session_id_));
+ scoped_ptr<ServerLogEntry> entry(MakeLogEntryForSessionIdOld(session_id_));
entry->AddModeField(mode_);
Log(*entry.get());
@@ -183,7 +183,7 @@ void LogToServer::MaybeExpireSessionId() {
GenerateSessionId();
// Log the new session ID.
- entry = ServerLogEntry::MakeForSessionIdNew(session_id_);
+ entry = MakeLogEntryForSessionIdNew(session_id_);
entry->AddModeField(mode_);
Log(*entry.get());
}
« no previous file with comments | « remoting/client/log_to_server.h ('k') | remoting/client/server_log_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698