| Index: remoting/host/server_log_entry.cc
|
| diff --git a/remoting/host/server_log_entry.cc b/remoting/host/server_log_entry.cc
|
| index 75e2595087d1caf924634a860af9e3e192822aa8..672949fcfaa093399cf903f26bd19ef24b5396dc 100644
|
| --- a/remoting/host/server_log_entry.cc
|
| +++ b/remoting/host/server_log_entry.cc
|
| @@ -17,10 +17,13 @@ using remoting::protocol::Session;
|
| namespace remoting {
|
|
|
| namespace {
|
| +const char kLogCommand[] = "log";
|
| +
|
| const char kLogEntry[] = "entry";
|
|
|
| const char kKeyEventName[] = "event-name";
|
| const char kValueEventNameSessionState[] = "session-state";
|
| +const char kValueEventNameHeartbeat[] = "heartbeat";
|
|
|
| const char kKeyRole[] = "role";
|
| const char kValueRoleHost[] = "host";
|
| @@ -53,6 +56,13 @@ ServerLogEntry::ServerLogEntry() {
|
| ServerLogEntry::~ServerLogEntry() {
|
| }
|
|
|
| +// static
|
| +scoped_ptr<buzz::XmlElement> ServerLogEntry::MakeStanza() {
|
| + return scoped_ptr<buzz::XmlElement>(
|
| + new XmlElement(QName(kChromotingXmlNamespace, kLogCommand)));
|
| +}
|
| +
|
| +// static
|
| ServerLogEntry* ServerLogEntry::MakeSessionStateChange(bool connected) {
|
| ServerLogEntry* entry = new ServerLogEntry();
|
| entry->Set(kKeyRole, kValueRoleHost);
|
| @@ -61,6 +71,14 @@ ServerLogEntry* ServerLogEntry::MakeSessionStateChange(bool connected) {
|
| return entry;
|
| }
|
|
|
| +// static
|
| +ServerLogEntry* ServerLogEntry::MakeForHeartbeat() {
|
| + ServerLogEntry* entry = new ServerLogEntry();
|
| + entry->Set(kKeyRole, kValueRoleHost);
|
| + entry->Set(kKeyEventName, kValueEventNameHeartbeat);
|
| + return entry;
|
| +}
|
| +
|
| void ServerLogEntry::AddHostFields() {
|
| #if defined(OS_WIN)
|
| Set(kKeyOsName, kValueOsNameWindows);
|
| @@ -98,6 +116,7 @@ void ServerLogEntry::AddConnectionTypeField(
|
| Set(kKeyConnectionType, protocol::TransportRoute::GetTypeString(type));
|
| }
|
|
|
| +// static
|
| const char* ServerLogEntry::GetValueMode(ServerLogEntry::Mode mode) {
|
| switch(mode) {
|
| case IT2ME:
|
| @@ -120,6 +139,7 @@ scoped_ptr<XmlElement> ServerLogEntry::ToStanza() const {
|
| return stanza.Pass();
|
| }
|
|
|
| +// static
|
| const char* ServerLogEntry::GetValueSessionState(bool connected) {
|
| return connected ? kValueSessionStateConnected : kValueSessionStateClosed;
|
| }
|
|
|