diff options
author | weitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-10 03:57:06 +0000 |
---|---|---|
committer | weitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-10 03:57:06 +0000 |
commit | 929fb4e415bec4565b9eea7254f5ac019c7648b5 (patch) | |
tree | 6eaf066b57413f021ebc2fdaaf35abf494721a8b /remoting/host/server_log_entry.cc | |
parent | 47b37a6c0e164891bfa3993687cd3cc3edd113c6 (diff) | |
download | chromium_src-929fb4e415bec4565b9eea7254f5ac019c7648b5.zip chromium_src-929fb4e415bec4565b9eea7254f5ac019c7648b5.tar.gz chromium_src-929fb4e415bec4565b9eea7254f5ac019c7648b5.tar.bz2 |
Host offline status reporting.
This is change #1 of the Host offline status reporting work:
1. Define the structure of the offline status message.
2. The host sends the offline status message if the underlying XMPP connection is live.
BUG=247245
Review URL: https://chromiumcodereview.appspot.com/18075003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/server_log_entry.cc')
-rw-r--r-- | remoting/host/server_log_entry.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/remoting/host/server_log_entry.cc b/remoting/host/server_log_entry.cc index f18b2378..b13f6c6 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); |