| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // stanza of this form: | 72 // stanza of this form: |
| 73 // | 73 // |
| 74 // <iq type="set" from="remoting@bot.talk.google.com" | 74 // <iq type="set" from="remoting@bot.talk.google.com" |
| 75 // to="user@gmail.com/chromoting123123" id="5" xmlns="jabber:client"> | 75 // to="user@gmail.com/chromoting123123" id="5" xmlns="jabber:client"> |
| 76 // <rem:heartbeat-result xmlns:rem="google:remoting"> | 76 // <rem:heartbeat-result xmlns:rem="google:remoting"> |
| 77 // <rem:expected-sequence-id>654</rem:expected-sequence-id> | 77 // <rem:expected-sequence-id>654</rem:expected-sequence-id> |
| 78 // </rem:heartbeat-result> | 78 // </rem:heartbeat-result> |
| 79 // </iq> | 79 // </iq> |
| 80 class HeartbeatSender : public SignalStrategy::Listener { | 80 class HeartbeatSender : public SignalStrategy::Listener { |
| 81 public: | 81 public: |
| 82 // Doesn't take ownership of |signal_strategy| or |key_pair|. Both | 82 // |signal_strategy| and |key_pair| must outlive this |
| 83 // parameters must outlive this object. Heartbeats will start when | 83 // object. Heartbeats will start when the supplied SignalStrategy |
| 84 // the supplied SignalStrategy enters the CONNECTED state. | 84 // enters the CONNECTED state. |
| 85 HeartbeatSender(const std::string& host_id, | 85 HeartbeatSender(const std::string& host_id, |
| 86 SignalStrategy* signal_strategy, | 86 SignalStrategy* signal_strategy, |
| 87 HostKeyPair* key_pair); | 87 HostKeyPair* key_pair); |
| 88 virtual ~HeartbeatSender(); | 88 virtual ~HeartbeatSender(); |
| 89 | 89 |
| 90 // SignalStrategy::Listener interface. | 90 // SignalStrategy::Listener interface. |
| 91 virtual void OnSignalStrategyStateChange( | 91 virtual void OnSignalStrategyStateChange( |
| 92 SignalStrategy::State state) OVERRIDE; | 92 SignalStrategy::State state) OVERRIDE; |
| 93 | 93 |
| 94 private: | 94 private: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 122 int sequence_id_; | 122 int sequence_id_; |
| 123 bool sequence_id_was_set_; | 123 bool sequence_id_was_set_; |
| 124 int sequence_id_recent_set_num_; | 124 int sequence_id_recent_set_num_; |
| 125 | 125 |
| 126 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); | 126 DISALLOW_COPY_AND_ASSIGN(HeartbeatSender); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace remoting | 129 } // namespace remoting |
| 130 | 130 |
| 131 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ | 131 #endif // REMOTING_HOST_HEARTBEAT_SENDER_H_ |
| OLD | NEW |