OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_HOST_SERVER_LOG_ENTRY_H_ |
| 6 #define REMOTING_HOST_SERVER_LOG_ENTRY_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 |
| 11 namespace buzz { |
| 12 class XmlElement; |
| 13 } // namespace buzz |
| 14 |
| 15 namespace remoting { |
| 16 |
| 17 class ServerLogEntry { |
| 18 public: |
| 19 // Constructs a log entry for a session state change. |
| 20 // Currently this is either connection or disconnection. |
| 21 static ServerLogEntry* MakeSessionStateChange(bool connection); |
| 22 |
| 23 ~ServerLogEntry(); |
| 24 |
| 25 // Adds fields describing the host to this log entry. |
| 26 void AddHostFields(); |
| 27 |
| 28 // Converts this object to an XML stanza. |
| 29 // The caller takes ownership of the stanza. |
| 30 buzz::XmlElement* ToStanza() const; |
| 31 |
| 32 private: |
| 33 typedef std::map<std::string, std::string> ValuesMap; |
| 34 |
| 35 ServerLogEntry(); |
| 36 void Set(const char* key, const char* value); |
| 37 |
| 38 static const char* GetValueSessionState(bool connected); |
| 39 |
| 40 ValuesMap values_map_; |
| 41 }; |
| 42 |
| 43 } // namespace remoting |
| 44 |
| 45 #endif |
OLD | NEW |