OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_HOST_LOG_TO_SERVER_HOST_H_ |
| 6 #define REMOTING_HOST_LOG_TO_SERVER_HOST_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/memory/weak_ptr.h" |
| 11 #include "remoting/host/host_status_observer.h" |
| 12 #include "remoting/jingle_glue/log_to_server.h" |
| 13 #include "remoting/protocol/transport.h" |
| 14 |
| 15 namespace remoting { |
| 16 |
| 17 class HostStatusMonitor; |
| 18 |
| 19 // LogToServerHost sends host log entries to a server. |
| 20 // The contents of the log entries are described in server_log_entry_host.cc. |
| 21 // They do not contain any personally identifiable information. |
| 22 class LogToServerHost : public HostStatusObserver, |
| 23 public LogToServer { |
| 24 public: |
| 25 LogToServerHost(base::WeakPtr<HostStatusMonitor> monitor, |
| 26 ServerLogEntry::Mode mode, |
| 27 SignalStrategy* signal_strategy, |
| 28 const std::string& directory_bot_jid); |
| 29 virtual ~LogToServerHost() OVERRIDE; |
| 30 |
| 31 // Logs a session state change. Currently, this is either |
| 32 // connection or disconnection. |
| 33 void LogSessionStateChange(const std::string& jid, bool connected); |
| 34 |
| 35 // HostStatusObserver interface. |
| 36 virtual void OnClientConnected(const std::string& jid) OVERRIDE; |
| 37 virtual void OnClientDisconnected(const std::string& jid) OVERRIDE; |
| 38 virtual void OnClientRouteChange( |
| 39 const std::string& jid, |
| 40 const std::string& channel_name, |
| 41 const protocol::TransportRoute& route) OVERRIDE; |
| 42 |
| 43 private: |
| 44 base::WeakPtr<HostStatusMonitor> monitor_; |
| 45 |
| 46 // A map from client JID to the route type of that client's connection to |
| 47 // this host. |
| 48 std::map<std::string, protocol::TransportRoute::RouteType> |
| 49 connection_route_type_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(LogToServerHost); |
| 52 }; |
| 53 |
| 54 } // namespace remoting |
| 55 |
| 56 #endif // REMOTING_HOST_LOG_TO_SERVER_HOST_H_ |
OLD | NEW |