| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/server_log_entry.h" | 5 #include "remoting/host/server_log_entry.h" |
| 6 | 6 |
| 7 #include "base/sys_info.h" | 7 #include "base/sys_info.h" |
| 8 #include "remoting/base/constants.h" | 8 #include "remoting/base/constants.h" |
| 9 #include "remoting/protocol/session.h" | 9 #include "remoting/protocol/session.h" |
| 10 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 10 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 case IT2ME: | 95 case IT2ME: |
| 96 return kValueModeIt2Me; | 96 return kValueModeIt2Me; |
| 97 case ME2ME: | 97 case ME2ME: |
| 98 return kValueModeMe2Me; | 98 return kValueModeMe2Me; |
| 99 default: | 99 default: |
| 100 NOTREACHED(); | 100 NOTREACHED(); |
| 101 return NULL; | 101 return NULL; |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 XmlElement* ServerLogEntry::ToStanza() const { | 105 scoped_ptr<XmlElement> ServerLogEntry::ToStanza() const { |
| 106 XmlElement* stanza = new XmlElement(QName( | 106 scoped_ptr<XmlElement> stanza(new XmlElement(QName( |
| 107 kChromotingXmlNamespace, kLogEntry)); | 107 kChromotingXmlNamespace, kLogEntry))); |
| 108 ValuesMap::const_iterator iter; | 108 ValuesMap::const_iterator iter; |
| 109 for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) { | 109 for (iter = values_map_.begin(); iter != values_map_.end(); ++iter) { |
| 110 stanza->AddAttr(QName("", iter->first), iter->second); | 110 stanza->AddAttr(QName("", iter->first), iter->second); |
| 111 } | 111 } |
| 112 return stanza; | 112 return stanza.Pass(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 const char* ServerLogEntry::GetValueSessionState(bool connected) { | 115 const char* ServerLogEntry::GetValueSessionState(bool connected) { |
| 116 return connected ? kValueSessionStateConnected : kValueSessionStateClosed; | 116 return connected ? kValueSessionStateConnected : kValueSessionStateClosed; |
| 117 } | 117 } |
| 118 | 118 |
| 119 void ServerLogEntry::Set(const char* key, const char* value) { | 119 void ServerLogEntry::Set(const char* key, const char* value) { |
| 120 values_map_[key] = value; | 120 values_map_[key] = value; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace remoting | 123 } // namespace remoting |
| OLD | NEW |