OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_HEARTBEAT_SENDER_H_ | 5 #ifndef REMOTING_HOST_HEARTBEAT_SENDER_H_ |
6 #define REMOTING_HOST_HEARTBEAT_SENDER_H_ | 6 #define REMOTING_HOST_HEARTBEAT_SENDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 virtual ~HeartbeatSender(); | 63 virtual ~HeartbeatSender(); |
64 | 64 |
65 // Initializes heart-beating for |jingle_client_| with |config_|. Returns | 65 // Initializes heart-beating for |jingle_client_| with |config_|. Returns |
66 // false if the config is invalid (e.g. private key cannot be parsed). | 66 // false if the config is invalid (e.g. private key cannot be parsed). |
67 bool Init(); | 67 bool Init(); |
68 | 68 |
69 // HostStatusObserver implementation. | 69 // HostStatusObserver implementation. |
70 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, | 70 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, |
71 const std::string& full_jid) OVERRIDE; | 71 const std::string& full_jid) OVERRIDE; |
72 virtual void OnSignallingDisconnected() OVERRIDE; | 72 virtual void OnSignallingDisconnected() OVERRIDE; |
73 virtual void OnAuthenticatedClientsChanged(int clients) OVERRIDE; | 73 virtual void OnClientAuthenticated( |
| 74 remoting::protocol::ConnectionToClient* client) OVERRIDE; |
| 75 virtual void OnClientDisconnected( |
| 76 remoting::protocol::ConnectionToClient* client) OVERRIDE; |
74 virtual void OnAccessDenied() OVERRIDE; | 77 virtual void OnAccessDenied() OVERRIDE; |
75 virtual void OnShutdown() OVERRIDE; | 78 virtual void OnShutdown() OVERRIDE; |
76 | 79 |
77 private: | 80 private: |
78 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); | 81 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); |
79 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage); | 82 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage); |
80 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponse); | 83 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponse); |
81 | 84 |
82 enum State { | 85 enum State { |
83 CREATED, | 86 CREATED, |
(...skipping 20 matching lines...) Expand all Loading... |
104 scoped_ptr<IqRequest> request_; | 107 scoped_ptr<IqRequest> request_; |
105 int interval_ms_; | 108 int interval_ms_; |
106 base::RepeatingTimer<HeartbeatSender> timer_; | 109 base::RepeatingTimer<HeartbeatSender> timer_; |
107 | 110 |
108 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); | 111 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); |
109 }; | 112 }; |
110 | 113 |
111 } // namespace remoting | 114 } // namespace remoting |
112 | 115 |
113 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ | 116 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ |
OLD | NEW |