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

Side by Side Diff: remoting/host/server_log_entry.h

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 unified diff | Download patch
OLDNEW
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 #ifndef REMOTING_HOST_SERVER_LOG_ENTRY_H_ 5 #ifndef REMOTING_HOST_SERVER_LOG_ENTRY_H_
6 #define REMOTING_HOST_SERVER_LOG_ENTRY_H_ 6 #define REMOTING_HOST_SERVER_LOG_ENTRY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 19 matching lines...) Expand all
30 // the remoting bot. 30 // the remoting bot.
31 static scoped_ptr<buzz::XmlElement> MakeStanza(); 31 static scoped_ptr<buzz::XmlElement> MakeStanza();
32 32
33 // Constructs a log entry for a session state change. 33 // Constructs a log entry for a session state change.
34 // Currently this is either connection or disconnection. 34 // Currently this is either connection or disconnection.
35 static scoped_ptr<ServerLogEntry> MakeForSessionStateChange(bool connection); 35 static scoped_ptr<ServerLogEntry> MakeForSessionStateChange(bool connection);
36 36
37 // Constructs a log entry for a heartbeat. 37 // Constructs a log entry for a heartbeat.
38 static scoped_ptr<ServerLogEntry> MakeForHeartbeat(); 38 static scoped_ptr<ServerLogEntry> MakeForHeartbeat();
39 39
40 // Constructs a log entry for a host status message.
41 static scoped_ptr<ServerLogEntry> MakeForHostStatus();
42
40 ~ServerLogEntry(); 43 ~ServerLogEntry();
41 44
42 // Adds fields describing the host to this log entry. 45 // Adds fields describing the host to this log entry.
43 void AddHostFields(); 46 void AddHostFields();
44 47
45 // Adds a field describing the mode of a connection to this log entry. 48 // Adds a field describing the mode of a connection to this log entry.
46 void AddModeField(Mode mode); 49 void AddModeField(Mode mode);
47 50
48 // Adds a field describing connection type (direct/stun/relay). 51 // Adds a field describing connection type (direct/stun/relay).
49 void AddConnectionTypeField(protocol::TransportRoute::RouteType type); 52 void AddConnectionTypeField(protocol::TransportRoute::RouteType type);
50 53
54 void AddCustomField(const std::string& name, const std::string& value);
55
51 // Converts this object to an XML stanza. 56 // Converts this object to an XML stanza.
52 scoped_ptr<buzz::XmlElement> ToStanza() const; 57 scoped_ptr<buzz::XmlElement> ToStanza() const;
53 58
54 private: 59 private:
55 typedef std::map<std::string, std::string> ValuesMap; 60 typedef std::map<std::string, std::string> ValuesMap;
56 61
57 ServerLogEntry(); 62 ServerLogEntry();
58 void Set(const std::string& key, const std::string& value); 63 void Set(const std::string& key, const std::string& value);
59 64
60 static const char* GetValueSessionState(bool connected); 65 static const char* GetValueSessionState(bool connected);
61 static const char* GetValueMode(Mode mode); 66 static const char* GetValueMode(Mode mode);
62 67
63 ValuesMap values_map_; 68 ValuesMap values_map_;
64 }; 69 };
65 70
66 } // namespace remoting 71 } // namespace remoting
67 72
68 #endif 73 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698