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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 virtual ~HeartbeatSender(); | 67 virtual ~HeartbeatSender(); |
68 | 68 |
69 // Initializes heart-beating for |jingle_client_| with |config_|. Returns | 69 // Initializes heart-beating for |jingle_client_| with |config_|. Returns |
70 // false if the config is invalid (e.g. private key cannot be parsed). | 70 // false if the config is invalid (e.g. private key cannot be parsed). |
71 bool Init(); | 71 bool Init(); |
72 | 72 |
73 // HostStatusObserver implementation. | 73 // HostStatusObserver implementation. |
74 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, | 74 virtual void OnSignallingConnected(SignalStrategy* signal_strategy, |
75 const std::string& full_jid) OVERRIDE; | 75 const std::string& full_jid) OVERRIDE; |
76 virtual void OnSignallingDisconnected() OVERRIDE; | 76 virtual void OnSignallingDisconnected() OVERRIDE; |
77 virtual void OnClientAuthenticated( | 77 virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE; |
78 remoting::protocol::ConnectionToClient* client) OVERRIDE; | 78 virtual void OnClientDisconnected(const std::string& jid) OVERRIDE; |
79 virtual void OnClientDisconnected( | |
80 remoting::protocol::ConnectionToClient* client) OVERRIDE; | |
81 virtual void OnAccessDenied() OVERRIDE; | 79 virtual void OnAccessDenied() OVERRIDE; |
82 virtual void OnShutdown() OVERRIDE; | 80 virtual void OnShutdown() OVERRIDE; |
83 | 81 |
84 private: | 82 private: |
85 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); | 83 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); |
86 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage); | 84 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage); |
87 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponse); | 85 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponse); |
88 | 86 |
89 enum State { | 87 enum State { |
90 CREATED, | 88 CREATED, |
(...skipping 20 matching lines...) Expand all Loading... |
111 scoped_ptr<IqRequest> request_; | 109 scoped_ptr<IqRequest> request_; |
112 int interval_ms_; | 110 int interval_ms_; |
113 base::RepeatingTimer<HeartbeatSender> timer_; | 111 base::RepeatingTimer<HeartbeatSender> timer_; |
114 | 112 |
115 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); | 113 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); |
116 }; | 114 }; |
117 | 115 |
118 } // namespace remoting | 116 } // namespace remoting |
119 | 117 |
120 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ | 118 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ |
OLD | NEW |