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

Unified Diff: remoting/host/server_log_entry.cc

Issue 18075003: Host offline status reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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/server_log_entry.h ('k') | remoting/protocol/name_value_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/server_log_entry.cc
diff --git a/remoting/host/server_log_entry.cc b/remoting/host/server_log_entry.cc
index f18b2378d2673da82082e78b100c217c6e3ebae4..b13f6c667b2e06289826c819c0ea682fd7a6262e 100644
--- a/remoting/host/server_log_entry.cc
+++ b/remoting/host/server_log_entry.cc
@@ -26,6 +26,7 @@ const char kLogEntry[] = "entry";
const char kKeyEventName[] = "event-name";
const char kValueEventNameSessionState[] = "session-state";
const char kValueEventNameHeartbeat[] = "heartbeat";
+const char kValueEventNameHostStatus[] = "host-status";
const char kKeyRole[] = "role";
const char kValueRoleHost[] = "host";
@@ -38,6 +39,9 @@ const char kKeySessionState[] = "session-state";
const char kValueSessionStateConnected[] = "connected";
const char kValueSessionStateClosed[] = "closed";
+const char kStatusName[] = "status";
+const char kExitCodeName[] = "exit-code";
+
const char kKeyOsName[] = "os-name";
const char kValueOsNameWindows[] = "Windows";
const char kValueOsNameLinux[] = "Linux";
@@ -84,6 +88,18 @@ scoped_ptr<ServerLogEntry> ServerLogEntry::MakeForHeartbeat() {
return entry.Pass();
}
+// static
+scoped_ptr<ServerLogEntry> ServerLogEntry::MakeForHostStatus(
+ HostStatusSender::HostStatus host_status, HostExitCodes exit_code) {
+ scoped_ptr<ServerLogEntry> entry(new ServerLogEntry());
+ entry->Set(kKeyRole, kValueRoleHost);
+ entry->Set(kKeyEventName, kValueEventNameHostStatus);
+ entry->Set(kStatusName, HostStatusSender::HostStatusToString(host_status));
+ if (host_status == HostStatusSender::OFFLINE)
+ entry->Set(kExitCodeName, ExitCodeToString(exit_code));
+ return entry.Pass();
+}
+
void ServerLogEntry::AddHostFields() {
#if defined(OS_WIN)
Set(kKeyOsName, kValueOsNameWindows);
« no previous file with comments | « remoting/host/server_log_entry.h ('k') | remoting/protocol/name_value_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698