| OLD | NEW |
| 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_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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 // |signal_strategy| and |delegate| must outlive this | 93 // |signal_strategy| and |delegate| must outlive this |
| 94 // object. Heartbeats will start when the supplied SignalStrategy | 94 // object. Heartbeats will start when the supplied SignalStrategy |
| 95 // enters the CONNECTED state. | 95 // enters the CONNECTED state. |
| 96 HeartbeatSender(Listener* listener, | 96 HeartbeatSender(Listener* listener, |
| 97 const std::string& host_id, | 97 const std::string& host_id, |
| 98 SignalStrategy* signal_strategy, | 98 SignalStrategy* signal_strategy, |
| 99 scoped_refptr<RsaKeyPair> key_pair, | 99 scoped_refptr<RsaKeyPair> key_pair, |
| 100 const std::string& directory_bot_jid); | 100 const std::string& directory_bot_jid); |
| 101 virtual ~HeartbeatSender(); | 101 ~HeartbeatSender() override; |
| 102 | 102 |
| 103 // SignalStrategy::Listener interface. | 103 // SignalStrategy::Listener interface. |
| 104 virtual void OnSignalStrategyStateChange( | 104 void OnSignalStrategyStateChange(SignalStrategy::State state) override; |
| 105 SignalStrategy::State state) override; | 105 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; |
| 106 virtual bool OnSignalStrategyIncomingStanza( | |
| 107 const buzz::XmlElement* stanza) override; | |
| 108 | 106 |
| 109 private: | 107 private: |
| 110 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); | 108 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza); |
| 111 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, | 109 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, |
| 112 DoSendStanzaWithExpectedSequenceId); | 110 DoSendStanzaWithExpectedSequenceId); |
| 113 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage); | 111 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, CreateHeartbeatMessage); |
| 114 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponseSetInterval); | 112 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, ProcessResponseSetInterval); |
| 115 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, | 113 FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, |
| 116 ProcessResponseExpectedSequenceId); | 114 ProcessResponseExpectedSequenceId); |
| 117 | 115 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 141 int sequence_id_recent_set_num_; | 139 int sequence_id_recent_set_num_; |
| 142 bool heartbeat_succeeded_; | 140 bool heartbeat_succeeded_; |
| 143 int failed_startup_heartbeat_count_; | 141 int failed_startup_heartbeat_count_; |
| 144 | 142 |
| 145 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); | 143 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); |
| 146 }; | 144 }; |
| 147 | 145 |
| 148 } // namespace remoting | 146 } // namespace remoting |
| 149 | 147 |
| 150 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ | 148 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ |
| OLD | NEW |