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 OnShutdown() OVERRIDE; | 74 virtual void OnShutdown() OVERRIDE; |
74 | 75 |
75 private: | 76 private: |
76 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); | 77 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); |
77 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage); | 78 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage); |
78 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponse); | 79 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponse); |
79 | 80 |
80 enum State { | 81 enum State { |
81 CREATED, | 82 CREATED, |
82 INITIALIZED, | 83 INITIALIZED, |
(...skipping 19 matching lines...) Expand all Loading... |
102 scoped_ptr<IqRequest> request_; | 103 scoped_ptr<IqRequest> request_; |
103 int interval_ms_; | 104 int interval_ms_; |
104 base::RepeatingTimer<HeartbeatSender> timer_; | 105 base::RepeatingTimer<HeartbeatSender> timer_; |
105 | 106 |
106 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); | 107 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); |
107 }; | 108 }; |
108 | 109 |
109 } // namespace remoting | 110 } // namespace remoting |
110 | 111 |
111 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ | 112 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ |
OLD | NEW |